1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: 19: 20: 21: 22: 23: 24: 25: 26: 27:
28: class cUpgradeJob_0007 extends cUpgradeJobAbstract {
29:
30: public $maxVersion = "4.9.0-beta1";
31:
32: public function _execute() {
33: global $cfg, $db;
34:
35: if ($this->_setupType == 'upgrade') {
36:
37: $areaItem = new cApiArea();
38: $areaItem->loadByMany(array(
39: 'parent_id' => '0',
40: 'name' => 'mail_log'
41: ));
42: $mainIdarea = $areaItem->get('idarea');
43: $areaItem->loadByMany(array(
44: 'parent_id' => 'mail_log',
45: 'name' => 'mail_log_overview'
46: ));
47: $overviewIdarea = $areaItem->get('idarea');
48: $areaItem->loadByMany(array(
49: 'parent_id' => 'mail_log',
50: 'name' => 'mail_log_detail'
51: ));
52: $detailIdarea = $areaItem->get('idarea');
53:
54:
55: $fileCollection = new cApiFileCollection();
56: $file = new cApiFile();
57:
58:
59: $file->loadByMany(array(
60: 'idarea' => $mainIdarea,
61: 'filename' => 'include.mail_log.left_bottom.php'
62: ));
63: if ($file->isLoaded()) {
64: $fileCollection->delete($file->get('idfile'));
65: }
66:
67:
68: $file->loadByMany(array(
69: 'idarea' => $mainIdarea,
70: 'filename' => 'include.mail_log_subnav.php'
71: ));
72: if ($file->isLoaded()) {
73: $fileCollection->delete($file->get('idfile'));
74: }
75:
76:
77:
78: $file->loadByMany(array(
79: 'idarea' => $mainIdarea,
80: 'filename' => 'include.mail_log.right_bottom.php'
81: ));
82: if ($file->isLoaded()) {
83: $file->set('filename', 'include.mail_log.php');
84: $file->store();
85: }
86: $file->loadByMany(array(
87: 'idarea' => $overviewIdarea,
88: 'filename' => 'include.mail_log.right_bottom.php'
89: ));
90: if ($file->isLoaded()) {
91: $file->set('filename', 'include.mail_log.php');
92: $file->store();
93: }
94: $file->loadByMany(array(
95: 'idarea' => $detailIdarea,
96: 'filename' => 'include.mail_log.right_bottom.php'
97: ));
98: if ($file->isLoaded()) {
99: $file->set('filename', 'include.mail_log.php');
100: $file->store();
101: }
102:
103:
104:
105: $columns = array();
106: $sql = 'SHOW COLUMNS FROM ' . $cfg['tab']['mail_log_success'];
107: $db->query($sql);
108: while ($db->nextRecord()) {
109: $columns[] = $db->f('Field');
110: }
111: if (in_array('idmail_resend', $columns)) {
112: $sql = 'ALTER TABLE `' . $cfg['tab']['mail_log_success'] . '` DROP `idmail_resend`';
113: $db->query($sql);
114: }
115: }
116: }
117:
118: }
119: