From 3739c84e0980af3ed64007bcec16e3262bf39c32 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Wed, 30 Apr 2014 03:58:13 +0400 Subject: [PATCH] cleanup master before first release --- composer.json | 35 ----- intarocrm/classes/.gitkeep | 0 intarocrm/config.xml | 13 -- intarocrm/intarocrm.php | 251 ---------------------------------- intarocrm/logo.gif | Bin 1124 -> 0 bytes intarocrm/logo.png | Bin 1963 -> 0 bytes intarocrm/translations/en.php | 4 - intarocrm/translations/ru.php | 17 --- 8 files changed, 320 deletions(-) delete mode 100644 composer.json delete mode 100644 intarocrm/classes/.gitkeep delete mode 100644 intarocrm/config.xml delete mode 100644 intarocrm/intarocrm.php delete mode 100644 intarocrm/logo.gif delete mode 100644 intarocrm/logo.png delete mode 100644 intarocrm/translations/en.php delete mode 100644 intarocrm/translations/ru.php diff --git a/composer.json b/composer.json deleted file mode 100644 index 5b855e4..0000000 --- a/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "intarocrm/prestashop-module", - "description": "Prestashop integration for IntaroCRM", - "type": "library", - "keywords": ["api", "Intaro CRM", "rest"], - "homepage": "http://www.intarocrm.ru/", - "config": { - "vendor-dir": "intarocrm/classes" - }, - "authors": [ - { - "name": "Alex Lushpai", - "email": "lushpai@intaro.ru", - "role": "Developer" - } - ], - "support": { - "email": "support@intarocrm.ru" - }, - "require": { - "php": ">=5.3", - "intarocrm/rest-api-client": "1.2.*" - }, - "autoload": { - "psr-0": { - "": "src/" - } - }, - "repositories": [ - { - "type": "git", - "url": "https://github.com/intarocrm/rest-api-client" - } - ] -} diff --git a/intarocrm/classes/.gitkeep b/intarocrm/classes/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/intarocrm/config.xml b/intarocrm/config.xml deleted file mode 100644 index af157cd..0000000 --- a/intarocrm/config.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - intarocrm - - - - - - Are you sure you want to uninstall? - 1 - 0 - - diff --git a/intarocrm/intarocrm.php b/intarocrm/intarocrm.php deleted file mode 100644 index f597145..0000000 --- a/intarocrm/intarocrm.php +++ /dev/null @@ -1,251 +0,0 @@ -name = 'intarocrm'; - $this->tab = 'market_place'; - $this->version = '0.1'; - $this->author = 'Intaro Ltd.'; - - $this->displayName = $this->l('IntaroCRM'); - $this->description = $this->l('Integration module for IntaroCRM'); - $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); - - parent::__construct(); - } - - function install() - { - return (parent::install()); - } - - function uninstall() - { - return parent::uninstall() && - Configuration::deleteByName('INTAROCRM_ADDRESS') && - Configuration::deleteByName('INTAROCRM_API_TOKEN') - ; - } - - public function getContent() - { - $output = null; - - $address = Configuration::get('INTAROCRM_ADDRESS'); - $token = Configuration::get('INTAROCRM_API_TOKEN'); - - if (!$address || $address == '') { - $output .= $this->displayError( $this->l('Invalid crm address') ); - } elseif (!$token || $token == '') { - $output .= $this->displayError( $this->l('Invalid crm api token') ); - } - - if (Tools::isSubmit('submit'.$this->name)) - { - $address = strval(Tools::getValue('INTAROCRM_ADDRESS')); - $token = strval(Tools::getValue('INTAROCRM_API_TOKEN')); - - if (!$address || empty($address) || !Validate::isGenericName($address)) { - $output .= $this->displayError( $this->l('Invalid crm address') ); - } elseif (!$token || empty($token) || !Validate::isGenericName($token)) { - $output .= $this->displayError( $this->l('Invalid crm api token') ); - } else { - Configuration::updateValue('INTAROCRM_ADDRESS', $address); - Configuration::updateValue('INTAROCRM_API_TOKEN', $token); - $output .= $this->displayConfirmation($this->l('Settings updated')); - } - } - - return $output.$this->displayForm(); - } - - public function displayForm() - { - $this->displayConfirmation($this->l('Settings updated')); - - $default_lang = (int)Configuration::get('PS_LANG_DEFAULT'); - - $intaroCrm = new \IntaroCrm\RestApi( - Configuration::get('INTAROCRM_ADDRESS'), - Configuration::get('INTAROCRM_API_TOKEN') - ); - - /* - * Network connection form - */ - $fields_form[0]['form'] = array( - 'legend' => array( - 'title' => $this->l('Network connection'), - ), - 'input' => array( - array( - 'type' => 'text', - 'label' => $this->l('CRM address'), - 'name' => 'INTAROCRM_ADDRESS', - 'size' => 20, - 'required' => true - ), - array( - 'type' => 'text', - 'label' => $this->l('CRM token'), - 'name' => 'INTAROCRM_API_TOKEN', - 'size' => 20, - 'required' => true - ) - ), - 'submit' => array( - 'title' => $this->l('Save'), - 'class' => 'button' - ) - ); - - /* - * Arrays for dictionaries - */ - $delivery_dict = array(); - $crmDeliveryTypes = array(); - $status_dict = array(); - $crmStatusTypes = array(); - - /* - * Delivery dictionary form - */ - try { - $deliveryTypes = $intaroCrm->deliveryTypesList(); - } - catch (\IntaroCrm\Exception\CurlException $e) { - error_log('deliveryTypesList: connection error'); - } - catch (\IntaroCrm\Exception\ApiException $e) { - error_log('deliveryTypesList: ' . $e->getMessage()); - } - - if (!empty($deliveryTypes)) { - $crmDeliveryTypes[] = array(); - foreach ($deliveryTypes as $dType) { - $crmDeliveryTypes[] = array( - 'id_option' => $dType['code'], - 'name' => $dType['name'] - ); - } - } - - $carriers = Carrier::getCarriers( - $default_lang, true, false, false, - null, PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE - ); - - if (!empty($carriers)) { - foreach ($carriers as $carrier) { - $delivery_dict[] = array( - 'type' => 'select', - 'label' => $carrier['name'], - 'name' => 'carrier_' . $carrier['id_carrier'], - 'required' => false, - 'options' => array( - 'query' => $crmDeliveryTypes, - 'id' => 'id_option', - 'name' => 'name' - ) - ); - } - } - - $fields_form[1]['form'] = array( - 'legend' => array( - 'title' => $this->l('Delivery'), - ), - 'input' => $delivery_dict, - ); - - /* - * Status dictionary form - */ - try { - $statusTypes = $intaroCrm->orderStatusesList(); - } - catch (\IntaroCrm\Exception\CurlException $e) { - error_log('statusTypesList: connection error'); - } - catch (\IntaroCrm\Exception\ApiException $e) { - error_log('statusTypesList: ' . $e->getMessage()); - } - - if (!empty($statusTypes)) { - $crmStatusTypes[] = array(); - foreach ($statusTypes as $sType) { - $crmStatusTypes[] = array( - 'id_option' => $sType['code'], - 'name' => $sType['name'] - ); - } - } - - $states = OrderState::getOrderStates($default_lang, true); - - if (!empty($states)) { - foreach ($states as $state) { - if ($state['name'] != ' ') { - $status_dict[] = array( - 'type' => 'select', - 'label' => $state['name'], - 'name' => 'state_' . $state['id_order_state'], - 'required' => false, - 'options' => array( - 'query' => $crmStatusTypes, - 'id' => 'id_option', - 'name' => 'name' - ) - ); - } - } - } - - $fields_form[2]['form'] = array( - 'legend' => array( - 'title' => $this->l('Order statuses'), - ), - 'input' => $status_dict, - ); - - $helper = new HelperForm(); - - $helper->module = $this; - $helper->name_controller = $this->name; - $helper->token = Tools::getAdminTokenLite('AdminModules'); - $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; - - $helper->default_form_language = $default_lang; - $helper->allow_employee_form_lang = $default_lang; - - $helper->title = $this->displayName; - $helper->show_toolbar = true; - $helper->toolbar_scroll = true; - $helper->submit_action = 'submit'.$this->name; - $helper->toolbar_btn = array( - 'save' => - array( - 'desc' => $this->l('Save'), - 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name. - '&token='.Tools::getAdminTokenLite('AdminModules'), - ), - 'back' => array( - 'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'), - 'desc' => $this->l('Back to list') - ) - ); - - $helper->fields_value['INTAROCRM_ADDRESS'] = Configuration::get('INTAROCRM_ADDRESS'); - $helper->fields_value['INTAROCRM_API_TOKEN'] = Configuration::get('INTAROCRM_API_TOKEN'); - - return $helper->generateForm($fields_form); - } -} diff --git a/intarocrm/logo.gif b/intarocrm/logo.gif deleted file mode 100644 index c9abff4af5b30e99274d8d056c86e98e156c5b7b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1124 zcmW-gTTGf~7{@WyxCJfWCoX1b)8gt!65n zlB8v6^13W-GgIl&Xm<5_FZ81qf_8K|w^qBEmFbenV8NLrUQsHRQd68F;c~KMLnia6 zRIvQ+%9TT-@vyLPKR@5A*Sq0o9oiLD05Z4UbkO5{FRWlqN5VMRxw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OdGQ$$RgyfA1dq z@4ibsf1dWuH<>wywz1Cw<#;l|9z7!N?(%Fj!f$TkFJ5GRc*x;&itO$(FH4GR*EqU& z4+ZM^oYC8F<0cdI?p@^meGWeTlvaf5+&S3YWxlb2e)Sb6@4ruV?HYBAG#`G5OeQcY zk$>EJ%X~Cq2vC-Uwnaj~6$Mfh_@W@FGKvui0UeKdsjiuAY*1gigs!eqj7E$fK4iMK zhPExt=hWjdqsfGJX9u0naa&u|RfUx$?$IOSfA_Gm=qjP8A;-tKlanscMDX6@og<`G zyvKP@QP-&V6i=UG`};Iig#c|`cXdO%-tSdu+7?&W5F^J=o-nT}Ocj4{fFCMhKf&}> zN_BbK5$PI@8D14lO-2CUH2CRsXuU;@cvYe*P8Btyjggp?RxzT0nxRGL0H|s=MD*E^ z^4zkTV5tOa)(0d5*q3rm)@!mZnxQdvYro&O{Zx>W3sUKYp^I4>B>Ji~C{7LO`H7I> zuTe4WwFgmp5Y`T%8oZfA{(o=59_qy)c z?SEEPpFxXDpZ8|1V%DnsL-LtQI9Vzq1m`YYMbxL^E15+H~KV5&JnaxzjnvdI)S)6)Pe9J2Ym0D7?SC=Ka+=ghievYl9g< zgu*!rktHxb0gXv{qe_ziG#QxF8MGDxrT717%zo#7bm79?!x(=a;Ug~+g9wEPJ}K+h zA_Gx4w=CIS>HPw%a~)vk25};)@UNp7e|cs+{`>y{Aiojwk<7&20000bbVXQnWMOn= zI%9HWVRU5xGB7bTEig1KGC5Q+H99afIx#paFf=+aFh3h~g#Z8mC3HntbYx+4Wjbwd xWNBu305UK!G%YYREiyS&F*Q0cGdeXgD=;)VFffduhV%dc002ovPDHLkV1hcyn&$uj diff --git a/intarocrm/translations/en.php b/intarocrm/translations/en.php deleted file mode 100644 index 601358d..0000000 --- a/intarocrm/translations/en.php +++ /dev/null @@ -1,4 +0,0 @@ -intarocrm_03c4d9465b9b3a7533d18cacc79c7fe4'] = 'IntaroCRM'; -$_MODULE['<{intarocrm}prestashop>intarocrm_5e695dc9fe273b7bc074e608113f4662'] = 'Модуль интеграции с IntaroCRM'; -$_MODULE['<{intarocrm}prestashop>intarocrm_876f23178c29dc2552c0b48bf23cd9bd'] = 'Вы уверены, что хотите удалить модуль?'; -$_MODULE['<{intarocrm}prestashop>intarocrm_5effd5157947e8ba4a08883f198b2e31'] = 'Неверный адрес CRM'; -$_MODULE['<{intarocrm}prestashop>intarocrm_576300f5b6faeb746bb6d034d98e7afd'] = 'Неверный API ключ'; -$_MODULE['<{intarocrm}prestashop>intarocrm_c888438d14855d7d96a2724ee9c306bd'] = 'Настройки обновлены'; -$_MODULE['<{intarocrm}prestashop>intarocrm_51af428aa0dcceb5230acb267ecb91c5'] = 'Настройка соединения'; -$_MODULE['<{intarocrm}prestashop>intarocrm_4cbd5dbeeef7392e50358b1bc00dd592'] = 'Адрес CRM'; -$_MODULE['<{intarocrm}prestashop>intarocrm_7f775042e08eddee6bbfd8fbe0add4a3'] = 'Ключ авторизации'; -$_MODULE['<{intarocrm}prestashop>intarocrm_c9cc8cce247e49bae79f15173ce97354'] = 'Сохранить'; -$_MODULE['<{intarocrm}prestashop>intarocrm_065ab3a28ca4f16f55f103adc7d0226f'] = 'Способы доставки'; -$_MODULE['<{intarocrm}prestashop>intarocrm_33af8066d3c83110d4bd897f687cedd2'] = 'Статусы заказов'; -$_MODULE['<{intarocrm}prestashop>intarocrm_630f6dc397fe74e52d5189e2c80f282b'] = 'Вернуться к списку';