Version Notes
SerwerSMS
Download this release
Release Info
Developer | SerwerSMS.pl |
Extension | SerwerSMSpl |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- app/code/community/SerwerSMS/Sms/Block/Adminhtml/Niewyslane/Grid.php +86 -0
- app/code/community/SerwerSMS/Sms/Block/Adminhtml/NiewyslaneGrid.php +28 -0
- app/code/community/SerwerSMS/Sms/Block/Adminhtml/Odpowiedzi/Grid.php +60 -0
- app/code/community/SerwerSMS/Sms/Block/Adminhtml/OdpowiedziGrid.php +28 -0
- app/code/community/SerwerSMS/Sms/Block/Adminhtml/Wyslane/Grid.php +86 -0
- app/code/community/SerwerSMS/Sms/Block/Adminhtml/WyslaneGrid.php +28 -0
- app/code/community/SerwerSMS/Sms/Block/Danekonta.php +65 -0
- app/code/community/SerwerSMS/Sms/Block/Wyslijsms.php +76 -0
- app/code/community/SerwerSMS/Sms/Helper/SerwerSMS.php +341 -0
- app/code/community/SerwerSMS/Sms/Model/Mysql4/OdpowiedziModel.php +16 -0
- app/code/community/SerwerSMS/Sms/Model/Mysql4/OdpowiedziModel/Collection.php +18 -0
- app/code/community/SerwerSMS/Sms/Model/Mysql4/SmsModel.php +16 -0
- app/code/community/SerwerSMS/Sms/Model/Mysql4/SmsModel/Collection.php +18 -0
- app/code/community/SerwerSMS/Sms/Model/Nadawcy.php +51 -0
- app/code/community/SerwerSMS/Sms/Model/Observer.php +147 -0
- app/code/community/SerwerSMS/Sms/Model/OdpowiedziModel.php +17 -0
- app/code/community/SerwerSMS/Sms/Model/SmsModel.php +17 -0
- app/code/community/SerwerSMS/Sms/controllers/Adminhtml/IndexController.php +233 -0
- app/code/community/SerwerSMS/Sms/controllers/OdpowiedziController.php +40 -0
- app/code/community/SerwerSMS/Sms/controllers/RaportController.php +46 -0
- app/code/community/SerwerSMS/Sms/etc/config.xml +193 -0
- app/code/community/SerwerSMS/Sms/etc/system.xml +197 -0
- app/code/community/SerwerSMS/Sms/sql/sms_setup/mysql4-install-1.0.0.php +41 -0
- app/design/adminhtml/default/default/layout/serwersms/sms.xml +50 -0
- app/design/adminhtml/default/default/template/serwersms/danekonta.phtml +121 -0
- app/design/adminhtml/default/default/template/serwersms/dodajnazwe.phtml +61 -0
- app/design/adminhtml/default/default/template/serwersms/faktury.phtml +133 -0
- app/design/adminhtml/default/default/template/serwersms/formularzsms.phtml +163 -0
- app/etc/modules/SerwerSMS_Sms.xml +9 -0
- package.xml +18 -0
- skin/adminhtml/default/default/serwersms/serwersms.png +0 -0
app/code/community/SerwerSMS/Sms/Block/Adminhtml/Niewyslane/Grid.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Block_Adminhtml_Niewyslane_Grid extends Mage_Adminhtml_Block_Widget_Grid{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
|
13 |
+
parent::_construct();
|
14 |
+
$this->setId('niewyslaneGrid');
|
15 |
+
$this->setDefaultSort('id');
|
16 |
+
$this->setDefaultDir('DESC');
|
17 |
+
$this->setSaveParametersInSession(true);
|
18 |
+
}
|
19 |
+
|
20 |
+
protected function _prepareCollection(){
|
21 |
+
|
22 |
+
$collection = Mage::getModel('serwersms_model/SmsModel')->getCollection();
|
23 |
+
$collection->addFieldToFilter('status', 'err');
|
24 |
+
$this->setCollection($collection);
|
25 |
+
return parent::_prepareCollection();
|
26 |
+
}
|
27 |
+
|
28 |
+
protected function _prepareColumns(){
|
29 |
+
|
30 |
+
$this->addColumn('id',
|
31 |
+
array(
|
32 |
+
'header' => 'ID',
|
33 |
+
'align' => 'right',
|
34 |
+
'width' => '50px',
|
35 |
+
'index' => 'id',
|
36 |
+
));
|
37 |
+
$this->addColumn('data',
|
38 |
+
array(
|
39 |
+
'header' => 'Data',
|
40 |
+
'align' => 'left',
|
41 |
+
'width' => '200px',
|
42 |
+
'index' => 'data',
|
43 |
+
));
|
44 |
+
$this->addColumn('smsid',
|
45 |
+
array(
|
46 |
+
'header' => 'SMS ID',
|
47 |
+
'align' => 'left',
|
48 |
+
'index' => 'smsid',
|
49 |
+
));
|
50 |
+
$this->addColumn('numer',
|
51 |
+
array(
|
52 |
+
'header' => 'Numer',
|
53 |
+
'align' => 'left',
|
54 |
+
'index' => 'numer',
|
55 |
+
));
|
56 |
+
$this->addColumn('nadawca',
|
57 |
+
array(
|
58 |
+
'header' => 'Nadawca',
|
59 |
+
'align' => 'left',
|
60 |
+
'index' => 'nadawca',
|
61 |
+
));
|
62 |
+
$this->addColumn('typ',
|
63 |
+
array(
|
64 |
+
'header' => 'Typ',
|
65 |
+
'align' => 'left',
|
66 |
+
'width' => '50px',
|
67 |
+
'index' => 'typ',
|
68 |
+
));
|
69 |
+
$this->addColumn('tresc',
|
70 |
+
array(
|
71 |
+
'header' => 'Treść',
|
72 |
+
'align' => 'left',
|
73 |
+
'index' => 'tresc',
|
74 |
+
));
|
75 |
+
$this->addColumn('powod',
|
76 |
+
array(
|
77 |
+
'header' => 'Uwagi',
|
78 |
+
'align' => 'left',
|
79 |
+
'index' => 'powod',
|
80 |
+
));
|
81 |
+
return parent::_prepareColumns();
|
82 |
+
}
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
+
?>
|
app/code/community/SerwerSMS/Sms/Block/Adminhtml/NiewyslaneGrid.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Block_Adminhtml_NiewyslaneGrid extends Mage_Adminhtml_Block_Widget_Grid_Container{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
|
13 |
+
// gdzie jest kontroler
|
14 |
+
$this->_controller = 'adminhtml_niewyslane';
|
15 |
+
$this->_blockGroup = 'sms';
|
16 |
+
|
17 |
+
// tekst w naglowku admina
|
18 |
+
$this->_headerText = 'Wiadomości niewyslane';
|
19 |
+
|
20 |
+
// tekst na przycisku dodawania
|
21 |
+
$this->_addButtonLabel = '';
|
22 |
+
parent::_construct();
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
?>
|
app/code/community/SerwerSMS/Sms/Block/Adminhtml/Odpowiedzi/Grid.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Block_Adminhtml_Odpowiedzi_Grid extends Mage_Adminhtml_Block_Widget_Grid{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
|
13 |
+
parent::_construct();
|
14 |
+
$this->setId('odpowiedziGrid');
|
15 |
+
$this->setDefaultSort('id_odp');
|
16 |
+
$this->setDefaultDir('DESC');
|
17 |
+
$this->setSaveParametersInSession(true);
|
18 |
+
}
|
19 |
+
|
20 |
+
protected function _prepareCollection(){
|
21 |
+
|
22 |
+
$collection = Mage::getModel('serwersms_model/OdpowiedziModel')->getCollection();
|
23 |
+
$this->setCollection($collection);
|
24 |
+
return parent::_prepareCollection();
|
25 |
+
}
|
26 |
+
|
27 |
+
protected function _prepareColumns(){
|
28 |
+
|
29 |
+
$this->addColumn('id_odp',
|
30 |
+
array(
|
31 |
+
'header' => 'ID',
|
32 |
+
'align' => 'right',
|
33 |
+
'width' => '50px',
|
34 |
+
'index' => 'id_odp',
|
35 |
+
));
|
36 |
+
$this->addColumn('data',
|
37 |
+
array(
|
38 |
+
'header' => 'Data',
|
39 |
+
'align' => 'left',
|
40 |
+
'width' => '200px',
|
41 |
+
'index' => 'data',
|
42 |
+
));
|
43 |
+
$this->addColumn('numer',
|
44 |
+
array(
|
45 |
+
'header' => 'Numer',
|
46 |
+
'align' => 'left',
|
47 |
+
'index' => 'numer',
|
48 |
+
));
|
49 |
+
$this->addColumn('wiadomosc',
|
50 |
+
array(
|
51 |
+
'header' => 'Wiadomość',
|
52 |
+
'align' => 'left',
|
53 |
+
'index' => 'wiadomosc',
|
54 |
+
));
|
55 |
+
return parent::_prepareColumns();
|
56 |
+
}
|
57 |
+
|
58 |
+
}
|
59 |
+
|
60 |
+
?>
|
app/code/community/SerwerSMS/Sms/Block/Adminhtml/OdpowiedziGrid.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Block_Adminhtml_OdpowiedziGrid extends Mage_Adminhtml_Block_Widget_Grid_Container{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
|
13 |
+
// gdzie jest kontroler
|
14 |
+
$this->_controller = 'adminhtml_odpowiedzi';
|
15 |
+
$this->_blockGroup = 'sms';
|
16 |
+
|
17 |
+
// tekst w naglowku admina
|
18 |
+
$this->_headerText = 'Odpowiedzi SMS';
|
19 |
+
|
20 |
+
// tekst na przycisku dodawania
|
21 |
+
$this->_addButtonLabel = '';
|
22 |
+
parent::_construct();
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
?>
|
app/code/community/SerwerSMS/Sms/Block/Adminhtml/Wyslane/Grid.php
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Block_Adminhtml_Wyslane_Grid extends Mage_Adminhtml_Block_Widget_Grid{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
|
13 |
+
parent::_construct();
|
14 |
+
$this->setId('wyslaneGrid');
|
15 |
+
$this->setDefaultSort('id');
|
16 |
+
$this->setDefaultDir('DESC');
|
17 |
+
$this->setSaveParametersInSession(true);
|
18 |
+
}
|
19 |
+
|
20 |
+
protected function _prepareCollection(){
|
21 |
+
|
22 |
+
$collection = Mage::getModel('serwersms_model/SmsModel')->getCollection();
|
23 |
+
$collection->addFieldToFilter('status', 'ok');
|
24 |
+
$this->setCollection($collection);
|
25 |
+
return parent::_prepareCollection();
|
26 |
+
}
|
27 |
+
|
28 |
+
protected function _prepareColumns(){
|
29 |
+
|
30 |
+
$this->addColumn('id',
|
31 |
+
array(
|
32 |
+
'header' => 'ID',
|
33 |
+
'align' => 'right',
|
34 |
+
'width' => '50px',
|
35 |
+
'index' => 'id',
|
36 |
+
));
|
37 |
+
$this->addColumn('data',
|
38 |
+
array(
|
39 |
+
'header' => 'Data',
|
40 |
+
'align' => 'left',
|
41 |
+
'width' => '200px',
|
42 |
+
'index' => 'data',
|
43 |
+
));
|
44 |
+
$this->addColumn('smsid',
|
45 |
+
array(
|
46 |
+
'header' => 'SMS ID',
|
47 |
+
'align' => 'left',
|
48 |
+
'index' => 'smsid',
|
49 |
+
));
|
50 |
+
$this->addColumn('numer',
|
51 |
+
array(
|
52 |
+
'header' => 'Numer',
|
53 |
+
'align' => 'left',
|
54 |
+
'index' => 'numer',
|
55 |
+
));
|
56 |
+
$this->addColumn('nadawca',
|
57 |
+
array(
|
58 |
+
'header' => 'Nadawca',
|
59 |
+
'align' => 'left',
|
60 |
+
'index' => 'nadawca',
|
61 |
+
));
|
62 |
+
$this->addColumn('typ',
|
63 |
+
array(
|
64 |
+
'header' => 'Typ',
|
65 |
+
'align' => 'left',
|
66 |
+
'width' => '50px',
|
67 |
+
'index' => 'typ',
|
68 |
+
));
|
69 |
+
$this->addColumn('raport',
|
70 |
+
array(
|
71 |
+
'header' => 'Raport',
|
72 |
+
'align' => 'left',
|
73 |
+
'index' => 'raport',
|
74 |
+
));
|
75 |
+
$this->addColumn('tresc',
|
76 |
+
array(
|
77 |
+
'header' => 'Treść',
|
78 |
+
'align' => 'left',
|
79 |
+
'index' => 'tresc',
|
80 |
+
));
|
81 |
+
return parent::_prepareColumns();
|
82 |
+
}
|
83 |
+
|
84 |
+
}
|
85 |
+
|
86 |
+
?>
|
app/code/community/SerwerSMS/Sms/Block/Adminhtml/WyslaneGrid.php
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Block_Adminhtml_WyslaneGrid extends Mage_Adminhtml_Block_Widget_Grid_Container{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
|
13 |
+
// gdzie jest kontroler
|
14 |
+
$this->_controller = 'adminhtml_wyslane';
|
15 |
+
$this->_blockGroup = 'sms';
|
16 |
+
|
17 |
+
// tekst w naglowku admina
|
18 |
+
$this->_headerText = 'Wiadomości wysłane';
|
19 |
+
|
20 |
+
// tekst na przycisku dodawania
|
21 |
+
$this->_addButtonLabel = '';
|
22 |
+
parent::_construct();
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
}
|
27 |
+
|
28 |
+
?>
|
app/code/community/SerwerSMS/Sms/Block/Danekonta.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Block_Danekonta extends Mage_Core_Block_Template{
|
10 |
+
|
11 |
+
public function pokazDaneKonta(){
|
12 |
+
|
13 |
+
$result = '';
|
14 |
+
|
15 |
+
$helper = Mage::helper('sms_helper/SerwerSMS');
|
16 |
+
$api['login'] = $helper->getApiLogin();
|
17 |
+
$api['haslo'] = $helper->getApiPassword();
|
18 |
+
|
19 |
+
$xml = $helper->ilosc_sms(array(login => $api['login'], haslo => $api['haslo'], pokaz_typ_konta => 1));
|
20 |
+
$dane = $helper->PrzetworzXML("ilosc_sms",$xml);
|
21 |
+
|
22 |
+
if(is_array($dane)){
|
23 |
+
|
24 |
+
$xml2 = $helper->nazwa_nadawcy(array(login => $api['login'], haslo => $api['haslo'], operacja => 'lista'));
|
25 |
+
$nazwy_nadawcy = $helper->PrzetworzXML("nazwa_nadawcy",$xml2);
|
26 |
+
$xml3 = $helper->pomoc(array(login => $api['login'], haslo => $api['haslo']));
|
27 |
+
$pomoc = $helper->PrzetworzXML("pomoc",$xml3);
|
28 |
+
|
29 |
+
foreach($dane as $key => $value){
|
30 |
+
if($value['konto']){
|
31 |
+
$result['konto'] = $value['konto'];
|
32 |
+
} elseif($value['typ_sms'] == 'ECO'){
|
33 |
+
$result['ECO'] = $value['stan'];
|
34 |
+
$result['ECOlimit'] = $value['limit'];
|
35 |
+
} elseif($value['typ_sms'] == 'FULL'){
|
36 |
+
$result['FULL'] = $value['stan'];
|
37 |
+
$result['FULLlimit'] = $value['limit'];
|
38 |
+
}
|
39 |
+
}
|
40 |
+
$result['nadawcy'] = $nazwy_nadawcy;
|
41 |
+
$result['pomoc'] = $pomoc;
|
42 |
+
} else {
|
43 |
+
$result = $dane;
|
44 |
+
}
|
45 |
+
|
46 |
+
//Mage::getSingleton('adminhtml/session')->addSuccess('Rekord dodany pomy�lnie!');
|
47 |
+
return $result;
|
48 |
+
}
|
49 |
+
|
50 |
+
public function pokazFaktury(){
|
51 |
+
|
52 |
+
$helper = Mage::helper('sms_helper/SerwerSMS');
|
53 |
+
$api['login'] = $helper->getApiLogin();
|
54 |
+
$api['haslo'] = $helper->getApiPassword();
|
55 |
+
|
56 |
+
$xml = $helper->faktury(array(login => $api['login'], haslo => $api['haslo'], operacja => "lista"));
|
57 |
+
$dane = $helper->PrzetworzXML("faktury",$xml);
|
58 |
+
|
59 |
+
return $dane;
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
}
|
64 |
+
|
65 |
+
?>
|
app/code/community/SerwerSMS/Sms/Block/Wyslijsms.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
6 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
7 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
8 |
+
*/
|
9 |
+
|
10 |
+
class SerwerSMS_Sms_Block_Wyslijsms extends Mage_Core_Block_Template{
|
11 |
+
|
12 |
+
public function nadawcyLista(){
|
13 |
+
|
14 |
+
$result = '';
|
15 |
+
|
16 |
+
$helper = Mage::helper('sms_helper/SerwerSMS');
|
17 |
+
$api['login'] = $helper->getApiLogin();
|
18 |
+
$api['haslo'] = $helper->getApiPassword();
|
19 |
+
|
20 |
+
$xml = $helper->ilosc_sms(array(login => $api['login'], haslo => $api['haslo']));
|
21 |
+
$dane = $helper->PrzetworzXML("ilosc_sms",$xml);
|
22 |
+
|
23 |
+
if(is_array($dane)){
|
24 |
+
|
25 |
+
$xml2 = $helper->nazwa_nadawcy(array(login => $api['login'], haslo => $api['haslo'], operacja => 'lista'));
|
26 |
+
$nazwy_nadawcy = $helper->PrzetworzXML("nazwa_nadawcy",$xml2);
|
27 |
+
$xml3 = $helper->nazwa_nadawcy(array(login => $api['login'], haslo => $api['haslo'], operacja => 'lista', predefiniowane => 1));
|
28 |
+
$predefiniowane = $helper->PrzetworzXML("nazwa_nadawcy",$xml3);
|
29 |
+
|
30 |
+
$result['wlasne'] = $nazwy_nadawcy;
|
31 |
+
$result['predefiniowane'] = $predefiniowane;
|
32 |
+
} else {
|
33 |
+
$result = $dane;
|
34 |
+
}
|
35 |
+
|
36 |
+
return $result;
|
37 |
+
}
|
38 |
+
|
39 |
+
public function kontaktyLista(){
|
40 |
+
|
41 |
+
$collection = Mage::getModel('customer/customer')
|
42 |
+
->getCollection()
|
43 |
+
->addAttributeToSelect('*')
|
44 |
+
->setOrder("lastname");
|
45 |
+
$i=0;
|
46 |
+
foreach($collection as $customer){
|
47 |
+
|
48 |
+
if($customer->getPrimaryBillingAddress()){
|
49 |
+
$result[$i]['name'] = $customer->getLastname().' '.$customer->getFirstname();
|
50 |
+
$result[$i]['telefon'] = $customer->getPrimaryBillingAddress()->getTelephone();
|
51 |
+
$i++;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
return $result;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function grupyLista(){
|
59 |
+
|
60 |
+
$collection = Mage::getModel('customer/group')
|
61 |
+
->getCollection()->getData();
|
62 |
+
|
63 |
+
$i=0;
|
64 |
+
foreach($collection as $group){
|
65 |
+
|
66 |
+
$result[$i]['id'] = $group['customer_group_id'];
|
67 |
+
$result[$i]['name'] = $group['customer_group_code'];
|
68 |
+
$i++;
|
69 |
+
}
|
70 |
+
|
71 |
+
return $result;
|
72 |
+
}
|
73 |
+
|
74 |
+
}
|
75 |
+
|
76 |
+
?>
|
app/code/community/SerwerSMS/Sms/Helper/SerwerSMS.php
ADDED
@@ -0,0 +1,341 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Helper_SerwerSMS {
|
10 |
+
|
11 |
+
public static $API_URL = 'https://api1.serwersms.pl/zdalnie/?';
|
12 |
+
|
13 |
+
public static function wyslij_sms($Parametry) {
|
14 |
+
return self::Zapytanie("wyslij_sms", $Parametry);
|
15 |
+
}
|
16 |
+
|
17 |
+
public static function ilosc_sms($Parametry) {
|
18 |
+
return self::Zapytanie("ilosc_sms", $Parametry);
|
19 |
+
}
|
20 |
+
|
21 |
+
public static function nazwa_nadawcy($Parametry){
|
22 |
+
return self::Zapytanie("nazwa_nadawcy",$Parametry);
|
23 |
+
}
|
24 |
+
|
25 |
+
public static function faktury($Parametry){
|
26 |
+
return self::Zapytanie("faktury",$Parametry);
|
27 |
+
}
|
28 |
+
|
29 |
+
public static function pomoc($Parametry){
|
30 |
+
return self::Zapytanie("pomoc",$Parametry);
|
31 |
+
}
|
32 |
+
|
33 |
+
private static function Zapytanie($akcja, $params) {
|
34 |
+
|
35 |
+
$requestUrl = self::$API_URL;
|
36 |
+
$params["akcja"] = $akcja;
|
37 |
+
$postParams = array_merge($params);
|
38 |
+
|
39 |
+
$curl = curl_init($requestUrl);
|
40 |
+
curl_setopt($curl, CURLOPT_POST, 1);
|
41 |
+
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postParams));
|
42 |
+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
43 |
+
curl_setopt($curl,CURLOPT_TIMEOUT,60);
|
44 |
+
$answer = curl_exec($curl);
|
45 |
+
|
46 |
+
if (curl_errno($curl)) {
|
47 |
+
}
|
48 |
+
|
49 |
+
curl_close($curl);
|
50 |
+
|
51 |
+
return $answer;
|
52 |
+
}
|
53 |
+
|
54 |
+
public function xml_attribute($object, $attribute)
|
55 |
+
{
|
56 |
+
if(isset($object[$attribute]))
|
57 |
+
return (string) $object[$attribute];
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
public function PrzetworzXML($akcja,$xml_file) {
|
62 |
+
$dom = new domDocument;
|
63 |
+
$dom->loadXML($xml_file);
|
64 |
+
$xml = simplexml_import_dom($dom);
|
65 |
+
|
66 |
+
if (isset($xml->Blad)) {
|
67 |
+
|
68 |
+
$numer = $_POST['numer'];
|
69 |
+
$przyczyna = $xml->Blad;
|
70 |
+
return $przyczyna;
|
71 |
+
|
72 |
+
} elseif ($akcja=="wyslij_sms") {
|
73 |
+
|
74 |
+
if(isset($xml->Odbiorcy->Skolejkowane)){
|
75 |
+
$i = 0;
|
76 |
+
foreach($xml->Odbiorcy->Skolejkowane->SMS as $sms) {
|
77 |
+
$wyslane[$i]['smsid'] = self::xml_attribute($sms, 'id');
|
78 |
+
$wyslane[$i]['numer'] = self::xml_attribute($sms, 'numer');
|
79 |
+
$wyslane[$i]['kolejka'] = self::xml_attribute($sms, 'godzina_skolejkowania');
|
80 |
+
$i++;
|
81 |
+
}
|
82 |
+
}
|
83 |
+
if (isset($xml->Odbiorcy->Niewyslane)) {
|
84 |
+
$i=0;
|
85 |
+
foreach($xml->Odbiorcy->Niewyslane->SMS as $sms) {
|
86 |
+
$niewyslane[$i]['smsid'] = self::xml_attribute($sms, 'id');
|
87 |
+
$niewyslane[$i]['numer'] = self::xml_attribute($sms, 'numer');
|
88 |
+
$niewyslane[$i]['przyczyna'] = self::xml_attribute($sms, 'przyczyna');
|
89 |
+
$i++;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
$wynik['wyslane'] = $wyslane;
|
93 |
+
$wynik['niewyslane'] = $niewyslane;
|
94 |
+
|
95 |
+
return $wynik;
|
96 |
+
|
97 |
+
} elseif ($akcja=="ilosc_sms") {
|
98 |
+
if(isset($xml->SMS)){
|
99 |
+
$i = 0;
|
100 |
+
foreach($xml->SMS as $sms) {
|
101 |
+
$limity[$i]['typ_sms'] = self::xml_attribute($sms, 'typ');
|
102 |
+
$limity[$i]['stan'] = $sms;
|
103 |
+
$limity[$i]['limit'] = self::xml_attribute($sms, 'limit_znakow');
|
104 |
+
$i++;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
if(isset($xml->KONTO)){
|
108 |
+
$limity[$i]['konto'] = $xml->KONTO;
|
109 |
+
}
|
110 |
+
return $limity;
|
111 |
+
|
112 |
+
} elseif ($akcja=="nazwa_nadawcy") {
|
113 |
+
if(isset($xml->NADAWCA)){
|
114 |
+
foreach($xml->NADAWCA as $nadawca){
|
115 |
+
$lista[self::xml_attribute($nadawca,'nazwa')] = $nadawca;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
return $lista;
|
119 |
+
} elseif ($akcja=="faktury"){
|
120 |
+
if(isset($xml->FAKTURA)){
|
121 |
+
$i = 0;
|
122 |
+
foreach($xml->FAKTURA as $fak){
|
123 |
+
$faktury[$i]['id'] = self::xml_attribute($fak, 'id');
|
124 |
+
$faktury[$i]['numer'] = $fak->numer;
|
125 |
+
$faktury[$i]['rozliczono'] = $fak->rozliczono;
|
126 |
+
$faktury[$i]['kwota'] = $fak->kwota;
|
127 |
+
$faktury[$i]['termin'] = $fak->termin;
|
128 |
+
}
|
129 |
+
}
|
130 |
+
return $faktury;
|
131 |
+
} elseif ($akcja=="pomoc") {
|
132 |
+
$pomoc['telefon'] = $xml->Telefon;
|
133 |
+
$pomoc['infolinia'] = $xml->Infolinia;
|
134 |
+
$pomoc['email'] = $xml->Email;
|
135 |
+
$pomoc['formularz'] = $xml->Formularz;
|
136 |
+
$pomoc['faq'] = $xml->Faq;
|
137 |
+
$pomoc['opiekun'] = $xml->Opiekun->Nazwa;
|
138 |
+
$pomoc['op_email'] = $xml->Opiekun->Email;
|
139 |
+
$pomoc['op_telefon'] = $xml->Opiekun->Telefon;
|
140 |
+
$pomoc['foto'] = $xml->Opiekun->Foto;
|
141 |
+
return $pomoc;
|
142 |
+
}
|
143 |
+
}
|
144 |
+
|
145 |
+
public function korektaNumerow($numery){
|
146 |
+
if(is_array($numery)){
|
147 |
+
foreach($numery as $numer){
|
148 |
+
$numer = str_replace(" ","",$numer);
|
149 |
+
$numer = str_replace("-","",$numer);
|
150 |
+
$result[] = $numer;
|
151 |
+
}
|
152 |
+
} else {
|
153 |
+
$numer = str_replace(" ","",$numery);
|
154 |
+
$numer = str_replace("-","",$numer);
|
155 |
+
$result[] = $numer;
|
156 |
+
}
|
157 |
+
return $result;
|
158 |
+
}
|
159 |
+
|
160 |
+
public function getApiLogin(){
|
161 |
+
return Mage::getStoreConfig('smsconfig_section/konfiguracjasms/uzytkownik');
|
162 |
+
}
|
163 |
+
|
164 |
+
public function getApiPassword(){
|
165 |
+
return Mage::getStoreConfig('smsconfig_section/konfiguracjasms/haslo');
|
166 |
+
}
|
167 |
+
|
168 |
+
public function wlaczonySerwerSMS(){
|
169 |
+
return Mage::getStoreConfig('smsconfig_section/konfiguracjasms/wlaczony');
|
170 |
+
}
|
171 |
+
|
172 |
+
public function smsFull(){
|
173 |
+
return Mage::getStoreConfig('smsconfig_section/ustawieniawiadomosci/typsms');
|
174 |
+
}
|
175 |
+
|
176 |
+
public function nazwaNadawcy(){
|
177 |
+
return Mage::getStoreConfig('smsconfig_section/ustawieniawiadomosci/nadawca');
|
178 |
+
}
|
179 |
+
|
180 |
+
public function numeryAdministratora(){
|
181 |
+
|
182 |
+
$numery_admin = Mage::getStoreConfig('smsconfig_section/konfiguracjasms/numery_admin');
|
183 |
+
$odbiorcy = explode(",",$numery_admin);
|
184 |
+
$odbiorcy = $this->korektaNumerow($odbiorcy);
|
185 |
+
return implode(",",$odbiorcy);
|
186 |
+
}
|
187 |
+
|
188 |
+
public function powiadomienieZamowienie(){
|
189 |
+
return Mage::getStoreConfig('smsconfig_section/powiadomienia/zamowienie');
|
190 |
+
}
|
191 |
+
|
192 |
+
public function szablonZamowienie(){
|
193 |
+
return Mage::getStoreConfig('smsconfig_section/tekstysms/tekst_zamowienie');
|
194 |
+
}
|
195 |
+
|
196 |
+
public function powiadomienieRealizacja(){
|
197 |
+
return Mage::getStoreConfig('smsconfig_section/powiadomienia/realizacja');
|
198 |
+
}
|
199 |
+
|
200 |
+
public function szablonRealizacja(){
|
201 |
+
return Mage::getStoreConfig('smsconfig_section/tekstysms/tekst_realizacja');
|
202 |
+
}
|
203 |
+
|
204 |
+
public function powiadomienieWstrzymanie(){
|
205 |
+
return Mage::getStoreConfig('smsconfig_section/powiadomienia/wstrzymanie');
|
206 |
+
}
|
207 |
+
|
208 |
+
public function szablonWstrzymanie(){
|
209 |
+
return Mage::getStoreConfig('smsconfig_section/tekstysms/tekst_wstrzymanie');
|
210 |
+
}
|
211 |
+
|
212 |
+
public function szablonOdblokowanie(){
|
213 |
+
return Mage::getStoreConfig('smsconfig_section/tekstysms/tekst_odblokowanie');
|
214 |
+
}
|
215 |
+
|
216 |
+
public function powiadomienieStanKonta(){
|
217 |
+
return Mage::getStoreConfig('smsconfig_section/powiadomienia/stan_konta');
|
218 |
+
}
|
219 |
+
|
220 |
+
public function wyslijSms($parametry, $stanKonta = 1){
|
221 |
+
|
222 |
+
if(!isset($parametry['nadawca'])) $parametry['nadawca'] = ($this->smsFull()) ? $this->nazwaNadawcy() : '';
|
223 |
+
if(!isset($parametry['typsms'])) $parametry['typsms'] = ($this->smsFull() and $this->nazwaNadawcy()) ? "FULL" : "ECO";
|
224 |
+
$parametry['login'] = $this->getApiLogin();
|
225 |
+
$parametry['haslo'] = $this->getApiPassword();
|
226 |
+
|
227 |
+
$xml = $this->wyslij_sms(array(login => $parametry['login'], haslo => $parametry['haslo'], numer => $parametry['odbiorcy'], wiadomosc => $parametry['tresc'], nadawca => $parametry['nadawca']));
|
228 |
+
$dane = $this->PrzetworzXML("wyslij_sms",$xml);
|
229 |
+
|
230 |
+
if($stanKonta){
|
231 |
+
$this->sprawdzStanKonta();
|
232 |
+
}
|
233 |
+
|
234 |
+
if(!is_array($dane)){
|
235 |
+
$baza[0]['data'] = date("Y-m-d H:i:s");
|
236 |
+
$baza[0]['smsid'] = 'brak';
|
237 |
+
$baza[0]['numer'] = $parametry['odbiorcy'];
|
238 |
+
$baza[0]['nadawca'] = $parametry['nadawca'];
|
239 |
+
$baza[0]['typ'] = $parametry['typsms'];
|
240 |
+
$baza[0]['raport'] = 'brak';
|
241 |
+
$baza[0]['status'] = 'err';
|
242 |
+
$baza[0]['tresc'] = $parametry['tresc'];
|
243 |
+
$baza[0]['powod'] = $dane;
|
244 |
+
} else {
|
245 |
+
$i = 0;
|
246 |
+
if (!empty($dane['wyslane'])){
|
247 |
+
foreach($dane['wyslane'] as $sms){
|
248 |
+
$baza[$i]['data'] = $sms['kolejka'];
|
249 |
+
$baza[$i]['smsid'] = $sms['smsid'];
|
250 |
+
$baza[$i]['numer'] = $sms['numer'];
|
251 |
+
$baza[$i]['nadawca'] = $parametry['nadawca'];
|
252 |
+
$baza[$i]['typ'] = $parametry['typsms'];
|
253 |
+
$baza[$i]['raport'] = 'Oczekiwanie na raport';
|
254 |
+
$baza[$i]['status'] = 'ok';
|
255 |
+
$baza[$i]['tresc'] = $parametry['tresc'];
|
256 |
+
$baza[$i]['powod'] = '';
|
257 |
+
$i++;
|
258 |
+
}
|
259 |
+
}
|
260 |
+
|
261 |
+
if (!empty($dane['niewyslane'])){
|
262 |
+
foreach($dane['niewyslane'] as $sms){
|
263 |
+
$baza[$i]['data'] = date("Y-m-d H:i:s");
|
264 |
+
$baza[$i]['smsid'] = $sms['smsid'];
|
265 |
+
$baza[$i]['numer'] = $sms['numer'];
|
266 |
+
$baza[$i]['nadawca'] = $parametry['nadawca'];
|
267 |
+
$baza[$i]['typ'] = $parametry['typsms'];
|
268 |
+
$baza[$i]['raport'] = 'brak';
|
269 |
+
$baza[$i]['status'] = 'err';
|
270 |
+
$baza[$i]['tresc'] = $parametry['tresc'];
|
271 |
+
$baza[$i]['powod'] = $sms['przyczyna'];
|
272 |
+
$i++;
|
273 |
+
}
|
274 |
+
}
|
275 |
+
}
|
276 |
+
|
277 |
+
try{
|
278 |
+
foreach($baza as $rekord){
|
279 |
+
$message = Mage::getModel('serwersms_model/smsModel');
|
280 |
+
$message->setData('data',$rekord['data']);
|
281 |
+
$message->setSmsid($rekord['smsid']);
|
282 |
+
$message->setNumer($rekord['numer']);
|
283 |
+
$message->setNadawca($rekord['nadawca']);
|
284 |
+
$message->setTyp($rekord['typ']);
|
285 |
+
$message->setRaport($rekord['raport']);
|
286 |
+
$message->setStatus($rekord['status']);
|
287 |
+
$message->setTresc($rekord['tresc']);
|
288 |
+
$message->setPowod($rekord['powod']);
|
289 |
+
$message->save();
|
290 |
+
}
|
291 |
+
return true;
|
292 |
+
} catch(Exception $e){
|
293 |
+
return false;
|
294 |
+
}
|
295 |
+
|
296 |
+
}
|
297 |
+
|
298 |
+
public function sprawdzStanKonta(){
|
299 |
+
|
300 |
+
if($this->wlaczonySerwerSMS() and $this->powiadomienieStanKonta()){
|
301 |
+
|
302 |
+
$parametry['login'] = $this->getApiLogin();
|
303 |
+
$parametry['haslo'] = $this->getApiPassword();
|
304 |
+
$parametry['odbiorcy'] = $this->numeryAdministratora();
|
305 |
+
|
306 |
+
$xml = $this->ilosc_sms(array(login => $parametry['login'], haslo => $parametry['haslo']));
|
307 |
+
$dane = $this->PrzetworzXML("ilosc_sms",$xml);
|
308 |
+
|
309 |
+
foreach($dane as $sms){
|
310 |
+
if($sms['typ_sms'] == 'ECO' and $sms['stan'] == 49){
|
311 |
+
$parametry['tresc'] = 'Stan Twojego konta SMS ECO spadl ponizej 50 wiadomosci';
|
312 |
+
$this->wyslijSms($parametry,0);
|
313 |
+
}
|
314 |
+
if($sms['typ_sms'] == 'FULL' and $sms['stan'] == 49){
|
315 |
+
$parametry['tresc'] = 'Stan Twojego konta SMS FULL spadl ponizej 50 wiadomosci';
|
316 |
+
$this->wyslijSms($parametry,0);
|
317 |
+
}
|
318 |
+
}
|
319 |
+
}
|
320 |
+
|
321 |
+
}
|
322 |
+
|
323 |
+
public function niezalogowanyWidok(){
|
324 |
+
|
325 |
+
$key = Mage::getSingleton('adminhtml/url')->getSecretKey("system_config","edit");
|
326 |
+
$konfig = Mage::helper("adminhtml")->getUrl("adminhtml/system_config/edit/",array("section" => 'smsconfig_section', "key" => $key));
|
327 |
+
|
328 |
+
$widok = '<div style="text-align: center">';
|
329 |
+
$widok .= '<strong>Błąd logowania: Nieprawidłowy login lub hasło.<br />
|
330 |
+
Prosimy o weryfikację danych w <a href="'.$konfig.'">konfiguracji</a>.</strong><br /><br />
|
331 |
+
Jeśli nie posiadasz konta w SerwerSMS prosimy o <a href="https://www.serwersms.pl/o,4-Rejestracja.html#rejestracja" target="_blank">zarejestrowanie się</a>.<br />
|
332 |
+
Po wypełnieniu formularza rejestracyjnego aktywuj swoje konto, zakup doładowanie SMS,<br />
|
333 |
+
lub skorzystaj z oferty abonamentowej.';
|
334 |
+
$widok .= '</div>';
|
335 |
+
|
336 |
+
return $widok;
|
337 |
+
|
338 |
+
}
|
339 |
+
}
|
340 |
+
|
341 |
+
?>
|
app/code/community/SerwerSMS/Sms/Model/Mysql4/OdpowiedziModel.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Model_Mysql4_OdpowiedziModel extends Mage_Core_Model_Mysql4_Abstract{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
$this->_init('serwersms_model/OdpowiedziModel','id_odp');
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
?>
|
app/code/community/SerwerSMS/Sms/Model/Mysql4/OdpowiedziModel/Collection.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Model_Mysql4_OdpowiedziModel_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
parent::_construct();
|
13 |
+
$this->_init('serwersms_model/OdpowiedziModel');
|
14 |
+
}
|
15 |
+
|
16 |
+
}
|
17 |
+
|
18 |
+
?>
|
app/code/community/SerwerSMS/Sms/Model/Mysql4/SmsModel.php
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Model_Mysql4_SmsModel extends Mage_Core_Model_Mysql4_Abstract{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
$this->_init('serwersms_model/SmsModel','id');
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
?>
|
app/code/community/SerwerSMS/Sms/Model/Mysql4/SmsModel/Collection.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Model_Mysql4_SmsModel_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
parent::_construct();
|
13 |
+
$this->_init('serwersms_model/SmsModel');
|
14 |
+
}
|
15 |
+
|
16 |
+
}
|
17 |
+
|
18 |
+
?>
|
app/code/community/SerwerSMS/Sms/Model/Nadawcy.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Model_Nadawcy extends Mage_Core_Model_Abstract {
|
10 |
+
|
11 |
+
public function toOptionArray() {
|
12 |
+
|
13 |
+
$helper = Mage::helper('sms_helper/SerwerSMS');
|
14 |
+
$api['login'] = $helper->getApiLogin();
|
15 |
+
$api['haslo'] = $helper->getApiPassword();
|
16 |
+
|
17 |
+
$xml = $helper->ilosc_sms(array(login => $api['login'], haslo => $api['haslo']));
|
18 |
+
$dane = $helper->PrzetworzXML("ilosc_sms",$xml);
|
19 |
+
|
20 |
+
if(is_array($dane)){
|
21 |
+
|
22 |
+
$xml2 = $helper->nazwa_nadawcy(array(login => $api['login'], haslo => $api['haslo'], operacja => 'lista'));
|
23 |
+
$nazwy_nadawcy = $helper->PrzetworzXML("nazwa_nadawcy",$xml2);
|
24 |
+
$xml3 = $helper->nazwa_nadawcy(array(login => $api['login'], haslo => $api['haslo'], operacja => 'lista', predefiniowane => 1));
|
25 |
+
$predefiniowane = $helper->PrzetworzXML("nazwa_nadawcy",$xml3);
|
26 |
+
|
27 |
+
$nadawcy['wlasne'] = $nazwy_nadawcy;
|
28 |
+
$nadawcy['predefiniowane'] = $predefiniowane;
|
29 |
+
|
30 |
+
$res = array(array('label' => '', 'value' => ''));
|
31 |
+
|
32 |
+
foreach($nazwy_nadawcy as $nazwa => $status){
|
33 |
+
if($status == 'Autoryzowano'){
|
34 |
+
$res[] = array('label' => $nazwa, 'value' => $nazwa);
|
35 |
+
}
|
36 |
+
}
|
37 |
+
|
38 |
+
foreach($predefiniowane as $nazwa => $status){
|
39 |
+
if($status == 'Autoryzowano'){
|
40 |
+
$res[] = array('label' => $nazwa, 'value' => $nazwa);
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
} else {
|
45 |
+
$res = array(array('label' => '', 'value' => ''));
|
46 |
+
}
|
47 |
+
|
48 |
+
return $res;
|
49 |
+
}
|
50 |
+
|
51 |
+
}
|
app/code/community/SerwerSMS/Sms/Model/Observer.php
ADDED
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Model_Observer{
|
10 |
+
|
11 |
+
public function wyslijsmsZamowienie(Varien_Event_Observer $observer){
|
12 |
+
|
13 |
+
$order = $observer->getEvent()->getOrder();
|
14 |
+
$orderId = $order->getId();
|
15 |
+
$numer_zamowienia = $order->getIncrementId();
|
16 |
+
$shipping = $order->getShippingAddress();
|
17 |
+
$kwota = number_format($order->getData('grand_total'),2,',','');
|
18 |
+
$name = $shipping->getFirstname();
|
19 |
+
$lastname = $shipping->getLastname();
|
20 |
+
|
21 |
+
$modul_wlaczony = $this->getHelper()->wlaczonySerwerSMS();
|
22 |
+
$powiadomienie_wlaczone = $this->getHelper()->powiadomienieZamowienie();
|
23 |
+
$szablon = $this->getHelper()->szablonZamowienie();
|
24 |
+
|
25 |
+
if($modul_wlaczony and $powiadomienie_wlaczone){
|
26 |
+
|
27 |
+
$wysylka['odbiorcy'] = $this->getHelper()->numeryAdministratora();
|
28 |
+
|
29 |
+
$szablon = str_replace("#IMIE#",$name,$szablon);
|
30 |
+
$szablon = str_replace("#NAZWISKO#",$lastname, $szablon);
|
31 |
+
$szablon = str_replace("#NUMER#",$numer_zamowienia,$szablon);
|
32 |
+
$szablon = str_replace("#KWOTA#",$kwota,$szablon);
|
33 |
+
|
34 |
+
$wysylka['tresc'] = $szablon;
|
35 |
+
|
36 |
+
$this->getHelper()->wyslijSms($wysylka);
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
40 |
+
|
41 |
+
public function wyslijsmsWysylka(Varien_Event_Observer $observer){
|
42 |
+
|
43 |
+
$modul_wlaczony = $this->getHelper()->wlaczonySerwerSMS();
|
44 |
+
$powiadomienie_wlaczone = $this->getHelper()->powiadomienieRealizacja();
|
45 |
+
$szablon = $this->getHelper()->szablonRealizacja();
|
46 |
+
|
47 |
+
if($modul_wlaczony and $powiadomienie_wlaczone){
|
48 |
+
|
49 |
+
$shipment = $observer->getShipment();
|
50 |
+
$order = $shipment->getOrder();
|
51 |
+
$billingAddress = $order->getBillingAddress();
|
52 |
+
|
53 |
+
$numer = $billingAddress->getTelephone();
|
54 |
+
$numer = $this->getHelper()->korektaNumerow($numer);
|
55 |
+
$wysylka['odbiorcy'] = implode(",",$numer);
|
56 |
+
|
57 |
+
$numer_zamowienia = $order->getIncrementId();
|
58 |
+
$shipping = $order->getShippingAddress();
|
59 |
+
$name = $shipping->getFirstname();
|
60 |
+
$lastname = $shipping->getLastname();
|
61 |
+
$adres = $shipping->getStreetFull().", ".$shipping->getPostcode()." ".$shipping->getCity();
|
62 |
+
$kwota = number_format($order->getData('grand_total'),2,',','');
|
63 |
+
|
64 |
+
$szablon = str_replace("#IMIE#",$name,$szablon);
|
65 |
+
$szablon = str_replace("#NAZWISKO#",$lastname, $szablon);
|
66 |
+
$szablon = str_replace("#NUMER#",$numer_zamowienia,$szablon);
|
67 |
+
$szablon = str_replace("#KWOTA#",$kwota,$szablon);
|
68 |
+
$szablon = str_replace("#ADRES#",$adres,$szablon);
|
69 |
+
|
70 |
+
$wysylka['tresc'] = $szablon;
|
71 |
+
|
72 |
+
$this->getHelper()->wyslijSms($wysylka);
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
public function wyslijsmsWstrzymanie(Varien_Event_Observer $observer){
|
77 |
+
|
78 |
+
$order = $observer->getOrder();
|
79 |
+
|
80 |
+
if ($order->getState() !== $order->getOrigData('state') && $order->getState() === Mage_Sales_Model_Order::STATE_HOLDED) {
|
81 |
+
|
82 |
+
$orderId = $order->getId();
|
83 |
+
$numer_zamowienia = $order->getIncrementId();
|
84 |
+
$shipping = $order->getShippingAddress();
|
85 |
+
$kwota = number_format($order->getData('grand_total'),2,',','');
|
86 |
+
$name = $shipping->getFirstname();
|
87 |
+
$lastname = $shipping->getLastname();
|
88 |
+
|
89 |
+
$szablon = $this->getHelper()->szablonWstrzymanie();
|
90 |
+
$billingAddress = $order->getBillingAddress();
|
91 |
+
$numer = $billingAddress->getTelephone();
|
92 |
+
$numer = $this->getHelper()->korektaNumerow($numer);
|
93 |
+
$wysylka['odbiorcy'] = implode(",",$numer);
|
94 |
+
|
95 |
+
if($this->getHelper()->wlaczonySerwerSMS() and $this->getHelper()->powiadomienieWstrzymanie()){
|
96 |
+
|
97 |
+
$szablon = str_replace("#IMIE#",$name,$szablon);
|
98 |
+
$szablon = str_replace("#NAZWISKO#",$lastname, $szablon);
|
99 |
+
$szablon = str_replace("#NUMER#",$numer_zamowienia,$szablon);
|
100 |
+
$szablon = str_replace("#KWOTA#",$kwota,$szablon);
|
101 |
+
|
102 |
+
$wysylka['tresc'] = $szablon;
|
103 |
+
|
104 |
+
$this->getHelper()->wyslijSms($wysylka);
|
105 |
+
}
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
public function wyslijsmsOdblokowanie(Varien_Event_Observer $observer){
|
110 |
+
|
111 |
+
$order = $observer->getOrder();
|
112 |
+
|
113 |
+
if ($order->getState() !== $order->getOrigData('state') && $order->getOrigData('state') === Mage_Sales_Model_Order::STATE_HOLDED) {
|
114 |
+
|
115 |
+
$orderId = $order->getId();
|
116 |
+
$numer_zamowienia = $order->getIncrementId();
|
117 |
+
$shipping = $order->getShippingAddress();
|
118 |
+
$kwota = number_format($order->getData('grand_total'),2,',','');
|
119 |
+
$name = $shipping->getFirstname();
|
120 |
+
$lastname = $shipping->getLastname();
|
121 |
+
|
122 |
+
$szablon = $this->getHelper()->szablonOdblokowanie();
|
123 |
+
$billingAddress = $order->getBillingAddress();
|
124 |
+
$numer = $billingAddress->getTelephone();
|
125 |
+
$numer = $this->getHelper()->korektaNumerow($numer);
|
126 |
+
$wysylka['odbiorcy'] = implode(",",$numer);
|
127 |
+
|
128 |
+
if($this->getHelper()->wlaczonySerwerSMS() and $this->getHelper()->powiadomienieWstrzymanie()){
|
129 |
+
|
130 |
+
$szablon = str_replace("#IMIE#",$name,$szablon);
|
131 |
+
$szablon = str_replace("#NAZWISKO#",$lastname, $szablon);
|
132 |
+
$szablon = str_replace("#NUMER#",$numer_zamowienia,$szablon);
|
133 |
+
$szablon = str_replace("#KWOTA#",$kwota,$szablon);
|
134 |
+
|
135 |
+
$wysylka['tresc'] = $szablon;
|
136 |
+
|
137 |
+
$this->getHelper()->wyslijSms($wysylka);
|
138 |
+
}
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
public function getHelper()
|
143 |
+
{
|
144 |
+
return Mage::helper('sms_helper/SerwerSMS');
|
145 |
+
}
|
146 |
+
}
|
147 |
+
?>
|
app/code/community/SerwerSMS/Sms/Model/OdpowiedziModel.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Model_OdpowiedziModel extends Mage_Core_Model_Abstract{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
parent::_construct();
|
13 |
+
$this->_init('serwersms_model/odpowiedziModel');
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
+
?>
|
app/code/community/SerwerSMS/Sms/Model/SmsModel.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Model_SmsModel extends Mage_Core_Model_Abstract{
|
10 |
+
|
11 |
+
public function _construct(){
|
12 |
+
parent::_construct();
|
13 |
+
$this->_init('serwersms_model/smsModel');
|
14 |
+
}
|
15 |
+
}
|
16 |
+
|
17 |
+
?>
|
app/code/community/SerwerSMS/Sms/controllers/Adminhtml/IndexController.php
ADDED
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action{
|
10 |
+
|
11 |
+
protected function _initAction(){
|
12 |
+
$this->loadLayout()->_setActiveMenu('sms/wyslane')
|
13 |
+
->_addBreadcrumb('sms Manager','sms Manager');
|
14 |
+
return $this;
|
15 |
+
}
|
16 |
+
|
17 |
+
public function indexAction(){
|
18 |
+
|
19 |
+
$this->_initAction();
|
20 |
+
$this->renderLayout();
|
21 |
+
}
|
22 |
+
|
23 |
+
public function niewyslaneAction(){
|
24 |
+
|
25 |
+
$this->loadLayout()->_setActiveMenu('sms/niewyslane')
|
26 |
+
->_addBreadcrumb('sms Manager','sms Manager');
|
27 |
+
$this->renderLayout();
|
28 |
+
}
|
29 |
+
|
30 |
+
public function odpowiedziAction(){
|
31 |
+
|
32 |
+
$this->loadLayout()->_setActiveMenu('sms/odpowiedzi')
|
33 |
+
->_addBreadcrumb('sms Manager','sms Manager');
|
34 |
+
$this->renderLayout();
|
35 |
+
}
|
36 |
+
|
37 |
+
public function danekontaAction(){
|
38 |
+
$this->loadLayout()->_setActiveMenu('sms/danekonta')
|
39 |
+
->_addBreadcrumb('sms Manager','sms Manager');
|
40 |
+
$this->renderLayout();
|
41 |
+
}
|
42 |
+
|
43 |
+
public function fakturyAction(){
|
44 |
+
$this->loadLayout()->_setActiveMenu('sms/faktury')
|
45 |
+
->_addBreadcrumb('sms Manager','sms Manager');
|
46 |
+
$this->renderLayout();
|
47 |
+
}
|
48 |
+
|
49 |
+
public function dodajnazweAction(){
|
50 |
+
$this->loadLayout()->_setActiveMenu('sms/danekonta')
|
51 |
+
->_addBreadcrumb('sms Manager','sms Manager');
|
52 |
+
$this->renderLayout();
|
53 |
+
}
|
54 |
+
|
55 |
+
public function wyslijsmsAction(){
|
56 |
+
$this->loadLayout()->_setActiveMenu('sms/wyslijsms')
|
57 |
+
->_addBreadcrumb('sms Manager','sms Manager');
|
58 |
+
$this->renderLayout();
|
59 |
+
}
|
60 |
+
|
61 |
+
public function savenazwaAction(){
|
62 |
+
|
63 |
+
if($this->getRequest()->getPost()){
|
64 |
+
|
65 |
+
if($this->getRequest()->getParam('nazwa') != ''){
|
66 |
+
|
67 |
+
$helper = Mage::helper('sms_helper/SerwerSMS');
|
68 |
+
$api['login'] = $helper->getApiLogin();
|
69 |
+
$api['haslo'] = $helper->getApiPassword();
|
70 |
+
|
71 |
+
$api['nazwa'] = $this->getRequest()->getParam('nazwa');
|
72 |
+
|
73 |
+
$xml = $helper->nazwa_nadawcy(array(login => $api['login'], haslo => $api['haslo'], operacja => "dodanie", nazwa => $api['nazwa']));
|
74 |
+
$dane = $helper->PrzetworzXML("nazwa_nadawcy",$xml);
|
75 |
+
|
76 |
+
foreach($dane as $nazwa => $status){
|
77 |
+
$nadawca = $nazwa;
|
78 |
+
$komunikat = $status;
|
79 |
+
}
|
80 |
+
|
81 |
+
if($status == "Dopisano"){
|
82 |
+
Mage::getSingleton('adminhtml/session')
|
83 |
+
->addSuccess('Zapisano dane');
|
84 |
+
} else {
|
85 |
+
Mage::getSingleton('adminhtml/session')
|
86 |
+
->addError('Błąd: '.$status);
|
87 |
+
}
|
88 |
+
|
89 |
+
} else {
|
90 |
+
Mage::getSingleton('adminhtml/session')
|
91 |
+
->addError('Błąd: Nie podano nazwy nadawcy');
|
92 |
+
}
|
93 |
+
|
94 |
+
} else {
|
95 |
+
Mage::getSingleton('adminhtml/session')
|
96 |
+
->addError('Błąd: Nie podano nazwy nadawcy');
|
97 |
+
}
|
98 |
+
$this->_redirect('*/*/danekonta');
|
99 |
+
}
|
100 |
+
|
101 |
+
public function wysylkaformAction(){
|
102 |
+
|
103 |
+
if($this->getRequest()->getPost()){
|
104 |
+
|
105 |
+
if($this->getRequest()->getParam('wiadomosc') != ''){
|
106 |
+
|
107 |
+
$helper = Mage::helper('sms_helper/SerwerSMS');
|
108 |
+
|
109 |
+
if($helper->wlaczonySerwerSMS()){
|
110 |
+
|
111 |
+
$typsms = $this->getRequest()->getParam('typ');
|
112 |
+
$odbiorca = $this->getRequest()->getParam('odbiorca');
|
113 |
+
|
114 |
+
$wysylka['nadawca'] = ($typsms) ? $this->getRequest()->getParam('nadawca') : '';
|
115 |
+
$wysylka['typsms'] = ($typsms) ? 'FULL' : 'ECO';
|
116 |
+
$wysylka['tresc'] = $this->getRequest()->getParam('wiadomosc');
|
117 |
+
|
118 |
+
switch($odbiorca){
|
119 |
+
case '0':
|
120 |
+
$numery = $this->getRequest()->getParam('numer_reczny');
|
121 |
+
break;
|
122 |
+
case '1':
|
123 |
+
$numery = $this->getRequest()->getParam('numer_lista');
|
124 |
+
break;
|
125 |
+
case '2':
|
126 |
+
$grupa_id = $this->getRequest()->getParam('numer_grupa');
|
127 |
+
|
128 |
+
$collection = Mage::getModel('customer/customer')
|
129 |
+
->getCollection()
|
130 |
+
->addAttributeToSelect('*')
|
131 |
+
->addAttributeToFilter('group_id',$grupa_id);
|
132 |
+
|
133 |
+
foreach($collection as $customer){
|
134 |
+
|
135 |
+
if($customer->getPrimaryBillingAddress()){
|
136 |
+
$numery[] = $customer->getPrimaryBillingAddress()->getTelephone();
|
137 |
+
}
|
138 |
+
}
|
139 |
+
break;
|
140 |
+
}
|
141 |
+
|
142 |
+
$numery = $helper->korektaNumerow($numery);
|
143 |
+
$liczba = count($numery);
|
144 |
+
|
145 |
+
if($liczba > 500){
|
146 |
+
$ile_paczek = ceil($liczba/500);
|
147 |
+
for($i=1;$i<=$ile_paczek;$i++){
|
148 |
+
$indeks_koncowy = $i*500;
|
149 |
+
$indeks_poczatkowy = $indeks_koncowy-500;
|
150 |
+
for($j=$indeks_poczatkowy;$j<$indeks_koncowy;$j++){
|
151 |
+
if(!empty($numery[$j])){
|
152 |
+
$paczka[$i][] = $numery[$j];
|
153 |
+
}
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
foreach($paczka as $key => $num){
|
158 |
+
$odbiorcy[$key] = implode(",",$num);
|
159 |
+
}
|
160 |
+
|
161 |
+
foreach($odbiorcy as $odb){
|
162 |
+
$wysylka['odbiorcy'] = $odb;
|
163 |
+
|
164 |
+
if(!empty($wysylka['odbiorcy'])){
|
165 |
+
|
166 |
+
if($helper->wyslijSms($wysylka)){
|
167 |
+
$blad = false;
|
168 |
+
} else {
|
169 |
+
$blad = true;
|
170 |
+
}
|
171 |
+
} else {
|
172 |
+
Mage::getSingleton('adminhtml/session')
|
173 |
+
->addError('Błąd: Brak numeru');
|
174 |
+
$blad = true;
|
175 |
+
}
|
176 |
+
}
|
177 |
+
} else {
|
178 |
+
$wysylka['odbiorcy'] = implode(",",$numery);
|
179 |
+
|
180 |
+
if(!empty($wysylka['odbiorcy'])){
|
181 |
+
|
182 |
+
if($helper->wyslijSms($wysylka)){
|
183 |
+
$blad = false;
|
184 |
+
} else {
|
185 |
+
$blad = true;
|
186 |
+
}
|
187 |
+
} else {
|
188 |
+
Mage::getSingleton('adminhtml/session')
|
189 |
+
->addError('Błąd: Brak numeru');
|
190 |
+
$blad = true;
|
191 |
+
}
|
192 |
+
}
|
193 |
+
|
194 |
+
if(!$blad){
|
195 |
+
Mage::getSingleton('adminhtml/session')
|
196 |
+
->addSuccess('Wiadomość została wysłana');
|
197 |
+
}
|
198 |
+
|
199 |
+
} else {
|
200 |
+
Mage::getSingleton('adminhtml/session')
|
201 |
+
->addError('Błąd: Moduł SerwerSMS jest wyłączony');
|
202 |
+
}
|
203 |
+
|
204 |
+
} else {
|
205 |
+
Mage::getSingleton('adminhtml/session')
|
206 |
+
->addError('Błąd: Nie wpisano treści wiadomości');
|
207 |
+
}
|
208 |
+
|
209 |
+
} else {
|
210 |
+
Mage::getSingleton('adminhtml/session')
|
211 |
+
->addError('Błąd: Brak danych');
|
212 |
+
}
|
213 |
+
$this->_redirect('*/*/wyslijsms');
|
214 |
+
}
|
215 |
+
|
216 |
+
public function podgladfakturyAction(){
|
217 |
+
|
218 |
+
if($this->getRequest()->getParam('faktura') != ''){
|
219 |
+
|
220 |
+
$helper = Mage::helper('sms_helper/SerwerSMS');
|
221 |
+
$api['login'] = $helper->getApiLogin();
|
222 |
+
$api['haslo'] = $helper->getApiPassword();
|
223 |
+
$api['faktura'] = $this->getRequest()->getParam('faktura');
|
224 |
+
|
225 |
+
header('Content-type: application/pdf');
|
226 |
+
echo $helper->faktury(array(login => $api['login'], haslo => $api['haslo'], faktura => $api['faktura']));
|
227 |
+
exit();
|
228 |
+
|
229 |
+
}
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
?>
|
app/code/community/SerwerSMS/Sms/controllers/OdpowiedziController.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_OdpowiedziController extends Mage_Core_Controller_Front_Action{
|
10 |
+
|
11 |
+
public function indexAction(){
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
public function odbierzAction(){
|
16 |
+
|
17 |
+
$numer = Mage::app()->getRequest()->getParam('numer');
|
18 |
+
$wiadomosc = Mage::app()->getRequest()->getParam('wiadomosc');
|
19 |
+
$data = Mage::app()->getRequest()->getParam('data');
|
20 |
+
|
21 |
+
if($numer and $wiadomosc and $data){
|
22 |
+
|
23 |
+
|
24 |
+
$data = array('data'=>$data, 'numer'=>$numer,'wiadomosc'=>$wiadomosc);
|
25 |
+
$model = Mage::getModel('serwersms_model/odpowiedziModel')->addData($data);
|
26 |
+
try {
|
27 |
+
$model->save();
|
28 |
+
echo "OK";
|
29 |
+
|
30 |
+
} catch (Exception $e){
|
31 |
+
echo $e->getMessage();
|
32 |
+
}
|
33 |
+
|
34 |
+
} else {
|
35 |
+
echo "ERROR";
|
36 |
+
}
|
37 |
+
|
38 |
+
}
|
39 |
+
}
|
40 |
+
?>
|
app/code/community/SerwerSMS/Sms/controllers/RaportController.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
class SerwerSMS_Sms_RaportController extends Mage_Core_Controller_Front_Action{
|
10 |
+
|
11 |
+
public function indexAction(){
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
public function odbierzAction(){
|
16 |
+
|
17 |
+
$smsid = Mage::app()->getRequest()->getParam('smsid');
|
18 |
+
$stan = Mage::app()->getRequest()->getParam('stan');
|
19 |
+
$data = Mage::app()->getRequest()->getParam('data');
|
20 |
+
|
21 |
+
if($smsid and $stan and $data){
|
22 |
+
|
23 |
+
$collection = Mage::getModel('serwersms_model/SmsModel')->getCollection();
|
24 |
+
$collection->addFieldToFilter('smsid', $smsid);
|
25 |
+
|
26 |
+
foreach($collection as $item){
|
27 |
+
$id = $item->getId();
|
28 |
+
}
|
29 |
+
|
30 |
+
$data = array('raport'=>$stan.' '.$data);
|
31 |
+
$model2 = Mage::getModel('serwersms_model/smsModel')->load($id)->addData($data);
|
32 |
+
try {
|
33 |
+
$model2->setId($id)->save();
|
34 |
+
echo "OK";
|
35 |
+
|
36 |
+
} catch (Exception $e){
|
37 |
+
echo $e->getMessage();
|
38 |
+
}
|
39 |
+
|
40 |
+
} else {
|
41 |
+
echo "ERROR";
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
45 |
+
}
|
46 |
+
?>
|
app/code/community/SerwerSMS/Sms/etc/config.xml
ADDED
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<SerwerSMS_Sms>
|
5 |
+
<version>1.0.0</version>
|
6 |
+
</SerwerSMS_Sms>
|
7 |
+
</modules>
|
8 |
+
|
9 |
+
<frontend>
|
10 |
+
|
11 |
+
<routers>
|
12 |
+
<routeurfrontend>
|
13 |
+
<use>standard</use>
|
14 |
+
<args>
|
15 |
+
<module>SerwerSMS_Sms</module>
|
16 |
+
<frontName>sms</frontName>
|
17 |
+
</args>
|
18 |
+
</routeurfrontend>
|
19 |
+
</routers>
|
20 |
+
|
21 |
+
</frontend>
|
22 |
+
|
23 |
+
<admin>
|
24 |
+
<routers>
|
25 |
+
<sms>
|
26 |
+
<use>admin</use>
|
27 |
+
<args>
|
28 |
+
<module>SerwerSMS_Sms</module>
|
29 |
+
<frontName>sms</frontName>
|
30 |
+
</args>
|
31 |
+
</sms>
|
32 |
+
</routers>
|
33 |
+
</admin>
|
34 |
+
|
35 |
+
<adminhtml>
|
36 |
+
<layout>
|
37 |
+
<updates>
|
38 |
+
<sms>
|
39 |
+
<file>serwersms/sms.xml</file>
|
40 |
+
</sms>
|
41 |
+
</updates>
|
42 |
+
</layout>
|
43 |
+
<menu>
|
44 |
+
<sms translate="title" module="adminhtml">
|
45 |
+
<title>SerwerSMS</title>
|
46 |
+
<sort_order>100</sort_order>
|
47 |
+
<children>
|
48 |
+
<wyslane>
|
49 |
+
<title>Wysłane wiadomości</title>
|
50 |
+
<action>sms/adminhtml_index/index</action>
|
51 |
+
<sort_order>100</sort_order>
|
52 |
+
</wyslane>
|
53 |
+
<niewyslane>
|
54 |
+
<title>Niewysłane wiadomości</title>
|
55 |
+
<action>sms/adminhtml_index/niewyslane</action>
|
56 |
+
<sort_order>200</sort_order>
|
57 |
+
</niewyslane>
|
58 |
+
<odpowiedzi>
|
59 |
+
<title>Odpowiedzi SMS</title>
|
60 |
+
<action>sms/adminhtml_index/odpowiedzi</action>
|
61 |
+
<sort_order>300</sort_order>
|
62 |
+
</odpowiedzi>
|
63 |
+
<wyslijsms>
|
64 |
+
<title>Wyślij SMS</title>
|
65 |
+
<action>sms/adminhtml_index/wyslijsms</action>
|
66 |
+
<sort_order>400</sort_order>
|
67 |
+
</wyslijsms>
|
68 |
+
<dane_konta>
|
69 |
+
<title>Dane konta</title>
|
70 |
+
<action>sms/adminhtml_index/danekonta</action>
|
71 |
+
<sort_order>500</sort_order>
|
72 |
+
</dane_konta>
|
73 |
+
<faktury>
|
74 |
+
<title>Faktury</title>
|
75 |
+
<action>sms/adminhtml_index/faktury</action>
|
76 |
+
<sort_order>600</sort_order>
|
77 |
+
</faktury>
|
78 |
+
<konfiguracja>
|
79 |
+
<title>Konfiguracja</title>
|
80 |
+
<action>adminhtml/system_config/edit/section/smsconfig_section</action>
|
81 |
+
<sort_order>700</sort_order>
|
82 |
+
</konfiguracja>
|
83 |
+
</children>
|
84 |
+
</sms>
|
85 |
+
</menu>
|
86 |
+
|
87 |
+
<acl>
|
88 |
+
<resources>
|
89 |
+
<admin>
|
90 |
+
<children>
|
91 |
+
<system>
|
92 |
+
<children>
|
93 |
+
<config>
|
94 |
+
<children>
|
95 |
+
<smsconfig_section translate="title">
|
96 |
+
<title>My Section</title>
|
97 |
+
<sort_order>100</sort_order>
|
98 |
+
</smsconfig_section>
|
99 |
+
</children>
|
100 |
+
</config>
|
101 |
+
</children>
|
102 |
+
</system>
|
103 |
+
</children>
|
104 |
+
</admin>
|
105 |
+
</resources>
|
106 |
+
</acl>
|
107 |
+
|
108 |
+
</adminhtml>
|
109 |
+
|
110 |
+
<global>
|
111 |
+
<blocks>
|
112 |
+
<sms>
|
113 |
+
<class>SerwerSMS_Sms_Block</class>
|
114 |
+
</sms>
|
115 |
+
</blocks>
|
116 |
+
|
117 |
+
<models>
|
118 |
+
<serwersms_model>
|
119 |
+
<class>SerwerSMS_Sms_Model</class>
|
120 |
+
<resourceModel>sms_mysql4</resourceModel>
|
121 |
+
</serwersms_model>
|
122 |
+
<sms_mysql4>
|
123 |
+
<class>SerwerSMS_Sms_Model_Mysql4</class>
|
124 |
+
<entities>
|
125 |
+
<SmsModel>
|
126 |
+
<table>serwersms_sms</table>
|
127 |
+
</SmsModel>
|
128 |
+
<OdpowiedziModel>
|
129 |
+
<table>serwersms_odpowiedzi</table>
|
130 |
+
</OdpowiedziModel>
|
131 |
+
</entities>
|
132 |
+
</sms_mysql4>
|
133 |
+
</models>
|
134 |
+
<resources>
|
135 |
+
<sms_setup>
|
136 |
+
<setup>
|
137 |
+
<module>SerwerSMS_Sms</module>
|
138 |
+
</setup>
|
139 |
+
<connection>
|
140 |
+
<use>core_setup</use>
|
141 |
+
</connection>
|
142 |
+
</sms_setup>
|
143 |
+
</resources>
|
144 |
+
<helpers>
|
145 |
+
<sms_helper>
|
146 |
+
<class>SerwerSMS_Sms_Helper</class>
|
147 |
+
</sms_helper>
|
148 |
+
</helpers>
|
149 |
+
|
150 |
+
<events>
|
151 |
+
<sales_order_save_after>
|
152 |
+
<observers>
|
153 |
+
<serwersms_model_Held>
|
154 |
+
<class>serwersms_model/Observer</class>
|
155 |
+
<method>wyslijsmsWstrzymanie</method>
|
156 |
+
</serwersms_model_Held>
|
157 |
+
<serwersms_model>
|
158 |
+
<class>serwersms_model/Observer</class>
|
159 |
+
<method>wyslijsmsOdblokowanie</method>
|
160 |
+
</serwersms_model>
|
161 |
+
</observers>
|
162 |
+
</sales_order_save_after>
|
163 |
+
<sales_order_shipment_save_after>
|
164 |
+
<observers>
|
165 |
+
<serwersms_model>
|
166 |
+
<class>serwersms_model/Observer</class>
|
167 |
+
<method>wyslijsmsWysylka</method>
|
168 |
+
</serwersms_model>
|
169 |
+
</observers>
|
170 |
+
</sales_order_shipment_save_after>
|
171 |
+
<checkout_type_onepage_save_order_after>
|
172 |
+
<observers>
|
173 |
+
<serwersms_model>
|
174 |
+
<class>serwersms_model/Observer</class>
|
175 |
+
<method>wyslijsmsZamowienie</method>
|
176 |
+
</serwersms_model>
|
177 |
+
</observers>
|
178 |
+
</checkout_type_onepage_save_order_after>
|
179 |
+
|
180 |
+
</events>
|
181 |
+
</global>
|
182 |
+
<default>
|
183 |
+
<smsconfig_section>
|
184 |
+
<tekstysms>
|
185 |
+
<tekst_zamowienie>Nowe zamówienie od #IMIE# #NAZWISKO#, kwota: #KWOTA# PLN, numer: #NUMER#</tekst_zamowienie>
|
186 |
+
<tekst_realizacja>#IMIE#, Twoje zamówienie nr: #NUMER# zostało zrealizowne i wysłane na adres: #IMIE# #NAZWISKO#, #ADRES#</tekst_realizacja>
|
187 |
+
<tekst_wstrzymanie>#IMIE#, Twoje zamówienie nr: #NUMER#, na kwotę: #KWOTA# PLN zostało wstrzymane</tekst_wstrzymanie>
|
188 |
+
<tekst_odblokowanie>#IMIE#, Twoje zamówienie nr: #NUMER#, na kwotę: #KWOTA# PLN zostało odblokowane</tekst_odblokowanie>
|
189 |
+
</tekstysms>
|
190 |
+
</smsconfig_section>
|
191 |
+
</default>
|
192 |
+
|
193 |
+
</config>
|
app/code/community/SerwerSMS/Sms/etc/system.xml
ADDED
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<smsconfig_tab translate="label">
|
5 |
+
<label>SMS</label>
|
6 |
+
<sort_order>500</sort_order>
|
7 |
+
</smsconfig_tab>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<smsconfig_section translate="label">
|
11 |
+
<label>Serwer SMS</label>
|
12 |
+
<sort_order>200</sort_order>
|
13 |
+
<show_in_default>1</show_in_default>
|
14 |
+
<show_in_website>1</show_in_website>
|
15 |
+
<show_in_store>1</show_in_store>
|
16 |
+
<tab>smsconfig_tab</tab>
|
17 |
+
<groups>
|
18 |
+
<konfiguracjasms translate="label">
|
19 |
+
<label>Konfiguracja modułu</label>
|
20 |
+
<comment>
|
21 |
+
Aby sprawdzić czy podany login i hasło są właściwe, zapisz konfigurację i przejdź do zakładki Dane konta w menu SerwerSMS.
|
22 |
+
</comment>
|
23 |
+
<sort_order>10</sort_order>
|
24 |
+
<show_in_default>1</show_in_default>
|
25 |
+
<show_in_website>1</show_in_website>
|
26 |
+
<show_in_store>1</show_in_store>
|
27 |
+
<fields>
|
28 |
+
<wlaczony translate="label comment">
|
29 |
+
<label>Moduł włączony</label>
|
30 |
+
<comment></comment>
|
31 |
+
<show_in_default>1</show_in_default>
|
32 |
+
<show_in_website>1</show_in_website>
|
33 |
+
<show_in_store>1</show_in_store>
|
34 |
+
<frontend_type>select</frontend_type>
|
35 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
36 |
+
<sort_order>10</sort_order>
|
37 |
+
</wlaczony>
|
38 |
+
<uzytkownik translate="label comment">
|
39 |
+
<label>Nazwa użytkownika</label>
|
40 |
+
<comment>login w SerwerSMS.pl</comment>
|
41 |
+
<show_in_default>1</show_in_default>
|
42 |
+
<show_in_website>1</show_in_website>
|
43 |
+
<show_in_store>1</show_in_store>
|
44 |
+
<frontend_input>text</frontend_input>
|
45 |
+
<sort_order>20</sort_order>
|
46 |
+
</uzytkownik>
|
47 |
+
<haslo translate="label comment">
|
48 |
+
<label>Hasło</label>
|
49 |
+
<comment></comment>
|
50 |
+
<show_in_default>1</show_in_default>
|
51 |
+
<show_in_website>1</show_in_website>
|
52 |
+
<show_in_store>1</show_in_store>
|
53 |
+
<frontend_type>password</frontend_type>
|
54 |
+
<sort_order>30</sort_order>
|
55 |
+
</haslo>
|
56 |
+
<numery_admin translate="label comment">
|
57 |
+
<label>Numery administratora</label>
|
58 |
+
<comment>np. 500600700,600700800</comment>
|
59 |
+
<show_in_default>1</show_in_default>
|
60 |
+
<show_in_website>1</show_in_website>
|
61 |
+
<show_in_store>1</show_in_store>
|
62 |
+
<frontend_input>text</frontend_input>
|
63 |
+
<sort_order>40</sort_order>
|
64 |
+
</numery_admin>
|
65 |
+
</fields>
|
66 |
+
</konfiguracjasms>
|
67 |
+
<ustawieniawiadomosci>
|
68 |
+
<label>Ustawienia wiadomości</label>
|
69 |
+
<comment>
|
70 |
+
Aby ustawić nazwę nadawcy należy wcześniej zapisać konfigurację z prawidłowym loginem oraz hasłem do serwisu www.serwersms.pl.
|
71 |
+
Jeśli chcesz dodać nową nazwę przejdź do zakładki Dane konta w menu SerwerSMS.
|
72 |
+
</comment>
|
73 |
+
<sort_order>10</sort_order>
|
74 |
+
<show_in_default>1</show_in_default>
|
75 |
+
<show_in_website>1</show_in_website>
|
76 |
+
<show_in_store>1</show_in_store>
|
77 |
+
<fields>
|
78 |
+
<typsms translate="label comment">
|
79 |
+
<label>SMS FULL</label>
|
80 |
+
<comment>wiadomości z własną nazwą nadawcy</comment>
|
81 |
+
<show_in_default>1</show_in_default>
|
82 |
+
<show_in_website>1</show_in_website>
|
83 |
+
<show_in_store>1</show_in_store>
|
84 |
+
<frontend_type>select</frontend_type>
|
85 |
+
<source_model>adminhtml/system_config_source_enabledisable</source_model>
|
86 |
+
<sort_order>10</sort_order>
|
87 |
+
</typsms>
|
88 |
+
<nadawca translate="label comment">
|
89 |
+
<label>Nazwa nadawcy</label>
|
90 |
+
<comment>dotyczy tylko wiadomości FULL</comment>
|
91 |
+
<show_in_default>1</show_in_default>
|
92 |
+
<show_in_website>1</show_in_website>
|
93 |
+
<show_in_store>1</show_in_store>
|
94 |
+
<frontend_type>select</frontend_type>
|
95 |
+
<source_model>serwersms_model/nadawcy</source_model>
|
96 |
+
<sort_order>20</sort_order>
|
97 |
+
</nadawca>
|
98 |
+
</fields>
|
99 |
+
</ustawieniawiadomosci>
|
100 |
+
<powiadomienia>
|
101 |
+
<label>Powiadomienia</label>
|
102 |
+
<sort_order>20</sort_order>
|
103 |
+
<show_in_default>1</show_in_default>
|
104 |
+
<show_in_website>1</show_in_website>
|
105 |
+
<show_in_store>1</show_in_store>
|
106 |
+
<fields>
|
107 |
+
<zamowienie translate="label comment">
|
108 |
+
<label>Nowe zamówienie</label>
|
109 |
+
<comment></comment>
|
110 |
+
<show_in_default>1</show_in_default>
|
111 |
+
<show_in_website>1</show_in_website>
|
112 |
+
<show_in_store>1</show_in_store>
|
113 |
+
<frontend_type>select</frontend_type>
|
114 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
115 |
+
<sort_order>10</sort_order>
|
116 |
+
</zamowienie>
|
117 |
+
<realizacja translate="label comment">
|
118 |
+
<label>Zamówienie zrealizowane</label>
|
119 |
+
<comment></comment>
|
120 |
+
<show_in_default>1</show_in_default>
|
121 |
+
<show_in_website>1</show_in_website>
|
122 |
+
<show_in_store>1</show_in_store>
|
123 |
+
<frontend_type>select</frontend_type>
|
124 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
125 |
+
<sort_order>20</sort_order>
|
126 |
+
</realizacja>
|
127 |
+
<wstrzymanie translate="label comment">
|
128 |
+
<label>Wstrzymanie/odblokowanie zamówienia</label>
|
129 |
+
<comment></comment>
|
130 |
+
<show_in_default>1</show_in_default>
|
131 |
+
<show_in_website>1</show_in_website>
|
132 |
+
<show_in_store>1</show_in_store>
|
133 |
+
<frontend_type>select</frontend_type>
|
134 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
135 |
+
<sort_order>30</sort_order>
|
136 |
+
</wstrzymanie>
|
137 |
+
<stan_konta translate="label comment">
|
138 |
+
<label>Niski stan konta SMS</label>
|
139 |
+
<comment></comment>
|
140 |
+
<show_in_default>1</show_in_default>
|
141 |
+
<show_in_website>1</show_in_website>
|
142 |
+
<show_in_store>1</show_in_store>
|
143 |
+
<frontend_type>select</frontend_type>
|
144 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
145 |
+
<sort_order>40</sort_order>
|
146 |
+
</stan_konta>
|
147 |
+
</fields>
|
148 |
+
</powiadomienia>
|
149 |
+
<tekstysms>
|
150 |
+
<label>Treści wysyłanych wiadomości</label>
|
151 |
+
<sort_order>30</sort_order>
|
152 |
+
<show_in_default>1</show_in_default>
|
153 |
+
<show_in_website>1</show_in_website>
|
154 |
+
<show_in_store>1</show_in_store>
|
155 |
+
<fields>
|
156 |
+
<tekst_zamowienie translate="label comment">
|
157 |
+
<label>Nowe zamówienie</label>
|
158 |
+
<frontend_type>textarea</frontend_type>
|
159 |
+
<sort_order>10</sort_order>
|
160 |
+
<show_in_default>1</show_in_default>
|
161 |
+
<show_in_website>1</show_in_website>
|
162 |
+
<show_in_store>1</show_in_store>
|
163 |
+
<comment>Szablon do 160 znaków.</comment>
|
164 |
+
</tekst_zamowienie>
|
165 |
+
<tekst_realizacja translate="label comment">
|
166 |
+
<label>Zamówienie zrealizowane</label>
|
167 |
+
<frontend_type>textarea</frontend_type>
|
168 |
+
<sort_order>20</sort_order>
|
169 |
+
<show_in_default>1</show_in_default>
|
170 |
+
<show_in_website>1</show_in_website>
|
171 |
+
<show_in_store>1</show_in_store>
|
172 |
+
<comment>Szablon do 160 znaków.</comment>
|
173 |
+
</tekst_realizacja>
|
174 |
+
<tekst_wstrzymanie translate="label comment">
|
175 |
+
<label>Zamówienie wstrzymane</label>
|
176 |
+
<frontend_type>textarea</frontend_type>
|
177 |
+
<sort_order>30</sort_order>
|
178 |
+
<show_in_default>1</show_in_default>
|
179 |
+
<show_in_website>1</show_in_website>
|
180 |
+
<show_in_store>1</show_in_store>
|
181 |
+
<comment>Szablon do 160 znaków.</comment>
|
182 |
+
</tekst_wstrzymanie>
|
183 |
+
<tekst_odblokowanie translate="label comment">
|
184 |
+
<label>Zamówienie odblokowane</label>
|
185 |
+
<frontend_type>textarea</frontend_type>
|
186 |
+
<sort_order>40</sort_order>
|
187 |
+
<show_in_default>1</show_in_default>
|
188 |
+
<show_in_website>1</show_in_website>
|
189 |
+
<show_in_store>1</show_in_store>
|
190 |
+
<comment>Szablon do 160 znaków.</comment>
|
191 |
+
</tekst_odblokowanie>
|
192 |
+
</fields>
|
193 |
+
</tekstysms>
|
194 |
+
</groups>
|
195 |
+
</smsconfig_section>
|
196 |
+
</sections>
|
197 |
+
</config>
|
app/code/community/SerwerSMS/Sms/sql/sms_setup/mysql4-install-1.0.0.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @copyright Copyright (c) 2012-2013 SerwerSMS.pl
|
5 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
6 |
+
* @author Serwer SMS (http://www.serwersms.pl)
|
7 |
+
*/
|
8 |
+
|
9 |
+
$installer = $this;
|
10 |
+
|
11 |
+
$installer->startSetup();
|
12 |
+
|
13 |
+
$installer->run("
|
14 |
+
|
15 |
+
-- DROP TABLE IF EXISTS {$this->getTable('serwersms_sms')};
|
16 |
+
CREATE TABLE {$this->getTable('serwersms_sms')} (
|
17 |
+
`id` int(11) unsigned NOT NULL auto_increment,
|
18 |
+
`data` DATETIME NOT NULL,
|
19 |
+
`smsid` VARCHAR(20) NOT NULL,
|
20 |
+
`numer` VARCHAR(40) NOT NULL,
|
21 |
+
`nadawca` VARCHAR(40) NOT NULL,
|
22 |
+
`typ` VARCHAR(5) NOT NULL,
|
23 |
+
`status` VARCHAR(20) NOT NULL,
|
24 |
+
`raport` VARCHAR(50) NOT NULL,
|
25 |
+
`tresc` TEXT NOT NULL,
|
26 |
+
`powod` VARCHAR(255) NOT NULL,
|
27 |
+
PRIMARY KEY (`id`)
|
28 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
29 |
+
|
30 |
+
-- DROP TABLE IF EXISTS {$this->getTable('serwersms_odpowiedzi')};
|
31 |
+
CREATE TABLE {$this->getTable('serwersms_odpowiedzi')} (
|
32 |
+
`id_odp` int(11) unsigned NOT NULL auto_increment,
|
33 |
+
`data` DATETIME NOT NULL,
|
34 |
+
`numer` VARCHAR(20) NOT NULL,
|
35 |
+
`wiadomosc` TEXT NOT NULL,
|
36 |
+
PRIMARY KEY (`id_odp`)
|
37 |
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
38 |
+
|
39 |
+
");
|
40 |
+
|
41 |
+
$installer->endSetup();
|
app/design/adminhtml/default/default/layout/serwersms/sms.xml
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
<sms_adminhtml_index_index>
|
4 |
+
<reference name="content">
|
5 |
+
<block type="sms/adminhtml_wyslaneGrid" name="wyslane">
|
6 |
+
<action method="removeButton">
|
7 |
+
<param>add</param>
|
8 |
+
</action>
|
9 |
+
</block>
|
10 |
+
</reference>
|
11 |
+
</sms_adminhtml_index_index>
|
12 |
+
<sms_adminhtml_index_niewyslane>
|
13 |
+
<reference name="content">
|
14 |
+
<block type="sms/adminhtml_niewyslaneGrid" name="niewyslane">
|
15 |
+
<action method="removeButton">
|
16 |
+
<param>add</param>
|
17 |
+
</action>
|
18 |
+
</block>
|
19 |
+
</reference>
|
20 |
+
</sms_adminhtml_index_niewyslane>
|
21 |
+
<sms_adminhtml_index_odpowiedzi>
|
22 |
+
<reference name="content">
|
23 |
+
<block type="sms/adminhtml_odpowiedziGrid" name="odpowiedzi">
|
24 |
+
<action method="removeButton">
|
25 |
+
<param>add</param>
|
26 |
+
</action>
|
27 |
+
</block>
|
28 |
+
</reference>
|
29 |
+
</sms_adminhtml_index_odpowiedzi>
|
30 |
+
<sms_adminhtml_index_danekonta>
|
31 |
+
<reference name="content">
|
32 |
+
<block type="sms/danekonta" name="danekonta_danekonta" template="serwersms/danekonta.phtml" />
|
33 |
+
</reference>
|
34 |
+
</sms_adminhtml_index_danekonta>
|
35 |
+
<sms_adminhtml_index_faktury>
|
36 |
+
<reference name="content">
|
37 |
+
<block type="sms/danekonta" name="faktury_danekonta" template="serwersms/faktury.phtml" />
|
38 |
+
</reference>
|
39 |
+
</sms_adminhtml_index_faktury>
|
40 |
+
<sms_adminhtml_index_dodajnazwe>
|
41 |
+
<reference name="content">
|
42 |
+
<block type="sms/danekonta" name="dodajnazwe_danekonta" template="serwersms/dodajnazwe.phtml" />
|
43 |
+
</reference>
|
44 |
+
</sms_adminhtml_index_dodajnazwe>
|
45 |
+
<sms_adminhtml_index_wyslijsms>
|
46 |
+
<reference name="content">
|
47 |
+
<block type="sms/wyslijsms" name="formularzsms_wyslijsms" template="serwersms/formularzsms.phtml" />
|
48 |
+
</reference>
|
49 |
+
</sms_adminhtml_index_wyslijsms>
|
50 |
+
</layout>
|
app/design/adminhtml/default/default/template/serwersms/danekonta.phtml
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$dane = $this->pokazDaneKonta();
|
3 |
+
?>
|
4 |
+
<style>
|
5 |
+
.ramka_serwersms{
|
6 |
+
border: 1px solid #e02124;
|
7 |
+
}
|
8 |
+
|
9 |
+
.ramka_serwersms td{
|
10 |
+
padding-left: 10px; padding-right: 10px;
|
11 |
+
}
|
12 |
+
|
13 |
+
.ramka_serwersms a{
|
14 |
+
color: #e02124;
|
15 |
+
}
|
16 |
+
|
17 |
+
.naglowek_serwersms{
|
18 |
+
background: #e02124; padding: 10px 10px; color: #fff; font-weight: bold;
|
19 |
+
}
|
20 |
+
.text-right{
|
21 |
+
text-align: right;
|
22 |
+
}
|
23 |
+
</style>
|
24 |
+
<div class="content-header">
|
25 |
+
<table cellspacing="0">
|
26 |
+
<tbody><tr>
|
27 |
+
<td><h3 class="icon-head head-adminhtml-wyslane">Dane konta</h3></td>
|
28 |
+
</tr>
|
29 |
+
</tbody></table>
|
30 |
+
</div>
|
31 |
+
<table class="ramka_serwersms">
|
32 |
+
<tr>
|
33 |
+
<td colspan="3" class="naglowek_serwersms">
|
34 |
+
<img src="<?php echo $this->getSkinUrl('serwersms/serwersms.png') ?>" />
|
35 |
+
</td>
|
36 |
+
</tr>
|
37 |
+
<?php if(is_array($dane)) {
|
38 |
+
if($dane['konto'] == 'PREPAID') $doladuj = '<a href="https://www.serwersms.pl/o,36-Zamow_pakiet_Pre_Paid.html">Doładuj swoje konto</a> | ';
|
39 |
+
else $doladuj = '';
|
40 |
+
?>
|
41 |
+
<tr>
|
42 |
+
<td><strong>Typ konta:</strong></td><td><?php echo $dane['konto']; ?></td><td><?php echo $doladuj; ?><a href="http://www.serwersms.pl/k,19-Cennik.html">Cennik</a></td>
|
43 |
+
</tr>
|
44 |
+
<tr>
|
45 |
+
<td><strong>Stan konta:</strong></td><td></td><td></td>
|
46 |
+
</tr>
|
47 |
+
<tr>
|
48 |
+
<td></td><td>SMS ECO:</td><td width="50%"><?php echo $dane['ECO']; ?></td>
|
49 |
+
</tr>
|
50 |
+
<tr>
|
51 |
+
<td></td><td>SMS FULL:</td><td><?php echo $dane['FULL']; ?></td>
|
52 |
+
</tr>
|
53 |
+
<tr>
|
54 |
+
<td><strong>Limit znaków:</strong></td><td></td><td></td>
|
55 |
+
</tr>
|
56 |
+
<tr>
|
57 |
+
<td></td><td>SMS ECO:</td><td width="50%"><?php echo $dane['ECOlimit']; ?></td>
|
58 |
+
</tr>
|
59 |
+
<tr>
|
60 |
+
<td></td><td>SMS FULL:</td><td><?php echo $dane['FULLlimit']; ?></td>
|
61 |
+
</tr>
|
62 |
+
<tr>
|
63 |
+
<td><strong>Nazwy nadawcy:</strong><br>
|
64 |
+
<?php $key = Mage::getSingleton('adminhtml/url')->getSecretKey("adminhtml_index","dodajnazwe"); ?>
|
65 |
+
(<a href="<?php echo Mage::helper("adminhtml")->getUrl("sms/adminhtml_index/dodajnazwe/",array("key" => $key)); ?>">Dodaj nową nazwę</a>)</td>
|
66 |
+
<td></td><td></td>
|
67 |
+
</tr>
|
68 |
+
<?php
|
69 |
+
foreach($dane['nadawcy'] as $nazwa => $status){
|
70 |
+
echo '
|
71 |
+
<tr>
|
72 |
+
<td></td><td>'.$nazwa.'</td><td>'.$status.'</td>
|
73 |
+
</tr>
|
74 |
+
';
|
75 |
+
}
|
76 |
+
?>
|
77 |
+
<tr>
|
78 |
+
<td colspan="3" class="naglowek_serwersms">
|
79 |
+
Dane kontaktowe:
|
80 |
+
</td>
|
81 |
+
</tr>
|
82 |
+
<tr>
|
83 |
+
<td><strong>Telefon:</strong></td><td><?php echo $dane['pomoc']['telefon']; ?></td>
|
84 |
+
<td rowspan="5">
|
85 |
+
|
86 |
+
<table>
|
87 |
+
<tr><td colspan="2"><strong>Opiekun Twojego konta:</td></tr>
|
88 |
+
<tr><td rowspan="3"><img src="<?php echo $dane['pomoc']['foto']; ?>" width="70" /></td><td><?php echo $dane['pomoc']['opiekun']; ?></td></tr>
|
89 |
+
<tr><td><?php echo $dane['pomoc']['op_telefon']; ?></td></tr>
|
90 |
+
<tr><td><a href="mailto:<?php echo $dane['pomoc']['op_email']; ?>"><?php echo $dane['pomoc']['op_email']; ?></a></td></tr>
|
91 |
+
</table>
|
92 |
+
|
93 |
+
</td>
|
94 |
+
</tr>
|
95 |
+
<tr>
|
96 |
+
<td><strong>Infolinia:</strong></td><td><?php echo $dane['pomoc']['infolinia']; ?></td>
|
97 |
+
</tr>
|
98 |
+
<tr>
|
99 |
+
<td><strong>E-mail:</strong></td><td><a href="mailto:<?php echo $dane['pomoc']['email']; ?>"><?php echo $dane['pomoc']['email']; ?></a></td>
|
100 |
+
</tr>
|
101 |
+
<tr>
|
102 |
+
<td></td><td><a href="<?php echo $dane['pomoc']['formularz']; ?>">Formularz kontaktowy</a></td>
|
103 |
+
</tr>
|
104 |
+
<tr>
|
105 |
+
<td></td><td><a href="<?php echo $dane['pomoc']['faq']; ?>">FAQ</a></td>
|
106 |
+
</tr>
|
107 |
+
<?php } else { ?>
|
108 |
+
<tr>
|
109 |
+
<td colspan="3">
|
110 |
+
<?php
|
111 |
+
if($dane == 'blad logowania: nieprawidlowy login lub haslo' or $dane == ''){
|
112 |
+
echo Mage::helper('sms_helper/SerwerSMS')->niezalogowanyWidok();
|
113 |
+
} else {
|
114 |
+
echo '<strong>'.$dane.'</strong>';
|
115 |
+
}
|
116 |
+
?>
|
117 |
+
</td>
|
118 |
+
</tr>
|
119 |
+
<?php } ?>
|
120 |
+
|
121 |
+
</table>
|
app/design/adminhtml/default/default/template/serwersms/dodajnazwe.phtml
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style>
|
2 |
+
.ramka_serwersms{
|
3 |
+
border: 1px solid #e02124;
|
4 |
+
}
|
5 |
+
|
6 |
+
.ramka_serwersms td{
|
7 |
+
padding-left: 10px; padding-right: 10px;
|
8 |
+
}
|
9 |
+
|
10 |
+
.ramka_serwersms a{
|
11 |
+
color: #e02124;
|
12 |
+
}
|
13 |
+
|
14 |
+
.naglowek_serwersms{
|
15 |
+
background: #e02124; padding: 10px 10px;
|
16 |
+
}
|
17 |
+
.text-right{
|
18 |
+
text-align: right;
|
19 |
+
}
|
20 |
+
.serwersms_info{
|
21 |
+
font-size: 11px;
|
22 |
+
color: #333;
|
23 |
+
}
|
24 |
+
</style>
|
25 |
+
<div class="content-header">
|
26 |
+
<table cellspacing="0">
|
27 |
+
<tbody><tr>
|
28 |
+
<td><h3 class="icon-head head-adminhtml-wyslane">Dodaj nazwę nadawcy</h3></td>
|
29 |
+
</tr>
|
30 |
+
</tbody></table>
|
31 |
+
</div>
|
32 |
+
<form action="<?php echo Mage::getUrl('sms/adminhtml_index/savenazwa'); ?>" method="post">
|
33 |
+
<fieldset>
|
34 |
+
<table class="ramka_serwersms">
|
35 |
+
<tr>
|
36 |
+
<td colspan="2" class="naglowek_serwersms">
|
37 |
+
<img src="<?php echo $this->getSkinUrl('serwersms/serwersms.png') ?>" />
|
38 |
+
</td>
|
39 |
+
</tr>
|
40 |
+
<tr><td colspan="2"> </td></tr>
|
41 |
+
<tr>
|
42 |
+
<td><label for="nazwa">Nowa nazwa nadawcy (max 11 znaków):</label></td>
|
43 |
+
<td><input type="text" id="nazwa" name="nazwa" /></td>
|
44 |
+
</tr>
|
45 |
+
<tr>
|
46 |
+
<td></td>
|
47 |
+
<td>
|
48 |
+
<input type="submit" value="Dodaj nazwę" />
|
49 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
50 |
+
</td>
|
51 |
+
</tr>
|
52 |
+
<tr><td colspan="2" class="serwersms_info">Ograniczenia:<br><br>
|
53 |
+
|
54 |
+
Nazwa nie może być numerem 9-cio cyfrowym (np. 500600700)<br>
|
55 |
+
Nazwa nie może być numerem skróconym (np. 71200)<br>
|
56 |
+
Nazwa może zawierać znaki z zakresu a-z, A-Z, 0-9 oraz dodatkowo znaki specjalne jak: spacja, kropka, myślnik<br>
|
57 |
+
Nazwa nie może zawierać 4 lub więcej cyfr w ciągu (np. Test2011)
|
58 |
+
</td></tr>
|
59 |
+
</table>
|
60 |
+
</fieldset>
|
61 |
+
</form>
|
app/design/adminhtml/default/default/template/serwersms/faktury.phtml
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style>
|
2 |
+
.ramka_serwersms{
|
3 |
+
border: 1px solid #e02124;
|
4 |
+
}
|
5 |
+
|
6 |
+
.ramka_serwersms td{
|
7 |
+
padding-left: 10px; padding-right: 10px;
|
8 |
+
}
|
9 |
+
|
10 |
+
.ramka_serwersms a{
|
11 |
+
color: #e02124;
|
12 |
+
}
|
13 |
+
|
14 |
+
.naglowek_serwersms{
|
15 |
+
background: #e02124; padding: 10px 10px; color: #fff;
|
16 |
+
}
|
17 |
+
|
18 |
+
.naglowek_serwersms a{
|
19 |
+
color: #fff;
|
20 |
+
}
|
21 |
+
.text-right{
|
22 |
+
text-align: right;
|
23 |
+
}
|
24 |
+
.serwersms_info{
|
25 |
+
font-size: 11px;
|
26 |
+
color: #333;
|
27 |
+
}
|
28 |
+
</style>
|
29 |
+
<?php
|
30 |
+
$dane = $this->pokazFaktury();
|
31 |
+
?>
|
32 |
+
<div class="content-header">
|
33 |
+
<table cellspacing="0">
|
34 |
+
<tbody><tr>
|
35 |
+
<td><h3 class="icon-head head-adminhtml-wyslane">Faktury</h3></td>
|
36 |
+
</tr>
|
37 |
+
</tbody></table>
|
38 |
+
</div>
|
39 |
+
<table class="ramka_serwersms">
|
40 |
+
<tr>
|
41 |
+
<td colspan="5" class="naglowek_serwersms">
|
42 |
+
<img src="<?php echo $this->getSkinUrl('serwersms/serwersms.png') ?>" />
|
43 |
+
</td>
|
44 |
+
</tr>
|
45 |
+
<?php
|
46 |
+
|
47 |
+
if(is_array($dane)){
|
48 |
+
echo '<tr><td><strong>Numer</strong></td><td><strong>Rozliczono</strong></td><td><strong>Kwota</strong></td><td><strong>Termin</strong></td><td><strong>Podgląd</strong></td></tr>';
|
49 |
+
/*
|
50 |
+
* Paginator
|
51 |
+
*/
|
52 |
+
$liczba_rekordow = count($dane);
|
53 |
+
$liczba_na_stronie = 20;
|
54 |
+
$liczba_stron = ceil($liczba_rekordow/$liczba_na_stronie);
|
55 |
+
|
56 |
+
if($this->getRequest()->getParam('strona')){
|
57 |
+
$aktywna_strona = $this->getRequest()->getParam('strona');
|
58 |
+
} else {
|
59 |
+
$aktywna_strona = 1;
|
60 |
+
}
|
61 |
+
|
62 |
+
$indeks_koncowy = $aktywna_strona*$liczba_na_stronie;
|
63 |
+
$indeks_poczatkowy = $indeks_koncowy-$liczba_na_stronie;
|
64 |
+
|
65 |
+
for($i=$indeks_poczatkowy;$i<$indeks_koncowy;$i++){
|
66 |
+
if(!empty($dane[$i])){
|
67 |
+
$tablica[] = $dane[$i];
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
$key_pag = Mage::getSingleton('adminhtml/url')->getSecretKey("adminhtml_index","faktury");
|
72 |
+
|
73 |
+
for($i=1;$i<=$liczba_stron;$i++){
|
74 |
+
$link = Mage::helper("adminhtml")->getUrl("sms/adminhtml_index/faktury/",array("strona" => $i, "key" => $key_pag));
|
75 |
+
if($i == $aktywna_strona){
|
76 |
+
$wszystkie_strony[$i] = $i;
|
77 |
+
} else {
|
78 |
+
$wszystkie_strony[$i] = '<a href="'.$link.'">'.$i.'</a>';
|
79 |
+
}
|
80 |
+
}
|
81 |
+
$poczatek = Mage::helper("adminhtml")->getUrl("sms/adminhtml_index/faktury/",array("strona" => 1, "key" => $key_pag));
|
82 |
+
$koniec = Mage::helper("adminhtml")->getUrl("sms/adminhtml_index/faktury/",array("strona" => $liczba_stron, "key" => $key_pag));
|
83 |
+
|
84 |
+
if($liczba_stron<=11){
|
85 |
+
foreach($wszystkie_strony as $strona){
|
86 |
+
$paginator[] = $strona;
|
87 |
+
}
|
88 |
+
} elseif($aktywna_strona<=6){
|
89 |
+
for($i=1;$i<=11;$i++){
|
90 |
+
$paginator[] = $wszystkie_strony[$i];
|
91 |
+
}
|
92 |
+
$paginator[] = '<a href="'.$koniec.'">'.$liczba_stron.' >></a>';
|
93 |
+
} elseif($aktywna_strona >= $liczba_stron-5){
|
94 |
+
$paginator[] = '<a href="'.$poczatek.'"><< 1</a>';
|
95 |
+
for($i=$liczba_stron-10;$i<=$liczba_stron;$i++){
|
96 |
+
$paginator[] = $wszystkie_strony[$i];
|
97 |
+
}
|
98 |
+
} else {
|
99 |
+
$paginator[] = '<a href="'.$poczatek.'"><< 1</a>';
|
100 |
+
for($i=$aktywna_strona-5;$i<=$aktywna_strona+5;$i++){
|
101 |
+
$paginator[] = $wszystkie_strony[$i];
|
102 |
+
}
|
103 |
+
$paginator[] = '<a href="'.$koniec.'">'.$liczba_stron.' >></a>';
|
104 |
+
}
|
105 |
+
|
106 |
+
$paginator = implode(" | ",$paginator);
|
107 |
+
/*
|
108 |
+
* Paginator END
|
109 |
+
*/
|
110 |
+
|
111 |
+
$key = Mage::getSingleton('adminhtml/url')->getSecretKey("adminhtml_index","podgladfaktury");
|
112 |
+
foreach($tablica as $pole){
|
113 |
+
$link = Mage::helper("adminhtml")->getUrl("sms/adminhtml_index/podgladfaktury/",array("faktura" => $pole['id'], "key" => $key));
|
114 |
+
echo '
|
115 |
+
<tr>
|
116 |
+
<td>'.$pole['numer'].'</td><td>'.$pole['rozliczono'].'</td><td>'.$pole['kwota'].'</td><td>'.$pole['termin'].'</td><td><a href="'.$link.'">podgląd</a></td>
|
117 |
+
</tr>
|
118 |
+
';
|
119 |
+
}
|
120 |
+
echo '<tr><td colspan="5" align="center" class="naglowek_serwersms">'.$paginator.'</td></tr>';
|
121 |
+
} else {
|
122 |
+
echo '<tr><td colspan="5">';
|
123 |
+
|
124 |
+
if($dane == 'blad logowania: nieprawidlowy login lub haslo' or $dane == ''){
|
125 |
+
echo Mage::helper('sms_helper/SerwerSMS')->niezalogowanyWidok();
|
126 |
+
} else {
|
127 |
+
echo '<strong>'.$dane.'</strong>';
|
128 |
+
}
|
129 |
+
|
130 |
+
echo '</td></tr>';
|
131 |
+
}
|
132 |
+
?>
|
133 |
+
</table>
|
app/design/adminhtml/default/default/template/serwersms/formularzsms.phtml
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<style>
|
2 |
+
.ramka_serwersms{
|
3 |
+
border: 1px solid #e02124;
|
4 |
+
}
|
5 |
+
|
6 |
+
.ramka_serwersms td{
|
7 |
+
padding-left: 10px; padding-right: 10px;
|
8 |
+
}
|
9 |
+
|
10 |
+
.ramka_serwersms a{
|
11 |
+
color: #e02124;
|
12 |
+
}
|
13 |
+
|
14 |
+
.naglowek_serwersms{
|
15 |
+
background: #e02124; padding: 10px 10px;
|
16 |
+
}
|
17 |
+
.text-right{
|
18 |
+
text-align: right;
|
19 |
+
}
|
20 |
+
.serwersms_info{
|
21 |
+
font-size: 11px;
|
22 |
+
color: #333;
|
23 |
+
}
|
24 |
+
</style>
|
25 |
+
<script type="text/javascript">
|
26 |
+
function przeliczZnaki(){
|
27 |
+
var textarea = document.getElementById("znaki");
|
28 |
+
var wiadomosc = textarea.value.length;
|
29 |
+
var pole = document.getElementById("pokazznaki");
|
30 |
+
var sms = document.getElementById("liczbasms");
|
31 |
+
var lsms = '';
|
32 |
+
if(wiadomosc <= 160) lsms = 1;
|
33 |
+
if(wiadomosc > 160 && wiadomosc <= 306) lsms = 2;
|
34 |
+
if(wiadomosc > 306 && wiadomosc <= 459) lsms = 3;
|
35 |
+
if(wiadomosc > 459) lsms = 4;
|
36 |
+
if(wiadomosc >= 612) textarea.value = textarea.value.substr(0,612);
|
37 |
+
|
38 |
+
pole.innerHTML = textarea.value.length;
|
39 |
+
sms.innerHTML = lsms;
|
40 |
+
}
|
41 |
+
</script>
|
42 |
+
<div class="content-header">
|
43 |
+
<table cellspacing="0">
|
44 |
+
<tbody><tr>
|
45 |
+
<td><h3 class="icon-head head-adminhtml-wyslane">Wyślij SMS</h3></td>
|
46 |
+
</tr>
|
47 |
+
</tbody></table>
|
48 |
+
</div>
|
49 |
+
|
50 |
+
<?php
|
51 |
+
$nadawcy = $this->nadawcyLista();
|
52 |
+
?>
|
53 |
+
<form action="<?php echo Mage::getUrl('sms/adminhtml_index/wysylkaform'); ?>" method="post">
|
54 |
+
<fieldset>
|
55 |
+
<table class="ramka_serwersms">
|
56 |
+
<tr>
|
57 |
+
<td colspan="4" class="naglowek_serwersms">
|
58 |
+
<img src="<?php echo $this->getSkinUrl('serwersms/serwersms.png') ?>" />
|
59 |
+
</td>
|
60 |
+
</tr>
|
61 |
+
<tr><td colspan="4"> </td></tr>
|
62 |
+
<?php if(is_array($nadawcy)) { ?>
|
63 |
+
<tr>
|
64 |
+
<td><strong>Typ wiadomości:</strong></td>
|
65 |
+
<td></td><td></td>
|
66 |
+
</tr>
|
67 |
+
<tr>
|
68 |
+
<td></td>
|
69 |
+
<td><input type="radio" id="eco" name="typ" value="0" checked="checked" /> <label for="eco">ECO</label></td>
|
70 |
+
<td><input type="radio" id="full" name="typ" value="1" /> <label for="full">FULL</label>
|
71 |
+
<br /><br />
|
72 |
+
Nazwa nadawcy:<br />
|
73 |
+
<select name="nadawca">
|
74 |
+
<?php
|
75 |
+
if(is_array($nadawcy)){
|
76 |
+
foreach($nadawcy['wlasne'] as $nazwa => $status){
|
77 |
+
if($status == 'Autoryzowano'){
|
78 |
+
echo '<option value="'.$nazwa.'">'.$nazwa.'</option>';
|
79 |
+
}
|
80 |
+
}
|
81 |
+
echo '<option value="" disabled="disabled">-------------------</option>';
|
82 |
+
|
83 |
+
foreach($nadawcy['predefiniowane'] as $nazwa => $status){
|
84 |
+
echo '<option value="'.$nazwa.'">'.$nazwa.'</option>';
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
?>
|
89 |
+
</select>
|
90 |
+
</td>
|
91 |
+
<td></td>
|
92 |
+
</tr>
|
93 |
+
<tr>
|
94 |
+
<td><strong>Odbiorca:</strong></td>
|
95 |
+
<td></td><td></td>
|
96 |
+
</tr>
|
97 |
+
<tr>
|
98 |
+
<td></td>
|
99 |
+
<td><input type="radio" id="recznie" name="odbiorca" value="0" checked="checked" /> <label for="recznie">Wpisz numer ręcznie:</label>
|
100 |
+
<br /><br />
|
101 |
+
<input type="text" name="numer_reczny">
|
102 |
+
</td>
|
103 |
+
<td><input type="radio" id="lista" name="odbiorca" value="1" /> <label for="lista">Wybierz z listy klientów:</label>
|
104 |
+
<br /><br />
|
105 |
+
<select name="numer_lista">
|
106 |
+
<?php
|
107 |
+
$kontakty = $this->kontaktyLista();
|
108 |
+
foreach($kontakty as $kontakt){
|
109 |
+
echo '<option value="'.$kontakt['telefon'].'">'.$kontakt['name'].' ('.$kontakt['telefon'].')</option>';
|
110 |
+
}
|
111 |
+
?>
|
112 |
+
</select>
|
113 |
+
</td>
|
114 |
+
<td><input type="radio" id="grupa" name="odbiorca" value="2" /> <label for="grupa">Wyślij do grupy:</label>
|
115 |
+
<br /><br />
|
116 |
+
<select name="numer_grupa">
|
117 |
+
<?php
|
118 |
+
$grupy = $this->grupyLista();
|
119 |
+
foreach($grupy as $grupa){
|
120 |
+
if($grupa['id'] != 0){
|
121 |
+
echo '<option value="'.$grupa['id'].'">'.$grupa['name'].'</option>';
|
122 |
+
}
|
123 |
+
}
|
124 |
+
?>
|
125 |
+
</select>
|
126 |
+
</td>
|
127 |
+
</tr>
|
128 |
+
<tr>
|
129 |
+
<td><br /><strong>Treść wiadomości:</strong></td>
|
130 |
+
<td></td><td></td>
|
131 |
+
</tr>
|
132 |
+
<tr>
|
133 |
+
<td>Liczba znaków: <span id="pokazznaki" style="font-weight: bold">0</span><br />
|
134 |
+
Liczba sms: <span id="liczbasms" style="font-weight: bold">0</span></td>
|
135 |
+
<td colspan="3">
|
136 |
+
<textarea name="wiadomosc" style="width: 100%; height: 80px" id="znaki" onkeyup="przeliczZnaki();" onkeydown="przeliczZnaki();" onchange="przeliczZnaki();"></textarea>
|
137 |
+
</td>
|
138 |
+
</tr>
|
139 |
+
<tr>
|
140 |
+
<td></td>
|
141 |
+
<td>
|
142 |
+
<input type="submit" value="Wyślij" />
|
143 |
+
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
|
144 |
+
</td>
|
145 |
+
<td></td>
|
146 |
+
<td></td>
|
147 |
+
</tr>
|
148 |
+
<?php } else { ?>
|
149 |
+
<tr>
|
150 |
+
<td colspan="4">
|
151 |
+
<?php
|
152 |
+
if($nadawcy == 'blad logowania: nieprawidlowy login lub haslo' or $nadawcy == ''){
|
153 |
+
echo Mage::helper('sms_helper/SerwerSMS')->niezalogowanyWidok();
|
154 |
+
} else {
|
155 |
+
echo '<strong>'.$nadawcy.'</strong>';
|
156 |
+
}
|
157 |
+
?>
|
158 |
+
</td>
|
159 |
+
</tr>
|
160 |
+
<?php } ?>
|
161 |
+
</table>
|
162 |
+
</fieldset>
|
163 |
+
</form>
|
app/etc/modules/SerwerSMS_Sms.xml
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<SerwerSMS_Sms>
|
5 |
+
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
+
</SerwerSMS_Sms>
|
8 |
+
</modules>
|
9 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>SerwerSMSpl</name>
|
4 |
+
<version>1.0.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl - 3.0.php">Open Software License (OSL)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>SMS notification module. | Moduł powiadomień SMS</summary>
|
10 |
+
<description>Moduł umożliwia wysyłkę wiadomości SMS do administratora sklepu w momencie złożenia nowego zamówienia, oraz do klienta kiedy jego zamówienie zostanie zrealizowane lub wstrzymane. Ponadto możliwa jest także wysyłka pojedyńczych wiadomości do grupy klientów lub indywidualnej osoby. Moduł pozwala na dostęp do podstawowych informacji o koncie w SerwerSMS takich jak stan konta, dostępna długość wiadomości, czy lista nazw nadawcy.</description>
|
11 |
+
<notes>SerwerSMS</notes>
|
12 |
+
<authors><author><name>SerwerSMS</name><user>SerwerSMS</user><email>biuro@serwersms.pl</email></author></authors>
|
13 |
+
<date>2013-06-04</date>
|
14 |
+
<time>11:11:29</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="SerwerSMS"><dir name="Sms"><dir name="Block"><dir name="Adminhtml"><dir name="Niewyslane"><file name="Grid.php" hash="b08a649dd22a304643e477cf591b6dc6"/></dir><file name="NiewyslaneGrid.php" hash="d2c99eb6a9e2f7d3ffa8b3e0fefbf404"/><dir name="Odpowiedzi"><file name="Grid.php" hash="d9ca04c8daef9e4cbca81d281eef9342"/></dir><file name="OdpowiedziGrid.php" hash="be134a0b017e70df78ff480dc9cc818b"/><dir name="Wyslane"><file name="Grid.php" hash="349916437a3d1adca90d3b89dd37041c"/></dir><file name="WyslaneGrid.php" hash="299c7c3f3dd0686dc9a6d063651c83f8"/></dir><file name="Danekonta.php" hash="c319d9cd4f1ef2ad45bd8af636c05248"/><file name="Wyslijsms.php" hash="eaa27bbdc61b01c709b6fc262ff051fb"/></dir><dir name="Helper"><file name="SerwerSMS.php" hash="17d2f9f1b55aa0576746fd4358b29c35"/></dir><dir name="Model"><dir name="Mysql4"><dir name="OdpowiedziModel"><file name="Collection.php" hash="599ac9f7d02e8a3a3424955ca326361a"/></dir><file name="OdpowiedziModel.php" hash="4dd669945e3be9188f87475837aaa83b"/><dir name="SmsModel"><file name="Collection.php" hash="4b166decb1b49018b63ef5daeb1d2ad4"/></dir><file name="SmsModel.php" hash="063bbb6552afb5a6b15f0e1b461847cd"/></dir><file name="Nadawcy.php" hash="11aeb80a7df125a84f5859c674237e34"/><file name="Observer.php" hash="03d2f1050afe8fa035d5cbee28f0016f"/><file name="OdpowiedziModel.php" hash="2c501e5119f0d743551b713916f6b40a"/><file name="SmsModel.php" hash="a4a50c1086f60a94d5529d3c54e1b8fd"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="IndexController.php" hash="246171b16765621d9e68b3de23bcaa8a"/></dir><file name="OdpowiedziController.php" hash="357a4324e02922744aa5102ed5c1e8c1"/><file name="RaportController.php" hash="685a01773d68c15895e04e19e389fdbc"/></dir><dir name="etc"><file name="config.xml" hash="f3fb0659c4bc8c8e4c14f12572850f34"/><file name="system.xml" hash="0e8cf3b0af6614c7deb803bd999fce57"/></dir><dir name="sql"><dir name="sms_setup"><file name="mysql4-install-1.0.0.php" hash="2179aba6c41a016da5c7244e071c047d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="serwersms"><file name="sms.xml" hash="6d765a9457e6de95689225b6354782de"/></dir></dir><dir name="template"><dir name="serwersms"><file name="danekonta.phtml" hash="9c84da7b201e1098682f9f493a297fee"/><file name="dodajnazwe.phtml" hash="23958188653511e9b5a56503293caa4a"/><file name="faktury.phtml" hash="a8e2f950a0c235abdcea4f40bee83ef5"/><file name="formularzsms.phtml" hash="5b6dc9efda54aadb31b220167d7875f1"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="SerwerSMS_Sms.xml" hash="60b8a59f621ae8222504fd95dae8545b"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="serwersms"><file name="serwersms.png" hash="e686cbffb9e6d14eff216b382780ca05"/></dir></dir></dir></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/adminhtml/default/default/serwersms/serwersms.png
ADDED
Binary file
|