1: <?php
2:
3: /**
4: * This file contains the upgrade job 13.
5: *
6: * @package Setup
7: * @subpackage UpgradeJob
8: * @version SVN Revision $Rev:$
9: *
10: * @author frederic.schneider
11: * @copyright four for business AG <www.4fb.de>
12: * @license http://www.contenido.org/license/LIZENZ.txt
13: * @link http://www.4fb.de
14: * @link http://www.contenido.org
15: */
16:
17: // assert CONTENIDO framework
18: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
19:
20: /**
21: * Upgrade job 13.
22: *
23: * Change of areas for actions pifa_export_form, pifa_show_fields and
24: * pifa_show_data
25: *
26: * @package Setup
27: * @subpackage UpgradeJob
28: */
29: class cUpgradeJob_0013 extends cUpgradeJobAbstract {
30:
31: public $maxVersion = "4.9.3";
32:
33: public function _execute() {
34: global $cfg;
35:
36: if ($_SESSION['setuptype'] == 'upgrade') {
37:
38: // Initializing cApiArea
39: $area = new cApiArea();
40:
41: // Initializing cApiAction
42: $action = new cApiAction();
43:
44: // PIFA_EXPORT_FORM
45: // Get informations for area form_ajax
46: $area->loadBy('name', 'form_ajax');
47:
48: // If area form_ajax not exist, return false
49: if ($area === null) {
50: return false;
51: }
52:
53: // Get informations for action pifa_export_form
54: $action->loadBy('name', 'pifa_export_form');
55:
56: // If action pifa_export_form not exist, return false
57: if ($action === null) {
58: return false;
59: }
60:
61: // Change area for action pifa_export_form to form_ajax
62: $action->set('idarea', $area->get('idarea'));
63: $action->store();
64:
65: // PIFA_SHOW_FIELDS
66: $area->loadBy('name', 'form_fields');
67:
68: // If area form_fields not exist, return false
69: if ($area === null) {
70: return false;
71: }
72:
73: // Get informations for action pifa_show_fields
74: $action->loadBy('name', 'pifa_show_fields');
75:
76: // If action pifa_show_fields not exist, return false
77: if ($action === null) {
78: return false;
79: }
80:
81: // Change area for action pifa_show_fields to form_fields
82: $action->set('idarea', $area->get('idarea'));
83: $action->store();
84:
85: // PIFA_SHOW_DATA
86: $area->loadBy('name', 'form_data');
87:
88: // If area form_data not exist, return false
89: if ($area === null) {
90: return false;
91: }
92:
93: // Get informations for action pifa_show_data
94: $action->loadBy('name', 'pifa_show_data');
95:
96: // If action pifa_show_data not exist, return false
97: if ($action === null) {
98: return false;
99: }
100:
101: // Change area for action pifa_show_data to form_data
102: $action->set('idarea', $area->get('idarea'));
103: $action->store();
104: }
105: }
106:
107: }
108: