/** * HandleToDo * Work out which function to run * * @param String $Do Which action to run * @return Void */ public function HandleToDo($Do) { if(GetConfig('DisableAddons') == true) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('addons'); switch (isc_strtolower($Do)) { case "purchasedownloadaddons": { if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Customers)) { $this->PurchaseAddonForm(); } break; } default: { if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Customers)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Addons') => "index.php?ToDo=viewDownloadAddons"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->ListAddons(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; } } }
public function HandleToDo() { /** * Convert the input character set from the hard coded UTF-8 to their * selected character set */ convertRequestInput(); $what = isc_strtolower(@$_REQUEST['w']); switch ($what) { case "addcustomfield": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Create_Product) || $GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Edit_Products)) { $this->addCustomField(); } exit; break; case "addproductfield": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Products)) { $this->addProductField(); } exit; break; case 'viewaffectedvariations': if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Products)) { $this->viewAffectedVariations(); } exit; break; } }
public function HandleToDo() { /** * Convert the input character set from the hard coded UTF-8 to their * selected character set */ convertRequestInput(); $what = isc_strtolower(@$_REQUEST['w']); switch ($what) { case "getcheckoutfieldgrid": $this->getCheckoutFieldGrid(); break; case 'resortcheckoutfieldgrid': $this->resortCheckoutFieldGrid(); break; case 'getwidgetsetuppopup': $this->getWidgetSetupPopup(); break; case 'addwidgetsetuppopup': $this->addWidgetSetupPopup(); break; case 'deletewidget': $this->deleteWidget(); break; case 'deletemultiwidget': $this->deleteMultiWidget(); break; case 'savewidgetsetup': $this->saveWidgetSetup(); break; } }
/** * Handle the incoming action. * * @param string The action to perform. */ public function HandleToDo($Do) { $GLOBALS['ISC_CLASS_TEMPLATE']->ParseLangFile(APP_ROOT . "/../language/" . GetConfig('Language') . "/converter_language.ini"); $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('ExportStoreWizard') => "index.php?ToDo=Exporter"); if (!$GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Store_Importer) || GetConfig('DisableStoreImporters')) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } // Set the database to log all errors & queries if we're in debug mode if ($this->_Debug == true) { $GLOBALS['ISC_CLASS_DB']->QueryLog = dirname(__FILE__) . "/logs/export-sts.queries.txt"; $GLOBALS['ISC_CLASS_DB']->TimeLog = dirname(__FILE__) . "/logs/export-sts.query_time.txt"; $GLOBALS['ISC_CLASS_DB']->ErrorLog = dirname(__FILE__) . "/logs/export-sts.db_errors.txt"; } switch (isc_strtolower($Do)) { case "cancelexporter": $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->CancelExporter(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; case "showexporterframe": $this->ShowExporterFrame(); break; case "runexporter": $this->RunModule(); break; default: $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->InitializeExporter(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } }
public function HandleToDo($Do) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('froogle'); switch (isc_strtolower($Do)) { case "cancelfroogleexport": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Export_Froogle)) { $this->CancelFroogleExport(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "downloadfroogleexport": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Export_Froogle)) { $this->DownloadFroogleExport(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "exportfroogleintro": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Export_Froogle)) { $this->ExportFroogleIntro(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "exportfroogle": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Export_Froogle)) { $this->ExportFroogle(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } } }
public function HandleToDo() { /** * Convert the input character set from the hard coded UTF-8 to their * selected character set */ convertRequestInput(); $what = isc_strtolower(@$_REQUEST['w']); switch ($what) { case "getformfieldgrid": $this->getFormFieldGrid(); break; case 'resortformfieldgrid': $this->resortFormFieldGrid(); break; case 'getfieldsetuppopup': $this->getFieldSetupPopup(); break; case 'addfieldsetuppopup': $this->addFieldSetupPopup(); break; case 'copyfieldsetuppopup': $this->copyFieldSetupPopup(); break; case 'deletefield': $this->deleteField(); break; case 'deletemultifield': $this->deleteMultiField(); break; case 'savefieldsetup': $this->saveFieldSetup(); break; } }
/** * Handle the action for this section. * * @param string The name of the action to do. */ public function HandleToDo($Do) { if (isset($_REQUEST['currentTab'])) { $GLOBALS['CurrentTab'] = (int)$_REQUEST['currentTab']; } else { $GLOBALS['CurrentTab'] = 0; } $GLOBALS['BreadcrumEntries'] = array ( GetLang('Home') => "index.php", GetLang('Settings') => "index.php?ToDo=viewSettings", GetLang('LiveChatSettings') => "index.php?ToDo=viewLiveChatSettings" ); if (!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Settings)) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); return; } switch(isc_strtolower($Do)) { case "saveupdatedlivechatsettings": $this->SaveUpdatedLiveChatSettings(); break; case "livechatsettingscallback": $this->LiveChatSettingsCallback(); case "viewlivechatsettings": $GLOBALS['BreadcrumEntries'][GetLang('LiveChatSettings')] = "index.php?ToDo=viewLiveChatSettings"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->ManageLiveChatSettings(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; } }
public function HandleToDo($Do) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('optimizer'); $todo = isc_strtolower($Do); switch($todo) { default: if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Website_Optimizer)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('GoogleWebsiteOptimizer') => "index.php?ToDo=manageOptimizer"); if(!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); } $this->manageOptimizer(); if(!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; } }
/** * Initialises this method for exporting * * @param ISC_ADMIN_EXPORTOPTIONS The options to export with */ public function Init(ISC_ADMIN_EXPORTOPTIONS $options) { $filetype = $options->getFileType(); // initialise the file type $filetype->Init($this, $options->getTemplateId(), $options->getWhere(), $options->getHaving()); // set the type name $details = $filetype->GetTypeDetails(); $name = $details['name']; if (substr($name, -1, 1) == "s") { $name = substr($name, 0, -1); } $this->type_name = $name; $this->filetype = $filetype; // load settings for this method $settings = $this->GetSettings($options->getTemplateId()); foreach ($settings as $var => $setting) { $this->settings[$var] = $setting['value']; } $this->className = 'exporttemplate'; $this->exportName = $details['title']; $GLOBALS['ExportName'] = $details['title']; $GLOBALS['ExportGenerate'] = GetLang('AjaxExportLink', array('title' => isc_strtolower($details['title']), 'type' => $this->method_name)); $GLOBALS['ExportIntro'] = GetLang('AjaxExportIntro'); }
public function _GetChangesReportList(&$Query, $Start, $SortField, $SortOrder, &$NumResults) { // Return an array containing details about changes.report. // Takes into account search too. // PostgreSQL is case sensitive for likes, so all matches are done in lower case $Query = trim(isc_strtolower($Query)); if (isset($_GET['days']) && $_GET['days'] != '') { $days = (int) $_GET['days']; } else { $days = 15; } $query = "\n\t\t\t\tSELECT *, \n (SELECT COUNT(productid) \n FROM [|PREFIX|]products p \n WHERE p.prodbrandid=b.brandid) AS totalproducts,\n (SELECT COUNT(productid) \n FROM [|PREFIX|]products p \n WHERE p.prodbrandid=b.brandid AND proddateadded >= UNIX_TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL {$days} DAY))) AS newproducts,\n (SELECT COUNT(DISTINCT p.productid) \n FROM [|PREFIX|]changes_report cr \n INNER JOIN [|PREFIX|]products p ON cr.changeprodid = p.productid \n WHERE p.prodbrandid=b.brandid AND cr.changetype='content' AND changedtime > DATE_SUB(NOW(), INTERVAL {$days} DAY)) AS contentcount,\n (SELECT COUNT(DISTINCT p.productid) \n FROM [|PREFIX|]changes_report cr \n INNER JOIN [|PREFIX|]products p ON cr.changeprodid = p.productid \n WHERE p.prodbrandid=b.brandid AND cr.changetype='application' AND changedtime > DATE_SUB(NOW(), INTERVAL {$days} DAY)) AS applicationcount,\n (SELECT COUNT(DISTINCT p.productid) \n FROM [|PREFIX|]changes_report cr \n INNER JOIN [|PREFIX|]products p ON cr.changeprodid = p.productid \n WHERE p.prodbrandid=b.brandid AND cr.changetype='price' AND changedtime > DATE_SUB(NOW(), INTERVAL {$days} DAY)) AS pricecount \n\t\t\t\tFROM [|PREFIX|]brands b\n \n\t\t\t"; //proddateadded $countQuery = "SELECT COUNT(*) FROM [|PREFIX|]brands b"; $queryWhere = ' WHERE 1=1 '; if ($Query != "") { $queryWhere .= " AND LOWER(b.brandname) LIKE '%" . $GLOBALS['ISC_CLASS_DB']->Quote($Query) . "%'"; } $query .= $queryWhere; $countQuery .= $queryWhere; $result = $GLOBALS['ISC_CLASS_DB']->Query($countQuery); $NumResults = $GLOBALS['ISC_CLASS_DB']->FetchOne($result); if ($NumResults > 0) { $query .= " ORDER BY " . $SortField . " " . $SortOrder; // Add the limit $query .= $GLOBALS["ISC_CLASS_DB"]->AddLimit($Start, ISC_REPORTS_PER_PAGE); $result = $GLOBALS["ISC_CLASS_DB"]->Query($query); return $result; } else { return false; } }
protected function xml() { $group =& $this->data->nodeData; if (!$group) { throw new Exception('Cannot load customer group with nodeId: ' . $this->data->nodeId); } if (isc_strtolower($this->data->service) == 'pricelevelmod') { $reference = $this->quickbooks->getAccountingReference($this->data->nodeId, 'customergroup'); if ($reference) { $this->xmlNode->writeElement('ListID', trim($reference['ListID'])); $this->xmlNode->writeElement('EditSequence', trim($reference['EditSequence'])); } } $this->writeElementCData('Name', $group['groupname']); if (isset($product['isactive']) && $product['isactive'] !== '') { $this->xmlNode->writeElement('IsActive', (int) $product['isactive']); } /** * Must have this regardless if we have a percentage rate or not */ if (!isset($group['groupname']) || $group['groupname'] == '') { $group['groupname'] = 0; } $this->xmlNode->writeElement('PriceLevelFixedPercentage', (double) $group['discount']); return $this->buildOutput(); }
/** * ISC_ADMIN_DESIGNMODE::HandleToDo() * * @return */ public function HandleToDo() { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('layout'); if (isset($_REQUEST['ToDo'])) { $do = $_REQUEST['ToDo']; } else { $do = ''; } // Include the Admin authorisation class $GLOBALS['ISC_CLASS_ADMIN_AUTH'] = GetClass('ISC_ADMIN_AUTH'); if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->IsLoggedIn() && $GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Design_Mode)) { switch (isc_strtolower($do)) { case "saveupdatedfile": $this->SaveFile(); break; case "editfile": $this->EditFile(); break; case "revertfile": $this->RevertFile(); break; default: $this->UpdateLayoutPanels(); } } else { $GLOBALS["ISC_CLASS_ADMIN_ENGINE"]->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } }
public function HandleToDo() { /** * Convert the input character set from the hard coded UTF-8 to their * selected character set */ convertRequestInput(); GetLib('class.json'); $what = isc_strtolower(@$_REQUEST['w']); switch ($what) { case "loadlinker": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->IsLoggedIn()) { $this->loadLinker(); } exit; break; case "search": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->IsLoggedIn()) { $this->search(); } exit; break; } }
public function HandleToDo() { if (!$GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Website_Optimizer)) { return false; } $todo = isc_strtolower(@$_REQUEST['w']); switch ($todo) { case "showconfigform": $this->showConfigForm(); break; case "saveconfigform": $this->saveConfigForm(); break; case "installautoscripts": $this->installAutoScripts(); break; case "resetmodule": $this->resetMoudle(); break; case "downloadvalidationfiles": $this->downloadValidationFiles(); break; case "getconversionpageurl": $this->getConversionPageUrl(); break; } }
/** * Handle the incoming action. * * @param string The name of the action we wish to perform. */ public function HandleToDo($do) { if (!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Settings)) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); return; } $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('Settings') => "index.php?ToDo=viewSettings"); switch (isc_strtolower($do)) { case "settingsedittaxstatus": $GLOBALS['BreadcrumEntries'][GetLang('TaxSettings')] = "index.php?ToDo=viewTaxSettings"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->UpdateTaxStatus(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; case "settingssavetaxsettings": $GLOBALS['BreadcrumEntries'][GetLang('TaxSettings')] = "index.php?ToDo=viewTaxSettings"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->SaveTaxSettings(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; case "settingsdeletetaxrates": $GLOBALS['BreadcrumEntries'][GetLang('TaxSettings')] = "index.php?ToDo=viewTaxSettings"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->DeleteTaxRates(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; case "settingsaddtaxrate": $GLOBALS['BreadcrumEntries'][GetLang('TaxSettings')] = "index.php?ToDo=viewTaxSettings"; $GLOBALS['BreadcrumEntries'][GetLang('AddTaxRate')] = "index.php?ToDo=settingsAddTaxRate"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->AddTaxRate(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; case "settingssavenewtaxrate": $GLOBALS['BreadcrumEntries'][GetLang('TaxSettings')] = "index.php?ToDo=viewTaxSettings"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->SaveNewTaxRate(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; case "settingsedittaxrate": $GLOBALS['BreadcrumEntries'][GetLang('TaxSettings')] = "index.php?ToDo=viewTaxSettings"; $GLOBALS['BreadcrumEntries'][GetLang('EditTaxRate')] = "index.php?ToDo=settingsEditTaxRate"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->EditTaxRate(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; case "settingssaveupdatedtaxrate": $GLOBALS['BreadcrumEntries'][GetLang('TaxSettings')] = "index.php?ToDo=viewTaxSettings"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->SaveUpdatedTaxRate(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; default: $GLOBALS['BreadcrumEntries'][GetLang('TaxSettings')] = "index.php?ToDo=viewTaxSettings"; $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->ManageTaxSettings(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; } }
public function SaveSearch($customName, $searchVars) { $search_params = ''; // Does a view already exist with this name? $query = sprintf("select count(searchname) as num from [|PREFIX|]custom_searches where lower(searchname)='%s'", $GLOBALS['ISC_CLASS_DB']->Quote(isc_strtolower($customName))); $result = $GLOBALS["ISC_CLASS_DB"]->Query($query); $row = $GLOBALS["ISC_CLASS_DB"]->Fetch($result); if ($row['num'] == 0) { foreach ($searchVars as $k => $v) { if ($k == "customName" || $k == "ToDo" || $k == "SubmitButton1" || !is_array($v) && trim($v) == '') { continue; } if (is_array($v)) { foreach ($v as $v2) { $search_params .= sprintf("%s[]=%s&", $k, urlencode($v2)); } } else { $search_params .= sprintf("%s=%s&", $k, urlencode($v)); } } $search_params = $GLOBALS['ISC_CLASS_DB']->Quote(trim($search_params, "&")); $customSearch = array("searchtype" => $this->_searchType, "searchname" => $customName, "searchvars" => $search_params); return $GLOBALS['ISC_CLASS_DB']->InsertQuery("custom_searches", $customSearch); } else { return 0; } }
public function HandleToDo($Do) { if (isset($_REQUEST['currentTab'])) { $GLOBALS['CurrentTab'] = (int) $_REQUEST['currentTab']; } else { $GLOBALS['CurrentTab'] = 0; } $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('settings.imageuploader'); if (!$GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Settings_ImageUploader)) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); return; } $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('ImageUploaderSettings') => "index.php?ToDo=viewImageUploaderSettings"); switch (isc_strtolower($Do)) { case "saveimageuploadersettings": $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->SaveImageUploaderSettings(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); break; default: $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $this->ManageImageUploaderSettings(); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } }
public function HandleToDo() { $what = isc_strtolower(@$_REQUEST['w']); switch ($what) { case "getmorediscounts": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Manage_Discounts)) { $this->getMoreDiscounts(); } exit; break; case "updatediscountorder": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Discounts)) { $this->UpdateDiscountOrder(); } exit; break; case "getrulemoduleproperties": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Manage_Discounts)) { $this->getRuleModuleProperties(); } exit; break; } }
public function execRequest() { /** * Make sure that we have a valid customer */ $customerXML = $this->validateCustomer(); if (is_string($customerXML)) { return $customerXML; } /** * Plus all our products as well */ $productXML = $this->validateProducts(); if (is_string($productXML)) { return $productXML; } if (is_array($this->spool["children"]) && !empty($this->spool["children"])) { $lastKid = end($this->spool["children"]); switch (isc_strtolower($lastKid["service"])) { case "query": /** * If we have an error here then that would mean that adding created a duplicate error * but querying for it return nothing. Bad news */ if ($lastKid["errNo"] > 0) { throw new QBException("Caught a QBJD error when adding an order record", $lastKid); } /** * Our query kid was successfully so we need to create the reference data from the * response. If we can't create the reference then we need to error out */ if (!$this->setReferenceData($lastKid["response"])) { throw new QBException("Cannot create reference data from order query response", $queryResponse); } /** * Reset the reference data and try again */ $this->setReferenceData($lastKid["response"]); $this->spool = $this->accounting->getSpool($this->spool["id"]); break; case "add": /** * Adding would have handled both adding a new order OR editing an existing order with a * bad reference, so either way just escape it here */ return $this->execNextService(); break; } } return parent::execRequest(); }
public function HandleToDo($Do) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('subscribers'); switch (isc_strtolower($Do)) { case "cancelsubscribersexport": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Newsletter_Subscribers)) { $this->CancelSubscribersExport(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } case "downloadsubscribersexport": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Export_Froogle)) { $this->DownloadSubscribersExport(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "exportsubscribersintro": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Export_Froogle)) { $this->ExportSubscribersIntro(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "exportsubscribers": if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->HasPermission(AUTH_Newsletter_Subscribers)) { $this->ExportSubscribers(); } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } } }
public function execRequest() { if (is_array($this->spool["children"]) && !empty($this->spool["children"])) { $lastKid = end($this->spool["children"]); switch (isc_strtolower($lastKid["service"])) { case "query": /** * If we have an error here then that would mean that adding created a duplicate error * but querying for it return nothing. Bad news */ if ($lastKid["errNo"] > 0) { throw new QBException("Caught a QBJD error when adding a prerequisite record", $lastKid); } /** * Our query kid was successfully so we need to create the reference data from the * response. If we can't create the reference then we need to error out */ $queryResponse = $lastKid["response"]; $queryResponse += $lastKid["nodeData"]; if (!$this->setReferenceData($queryResponse, '*')) { throw new QBException("Cannot create reference data from prerequisite query response", $queryResponse); } return $this->execNextService(); break; } } return parent::execRequest(); }
/** * Output the service XML * * Method will construct the XML string using the information stored in $this->xmlNode and return the XML string * * @access protected * @param bool $isQuery TRUE if this service is a query, FALSE if not (add, mod, etc). Default is FALSE * @return string The constructed XML string */ protected function buildOutput($isQuery = false) { /** * Add the replacement for the client's qbXML version */ $clientVersion = $this->quickbooks->getAccountingSessionKey('QBXML_VERSION'); $clientCountry = $this->quickbooks->getAccountingSessionKey('CLIENT_COUNTRY'); /** * If this version 2-3 and where are UK/CA then we need to prepend the country code in the version */ if ((isc_strtolower($clientCountry) == "uk" || isc_strtolower($clientCountry) == "ca") && version_compare($clientVersion, "3.0") !== 1) { $version = isc_strtoupper($clientCountry) . (string) $clientVersion; } else { $version = (string) $clientVersion; } $GLOBALS['VersionNo'] = $version; $GLOBALS['EntityType'] = $this->data->service; $GLOBALS['EntityXML'] = $this->xmlNode->outputMemory(true); $xml = $this->quickbooks->ParseTemplate('module.quickbooks.qbxml', true); /** * If this is a query then remove the <$this->data->service> tags. Why can't everything be the same */ if ($isQuery) { $xml = str_replace('<' . $this->data->service . '>', '', $xml); $xml = str_replace('</' . $this->data->service . '>', '', $xml); } return $xml; }
public function HandleToDo() { /** * Convert the input character set from the hard coded UTF-8 to their * selected character set */ convertRequestInput(); $what = isc_strtolower(@$_REQUEST['w']); switch ($what) { case "getallbrands": $this->GetAllBrands(); break; case "getseries": $this->GetSeries(); break; //zcs=> //zcs=> case "getseriesoption": $this->GetSeriesOption(); break; case "getsubcategoryoption": $this->GetSubCategoryOption(); break; //<=zcs //<=zcs case "getbrandseries": $this->GetBrandSeries(); break; default: break; } }
/** * Handle the incoming page request. */ public function HandlePage() { $action = ""; if (isset($_REQUEST['action'])) { $action = isc_strtolower($_REQUEST['action']); } if ($action == 'gateway_ping') { $this->GatewayPing(); exit; } switch ($action) { case "set_external_checkout": $this->SetExternalCheckout(); break; case "process_payment": $this->ProcessOrderPayment(); break; case "pay_for_order": $this->PayForOrder(); break; case "save_biller": $this->SaveBillingAddress(); break; case "choose_billing_address": $this->ChooseBillingAddress(); break; case "confirm_order": $this->ConfirmOrder(); break; case "save_shipper": $this->SaveShippingProvider(); break; case 'save_multiple_shipping_addresses': $this->SaveMultipleShippingAddresses(); break; case "choose_shipping_address": $this->ChooseShippingAddress(); break; case "choose_shipper": $this->ChooseShippingProvider(); break; case "removegiftcertificate": $this->RemoveGiftCertificate(); break; case 'multiple': $this->BeginMultipleAddressCheckout(); break; case "checkout": $this->Checkout(); break; default: // If we're performing an express checkout, show that if (GetConfig('CheckoutType') == 'single' && $this->SinglePageCheckoutSupported()) { $this->ExpressCheckout(); } else { $this->Checkout(); } } }
protected function parsecategoryaccess($value) { if (isc_strtolower($value) == "none" || isc_strtolower($value) == "all" || isc_strtolower($value) == "specific") { return isc_strtolower($value); } return "none"; }
/** * Execute the service * * Method will chekc to see if additional information needs to be synced with QuickBooks. If so then create a new spool for this service. If after the new * sub-spool is finished or if there was no need for it then execute the spool file * * @access protected * @return bool true if the spool file was executed successfully, FALSE otherwise */ protected function run() { /** * Ok, now check to see whats in the children spool */ if (!empty($this->spoolData['accountingspoolchildren'])) { /** * Get the last child service name */ $lastChild = $this->spoolData['accountingspoolchildren'][count($this->spoolData['accountingspoolchildren']) - 1]; $lastService = $lastChild['accountingspoolrealservice']; $lastReturn = $lastChild['accountingspoolreturn']; switch (isc_strtolower($lastService)) { case 'accountquery': /** * If the account already exists and we got the proper record with the ListID, create the reference association, create a 'accountmod' * service spool job and retire this service spool job */ if (!isset($lastReturn->ListID) || (string) $lastReturn->ListID == '') { throw new Exception('Duplicate entry yet the child service AccountQuery did not return a record for AccountAdd spool ' . $this->spoolId); } $reference = array('ListID' => (string) $lastReturn->ListID, 'EditSequence' => (string) $lastReturn->EditSequence, 'Name' => $this->spoolData['accountingspoolnode']['Name'], 'AccountType' => $this->spoolData['accountingspoolnode']['AccountType']); if (!$this->setAccountingReference($this->spoolData['accountingspoolnode'], 'account', $reference)) { throw new Exception('Cannot set the reference association for AccountAdd spool ' . $this->spoolId); } /** * Now create the accountmod child service using this spools xml data. Only call this if we have version 6.0 or above! */ if ($this->quickbooks->compareClientVersion('6.0')) { $editSpoolId = $this->createChildSpool('account', 'edit', $reference); if (isId($editSpoolId)) { if ($this->execSibling($serviceOutput, 'accountmod', 'run', array('spoolId' => $editSpoolId))) { return $serviceOutput; } else { throw new Exception('Failed in running the child service AccountMod for the parent AccountAdd spool ' . $this->spoolId); } } /** * Else we just escape it */ } else { $this->quickbooks->setSpoolAsExecuted($this->spoolId, true); $this->escapeService($this->spoolId); } break; case 'accountmod': /** * Ok, the accountmod service has created this record so there is no need to run this accountadd job. Force this spool as executed */ if (isset($lastReturn->ListID) && (string) $lastReturn->ListID !== '') { $this->quickbooks->setSpoolAsExecuted($this->spoolId, true); } $this->escapeService($this->spoolId); break; } } return $this->manageServiceOutput(); }
/** * Do a product search based on the response data * * Methood will search for the product record based on the response data * * @access public * @param array $response The response data from QB * @return array The product record on success, FALSE if it cannot be found */ public function searchNodeByDB($response) { if (!is_array($response)) { return false; } /** * Firstly check to see if this is a QB product short name as it contains the product Id in it */ $prodName = ""; if (array_key_exists("Name", $response)) { $prodName = $this->accounting->revertParentSeparator($response["Name"]); } else if (array_key_exists("FullName", $response)) { $prodName = $this->accounting->fullName2RealName($response["FullName"]); } if (trim($prodName) !== '') { $productId = $this->accounting->qbProductShortName2ProductNameId($prodName, true); $product = null; if (isId($productId)) { $product = $this->entityAPI->get($productId); } if (is_array($product)) { return $product; } } /** * Else do the usual search */ $fields = array(); if (array_key_exists("ManufacturerPartNumber", $response) && trim($response["ManufacturerPartNumber"]) !== '') { $fields["prodcode"] = array( "func" => "LOWER", "value" => isc_strtolower($response["ManufacturerPartNumber"]) ); } else if (trim($prodName) !== '') { $fields["prodname"] = array( "func" => "LOWER", "value" => isc_strtolower($prodName) ); } if (empty($fields)) { return false; } $nodeId = $this->entityAPI->search($fields); if (!isId($nodeId)) { return false; } return $this->entityAPI->get($nodeId); }
public function HandleToDo($Do) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->LoadLangFile('common'); switch (isc_strtolower($Do)) { case "downloadfileimportlog": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Import_Products)) { $filename = $_GET['f']; $user = $_GET['u']; $vendor = $_GET['v']; $fname = $filename . "_" . $vendor . "_" . $user . ".csv"; $file_path = "rejected_data/" . $fname; $nename = date("F_j_Y_g_i_a", $filename); // file size in bytes $fsize = filesize($file_path); $fileContents = file_get_contents($file_path); header("Content-length:" . $fsize); header("Content-type: text/csv"); header("Content-Disposition: attachment; filename=" . $nename . ".csv"); echo $fileContents; die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; case "deleteimportlogfile": if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Import_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('ImportLog') => "index.php?ToDo=viewBrands"); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); $brandids = $GLOBALS['ISC_CLASS_DB']->Quote($_POST['brands']); foreach ($brandids as $value) { $file = "rejected_data/" . $value; if (file_exists($file)) { @unlink($file); clearstatcache(); } } $this->ManageBrands(" File Deleted Successfully", MSG_SUCCESS); $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); die; } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } break; default: if ($GLOBALS["ISC_CLASS_ADMIN_AUTH"]->HasPermission(AUTH_Import_Products)) { $GLOBALS['BreadcrumEntries'] = array(GetLang('Home') => "index.php", GetLang('ImportLog') => "index.php?ToDo=viewBrands"); if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintHeader(); } $this->ManageBrands(); if (!isset($_REQUEST['ajax'])) { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->PrintFooter(); } } else { $GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoHomePage(GetLang('Unauthorized'), MSG_ERROR); } } }
public function HandlePage() { $action = ""; if ($GLOBALS['EnableSEOUrls'] == 1 and count($GLOBALS['PathInfo']) > 0) { if (isset($GLOBALS['PathInfo'][1])) { $_REQUEST['action'] = $GLOBALS['PathInfo'][1]; } else { $_REQUEST['action'] = $GLOBALS['PathInfo'][0]; } } if (isset($_REQUEST['action'])) { $action = isc_strtolower($_REQUEST['action']); } // Don't allow any access to this file if gift certificates aren't enabled if (GetConfig('EnableGiftCertificates') == 0) { ob_end_clean(); header("Location: " . $GLOBALS['ShopPath']); die; } if (!gzte11(ISC_LARGEPRINT)) { ob_end_clean(); header("Location: " . $GLOBALS['ShopPath']); die; } switch ($action) { case "saved": $this->SaveDefectForm(); break; case "reports": if (CustomerIsSignedIn()) { $this->ListReports(); break; } else { // Naughty naughty, you need to sign in to be here $this_page = urlencode(sprintf("account.php?action=%s", $action)); ob_end_clean(); header(sprintf("Location: %s/login.php?from=%s", $GLOBALS['ShopPath'], $this_page)); die; } case "editdefect": if (CustomerIsSignedIn()) { $this->EditDefectForm(); break; } else { // Naughty naughty, you need to sign in to be here $this_page = urlencode(sprintf("account.php?action=%s", $action)); ob_end_clean(); header(sprintf("Location: %s/login.php?from=%s", $GLOBALS['ShopPath'], $this_page)); die; } case "editsave": $this->SaveEditedDefect(); case "deletedefect": $this->DeleteDefect(); default: $this->DisplayReport(); } }
public function HandleToDo($Do) { switch (isc_strtolower($Do)) { case "requested": $this->Requested(); break; default: $this->NoReview(); break; } }