· 8 years ago · Mar 27, 2018, 11:10 AM
1Searching 144 files for "AdvancedExport" (regex)
2
3/var/www/unisit_ecommerce/modules/advancedexport/advancedexport.php:
4 34 exit;
5 35
6 36: $obj = new AdvancedExport();
7 37 $obj->set_arr_needed( $rtoclass );
8 38: class AdvancedExport extends Module
9 39 {
10 40 public $hasAttr;
11 ..
12 272 public function __construct()
13 273 {
14 274: $this->name = "advancedexport";
15 275 $this->tab = "administration";
16 276 $this->bootstrap = true;
17 ...
18 290 $path .= '/../modules/'.$this->name;
19 291
20 292: include_once($path.'/classes/AdvancedExportClass.php');
21 293 }
22 294
23 ...
24 296 {
25 297 if(!$this->CreateTables()
26 298: || !Configuration::updateGlobalValue("AdvancedExport_CURRENT", 0)
27 299: || !Configuration::updateGlobalValue("AdvancedExport_TOTAL", 0)
28 300: || !Configuration::updateGlobalValue("ADVANCEDEXPORT_SECURE_KEY", Tools::strtoupper(Tools::passwdGen(16))))
29 301 return false;
30 302
31 ...
32 310 {
33 311 //for test create tmp table
34 312: $table_name = _DB_PREFIX_ . "advancedexport";
35 313
36 314 $query = "CREATE TABLE IF NOT EXISTS `".$table_name."` (
37 315: `id_advancedexport` int(10) unsigned NOT NULL auto_increment,
38 316 `type` varchar(200) NOT NULL,
39 317 `name` varchar(200) NOT NULL,
40 ...
41 338 `ftp_user_pass` varchar(255) NOT NULL,
42 339 `fields` text NOT NULL,
43 340: PRIMARY KEY (`id_advancedexport`)
44 341 ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8";
45 342
46 ...
47 355 {
48 356 if(!$this->RemoveTables()
49 357: || !Configuration::deleteByName("AdvancedExport_CURRENT")
50 358: || !Configuration::deleteByName("AdvancedExport_TOTAL")) //install tables
51 359 return false;
52 360
53 ...
54 368 {
55 369 //remove main table
56 370: if(!$this->DbExecute("DROP TABLE IF EXISTS `"._DB_PREFIX_."advancedexport`"))
57 371 return false;
58 372 return true;
59 ...
60 378 $this->_postProcess();
61 379
62 380: if ($this->getValue('add_model') || Tools::isSubmit('updateadvancedexport') || Tools::isSubmit('btnSubmit'))
63 381 {
64 382 $this->_html .= $this->displayAddModelForm($helper = new HelperForm());
65 ...
66 425 $this->redirect('saveModelConfirmation');
67 426 }
68 427: else if(Tools::isSubmit('deleteadvancedexport'))
69 428 {
70 429 if(!$this->deleteModel())
71 430 $this->redirect('deleteModelConfirmation');
72 431 }
73 432: elseif ($this->isSubmit('duplicateadvancedexport') && $this->getValue('id_advancedexport'))
74 433 {
75 434 $time_start = microtime(true); //debug
76 435
77 436: $this->getExportType($this->getValue('id_advancedexport'));
78 437
79 438 if($this->showTimeAndMemory) // debug
80 ...
81 509 }
82 510
83 511: $AdvancedExport = new AdvancedExportClass($this->getValue('id_advancedexport'));
84 512: $AdvancedExport->copyFromPost();
85 513: $AdvancedExport->fields = Tools::jsonEncode($to_serialize);
86 514: $AdvancedExport->save();
87 515
88 516 return true;
89 ...
90 529 public function deleteModel()
91 530 {
92 531: $AdvancedExport = new AdvancedExportClass($this->getValue('id_advancedexport'));
93 532: $AdvancedExport->delete();
94 533
95 534 return true;
96 ...
97 548 {
98 549 $type = null;
99 550: if($id = Tools::getValue("id_advancedexport"))
100 551 {
101 552: $aec = new AdvancedExportClass($id);
102 553 if(is_object($aec))
103 554 $type = $aec->type;
104 ...
105 561 $helper->module = $this;
106 562 $helper->show_toolbar = true;
107 563: $helper->table = 'advancedexport';
108 564 $helper->id = (int)$id;
109 565 $helper->default_form_language = (int)Configuration::get("PS_LANG_DEFAULT");
110 ...
111 580 public function getModelFieldsValues($type)
112 581 {
113 582: $fields = array('id_advancedexport', 'type', 'name', 'delimiter', 'separator', 'id_lang', 'charset', 'add_header', 'decimal_separator', 'decimal_round', 'strip_tags', 'file_type', 'only_new', 'save_type', 'shops', 'image_type', 'filename', 'email', 'ftp_hostname', 'ftp_user_pass', 'ftp_user_name', 'date_from', 'date_to', 'start_id', 'end_id');
114 583 $fields_specific = null;
115 584 $fields_value = null;
116 585
117 586: if($this->getValue('id_advancedexport'))
118 587 {
119 588: $ae = new AdvancedExportClass($this->getValue('id_advancedexport'));
120 589 $fields_specific = Tools::jsonDecode($ae->fields, true);
121 590 }
122 ...
123 635 array(
124 636 'type' => 'hidden',
125 637: 'name' => 'id_advancedexport'
126 638 ),
127 639 array(
128 ...
129 1014 }
130 1015
131 1016: public function getExportType($id_advancedexport)
132 1017 {
133 1018: Configuration::updateGlobalValue("AdvancedExport_CURRENT", 0);
134 1019
135 1020: $ae = new AdvancedExportClass($id_advancedexport);
136 1021 $this->createExportFile($ae);
137 1022 }
138 ....
139 1041 $elements = $this->$functionName($ae, $sorted_fields);
140 1042 //total number for progress bar
141 1043: Configuration::updateGlobalValue("AdvancedExport_TOTAL", DB::getInstance()->numRows());
142 1044
143 1045 $url = $this->writeToFile($ae, $sorted_fields, $elements);
144 ....
145 1119 }
146 1120
147 1121: Configuration::updateGlobalValue("AdvancedExport_CURRENT", (string)$i);
148 1122 //progress bar
149 1123 $this->getDataFromObject($element, $file, $sorted_fields, $ae);
150 ....
151 1147 case "getCurrentIndex":
152 1148 $response = array(
153 1149: 'total' => (int)Configuration::get("AdvancedExport_TOTAL"),
154 1150: 'current' => (int)Configuration::get("AdvancedExport_CURRENT")
155 1151 );
156 1152 echo Tools::jsonEncode($response);
157 ....
158 1163 $filename = $filename.".csv";
159 1164
160 1165: $url = _PS_ROOT_DIR_.'/modules/advancedexport/csv/'.$type;
161 1166 if (!is_dir($url)) {
162 1167 mkdir($url);
163 ....
164 1512 {
165 1513 $html = '<script type="text/javascript">
166 1514: var urlJson = "index.php?controller=AdminModules&configure=advancedexport&module_name=advancedexport&token='.Tools::getAdminTokenLite("AdminModules").'";
167 1515 </script>';
168 1516 $html .= '<div class="row">';
169 ....
170 1556 $this->_display = 'index';
171 1557 $helper->module = $this;
172 1558: $helper->identifier = 'id_advancedexport';
173 1559 $helper->actions = array('edit', 'duplicate', 'delete');
174 1560 $helper->show_toolbar = true;
175 ....
176 1564 $helper->toolbar_btn = $this->initToolbar($type);
177 1565 $helper->title = $type." models";
178 1566: $helper->table = 'advancedexport';
179 1567 $helper->token = Tools::getAdminTokenLite('AdminModules');
180 1568 $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
181 ....
182 1574 {
183 1575 return array(
184 1576: 'id_advancedexport' => array(
185 1577 'title' => $this->l('ID'),
186 1578 'width' => 20
187 ....
188 1698 public function getFiles($type)
189 1699 {
190 1700: $dirname = _PS_ROOT_DIR_.'/modules/advancedexport/csv/'.$type.'/';
191 1701 $files = glob($dirname.'*.{csv}', GLOB_BRACE);
192 1702
193 ....
194 2758 public function getLinks($type)
195 2759 {
196 2760: $links = $this->DbExecuteS("select * from " . _DB_PREFIX_ . "advancedexport where type = '$type'");
197 2761 for ($i = 0; $i < count($links); $i++) {
198 2762: $links[$i]['cron_url'] = "<span class='cron_url'>http://" . $_SERVER['HTTP_HOST'] . __PS_BASE_URI__ . "modules/advancedexport/cron.php?secure_key=".Configuration::get('ADVANCEDEXPORT_SECURE_KEY')."&id=" . $links[$i]['id_advancedexport']." </span><span class='cron_button'>copy to clipboard</span>";
199 2763 $type = $this->getSaveTypes();
200 2764 $links[$i]['save_type'] = $type[$links[$i]['save_type']]['short_name'];
201
202/var/www/unisit_ecommerce/modules/advancedexport/classes/AdvancedExportClass.php:
203 2
204 3
205 4: class AdvancedExportClass extends ObjectModel
206 5 {
207 6: public $id_advancedexport;
208 7 public $type;
209 8 public $name;
210 .
211 31
212 32 public static $definition = array(
213 33: 'table' => 'advancedexport',
214 34: 'primary' => 'id_advancedexport',
215 35 );
216 36
217 ..
218 47 parent::validateFields();
219 48 $fields = null;
220 49: $fields['id_advancedexport'] = (int)($this->id);
221 50 $fields['type'] = (string)($this->type);
222 51 $fields['name'] = (string)($this->name);
223
224/var/www/unisit_ecommerce/modules/advancedexport/config_it.xml:
225 1 <?xml version="1.0" encoding="UTF-8" ?>
226 2 <module>
227 3: <name>advancedexport</name>
228 4 <displayName><![CDATA[Esportazione Avanzata]]></displayName>
229 5 <version><![CDATA[4.2.0]]></version>
230
231/var/www/unisit_ecommerce/modules/advancedexport/cron.php:
232 2
233 3 include(dirname(__FILE__).'/../../config/config.inc.php');
234 4: include(dirname(__FILE__) . '/advancedexport.php');
235 5
236 6 if (Tools::getIsset('secure_key'))
237 7 {
238 8: $secureKey = Configuration::get('ADVANCEDEXPORT_SECURE_KEY');
239 9 if (!empty($secureKey) AND $secureKey === Tools::getValue('secure_key'))
240 10 {
241 11 include(dirname(__FILE__).'/../../init.php');
242 12
243 13: $ae = new AdvancedExport();
244 14 $ae->cronTask();
245 15 }
246
247/var/www/unisit_ecommerce/modules/advancedexport/csv/orders/txt/rename_csv.sh:
248 1 # Rename all *.csv to *.txt
249 2: for f in /var/www/unisit_ecommerce/modules/advancedexport/csv/orders/txt/*.csv; do
250 3 mv -- "$f" "${f%.csv}.txt"
251 4 done
252
253/var/www/unisit_ecommerce/modules/advancedexport/upgrade/upgrade-4.1.8.php:
254 6 function upgrade_module_4_1_8($object)
255 7 {
256 8: $query = 'ALTER TABLE `'._DB_PREFIX_.'advancedexport` ADD `start_id` int(10) NOT NULL DEFAULT 0 after `last_exported_id`';
257 9 $return = Db::getInstance()->execute($query);
258 10
259 11
260 12: $query = 'ALTER TABLE `'._DB_PREFIX_.'advancedexport` ADD `end_id` int(10) NOT NULL DEFAULT 0 after `start_id`';
261 13 $return &= Db::getInstance()->execute($query);
262 14
263
26467 matches across 6 files