I'm not sure if the Boonex crew just assumes that we're all running test sites and not actual sites, but this would seem to be to be a critical bit of information to share:
- What was added in upgrade: functionality, formatting, modules, language, etc.
- What was deleted in upgrade: functionality, formatting, modules, language, etc.
- What was changed in upgrade: functionality, formatting, modules, language, etc.
I run six active sites, one demo.
ManOfTeal.COM a Proud UNA site, six years running strong! |
Read the comments for the ticket. You'll see one or more revision numbers, which lead to changesets, which list all modified files, and (if the file wasn't deleted) what was changed in those files.
This is why I'm out of my depth. I don't know how to get
"There is a new button in the Membership Settings that controls the order of the Membership Levels"
from this:
-
r15319 |
r15320 |
|
98 |
98 |
$_page_cont[$iNameIndex] = array( |
99 |
99 |
'page_code_settings' => PageCodeSettings($mixedResultSettings), |
100 |
|
'page_code_create' => PageCodeCreate(), |
|
100 |
'page_code_create' => PageCodeCreate(bx_get('action') !== false && bx_get('action') == 'edit' ? $iLevelId : 0), |
101 |
101 |
'page_code_available' => PageCodeAvailable($mixedResultAvailable), |
102 |
102 |
'page_code_actions' => bx_get('action') !== false && bx_get('action') == 'actions' && $iLevelId > 0 ? PageCodeActions($iLevelId, $mixedResultActions) : "", |
… |
… |
|
113 |
113 |
return DesignBoxAdmin(_t('_adm_box_cpt_mlevel_settings'), $sResult); |
114 |
114 |
} |
115 |
|
function PageCodeCreate() { |
|
115 |
function PageCodeCreate($iLevelId = 0) { |
|
116 |
$sSubmitUrl = $GLOBALS['site']['url_admin'] . 'memb_levels.php'; |
|
117 |
|
|
118 |
$aLevel = array(); |
|
119 |
if(($bEdit = $iLevelId != 0) === true) |
|
120 |
$aLevel = $GLOBALS['MySQL']->getRow("SELECT `Name` AS `Name`, `Description` AS `Description`, `Order` AS `Order` FROM `sys_acl_levels` WHERE `ID`='" . $iLevelId . "' LIMIT 1"); |
|
121 |
|
116 |
122 |
$aForm = array( |
117 |
123 |
'form_attrs' => array( |
118 |
124 |
'id' => 'adm-mlevels-create', |
119 |
|
'action' => $GLOBALS['site']['url_admin'] . 'memb_levels.php', |
|
125 |
'action' => $sSubmitUrl, |
120 |
126 |
'method' => 'post', |
121 |
127 |
'enctype' => 'multipart/form-data', |
… |
… |
|
127 |
133 |
'uri' => '', |
128 |
134 |
'uri_title' => '', |
129 |
|
'submit_name' => 'submit' |
|
135 |
'submit_name' => 'Submit' |
130 |
136 |
), |
131 |
137 |
), |
… |
… |
|
157 |
163 |
'Name' => array( |
158 |
164 |
'type' => 'text', |
159 |
|
'name' => 'name', |
|
165 |
'name' => 'Name', |
160 |
166 |
'caption' => _t('_adm_txt_mlevels_name'), |
161 |
|
'value' => '', |
|
167 |
'value' => isset($aLevel['Name']) ? $aLevel['Name'] : '', |
162 |
168 |
'db' => array ( |
163 |
169 |
'pass' => 'Xss', |
… |
… |
|
182 |
188 |
'Description' => array( |
183 |
189 |
'type' => 'textarea', |
184 |
|
'name' => 'description', |
|
190 |
'name' => 'Description', |
185 |
191 |
'caption' => _t('_adm_txt_mlevels_description'), |
186 |
|
'value' => '', |
|
192 |
'value' => isset($aLevel['Description']) ? $aLevel['Description'] : '', |
187 |
193 |
'db' => array ( |
188 |
194 |
'pass' => 'XssHtml', |
189 |
195 |
), |
190 |
196 |
), |
191 |
|
'submit' => array( |
|
197 |
'Order' => array( |
|
198 |
'type' => 'text', |
|
199 |
'name' => 'Order', |
|
200 |
'caption' => _t('_adm_txt_mlevels_order'), |
|
201 |
'value' => isset($aLevel['Order']) ? $aLevel['Order'] : 0, |
|
202 |
'db' => array ( |
|
203 |
'pass' => 'Int', |
|
204 |
), |
|
205 |
), |
|
206 |
'Submit' => array( |
192 |
207 |
'type' => 'submit', |
193 |
|
'name' => 'submit', |
|
208 |
'name' => 'Submit', |
194 |
209 |
'value' => _t('_adm_btn_mlevels_add'), |
195 |
210 |
), |
196 |
211 |
) |
197 |
212 |
); |
|
213 |
|
|
214 |
//--- Convert Add to Edit |
|
215 |
if($bEdit) { |
|
216 |
unset($aForm['inputs']['Active']); |
|
217 |
unset($aForm['inputs']['Purchasable']); |
|
218 |
unset($aForm['inputs']['Removable']); |
|
219 |
unset($aForm['inputs']['Icon']); |
|
220 |
|
|
221 |
$aForm['form_attrs']['action'] .= '?action=edit&level=' . $iLevelId; |
|
222 |
$aForm['inputs']['Submit']['value'] = _t('_adm_btn_mlevels_save'); |
|
223 |
$aForm['inputs']['ID'] = array( |
|
224 |
'type' => 'hidden', |
|
225 |
'name' => 'ID', |
|
226 |
'value' => $iLevelId, |
|
227 |
'db' => array ( |
|
228 |
'pass' => 'Int', |
|
229 |
) |
|
230 |
); |
|
231 |
} |
|
232 |
|
198 |
233 |
$oForm = new BxTemplFormView($aForm); |
199 |
234 |
$oForm->initChecker(); |
200 |
235 |
|
201 |
|
$bFile = true; |
202 |
|
$sFilePath = BX_DIRECTORY_PATH_ROOT . 'media/images/membership/'; |
203 |
|
$sFileName = time(); |
204 |
|
$sFileExt = ''; |
205 |
|
if($oForm->isSubmittedAndValid() && $bFile = (isImage($_FILES['Icon']['type'], $sFileExt) && !empty($_FILES['Icon']['tmp_name']) && move_uploaded_file($_FILES['Icon']['tmp_name'], $sFilePath . $sFileName . '.' . $sFileExt))) { |
206 |
|
$sPath = $sFilePath . $sFileName . '.' . $sFileExt; |
207 |
|
imageResize($sPath, $sPath, 110, 110); |
208 |
|
|
209 |
|
$iId = (int)$oForm->insert(array('Icon' => $sFileName . '.' . $sFileExt)); |
210 |
|
if($iId != 0) |
211 |
|
addStringToLanguage("_adm_txt_mp_" . strtolower(bx_get('name')), bx_get('name')); |
212 |
|
|
213 |
|
header('Location: ' . $oForm->aFormAttrs['action']); |
214 |
|
} else { |
215 |
|
if(!$bFile) |
216 |
|
$oForm->aInputs['Icon']['error'] = $oForm->aInputs['Icon']['checker']['error']; |
217 |
|
|
218 |
|
return DesignBoxAdmin(_t('_adm_box_cpt_mlevel_create'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode()))); |
|
236 |
if($oForm->isSubmittedAndValid()) { |
|
237 |
//--- Add new level |
|
238 |
if(!$bEdit) { |
|
239 |
$sFilePath = BX_DIRECTORY_PATH_ROOT . 'media/images/membership/'; |
|
240 |
$sFileName = time(); |
|
241 |
$sFileExt = ''; |
|
242 |
|
|
243 |
if(isImage($_FILES['Icon']['type'], $sFileExt) && !empty($_FILES['Icon']['tmp_name']) && move_uploaded_file($_FILES['Icon']['tmp_name'], $sFilePath . $sFileName . '.' . $sFileExt)) { |
|
244 |
$sPath = $sFilePath . $sFileName . '.' . $sFileExt; |
|
245 |
imageResize($sPath, $sPath, 110, 110); |
|
246 |
|
|
247 |
$iOrder = (int)$oForm->getCleanValue('Order'); |
|
248 |
if($iOrder < 1) |
|
249 |
$iOrder = 1; |
|
250 |
|
|
251 |
$iId = (int)$oForm->insert(array('Icon' => $sFileName . '.' . $sFileExt, 'Order' => $iOrder)); |
|
252 |
if($iId != 0) { |
|
253 |
$sName = $oForm->getCleanValue('Name'); |
|
254 |
addStringToLanguage('_adm_txt_mp_' . strtolower($sName), $sName); |
|
255 |
} |
|
256 |
|
|
257 |
header('Location: ' . $sSubmitUrl); |
|
258 |
exit; |
|
259 |
} |
|
260 |
else |
|
261 |
$oForm->aInputs['Icon']['error'] = $oForm->aInputs['Icon']['checker']['error']; |
|
262 |
} |
|
263 |
//--- Edit existing level |
|
264 |
else { |
|
265 |
$iOrder = (int)$oForm->getCleanValue('Order'); |
|
266 |
if($iOrder < 1) |
|
267 |
$iOrder = 1; |
|
268 |
|
|
269 |
$bResult = $oForm->update($iLevelId, array('Order' => $iOrder)); |
|
270 |
if($bResult !== false) { |
|
271 |
deleteStringFromLanguage('_adm_txt_mp_' . strtolower($aLevel['Name'])); |
|
272 |
|
|
273 |
$sName = $oForm->getCleanValue('Name'); |
|
274 |
addStringToLanguage('_adm_txt_mp_' . strtolower($sName), $sName); |
|
275 |
} |
|
276 |
|
|
277 |
header('Location: ' . $sSubmitUrl); |
|
278 |
exit; |
|
279 |
} |
219 |
280 |
} |
|
281 |
|
|
282 |
return DesignBoxAdmin(_t('_adm_box_cpt_mlevel_create'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $oForm->getCode()))); |
220 |
283 |
} |
221 |
284 |
function PageCodeAvailable($mixedResult) { |
222 |
285 |
//--- Get Items ---// |
223 |
|
$aItems = array(); |
224 |
|
|
225 |
|
$aLevels = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Name` AS `title`, `Active` AS `active`, `Purchasable` AS `purchasable`, `Removable` AS `removable` FROM `sys_acl_levels` ORDER BY `ID`"); |
|
286 |
$aItemsSystem = $aItemsCustom = array(); |
|
287 |
|
|
288 |
$aLevels = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Name` AS `title`, `Active` AS `active`, `Purchasable` AS `purchasable`, `Removable` AS `removable` FROM `sys_acl_levels` WHERE `Purchasable`='no' AND `Removable`='no' ORDER BY `ID` ASC"); |
226 |
289 |
foreach($aLevels as $aLevel) |
227 |
|
$aItems[] = array( |
228 |
|
'bx_if:system' => array( |
229 |
|
'condition' => $aLevel['purchasable'] == 'no' && $aLevel['removable'] == 'no', |
230 |
|
'content' => array() |
231 |
|
), |
|
290 |
$aItemsSystem[] = array( |
|
291 |
'id' => $aLevel['id'], |
|
292 |
'title' => $aLevel['title'], |
|
293 |
'actions_link' => $GLOBALS['site']['url_admin'] . 'memb_levels.php?action=actions&level=' . $aLevel['id'] . '#actions' . $aLevel['id'], |
|
294 |
); |
|
295 |
|
|
296 |
$aLevels = $GLOBALS['MySQL']->getAll("SELECT `ID` AS `id`, `Name` AS `title`, `Active` AS `active`, `Purchasable` AS `purchasable`, `Removable` AS `removable` FROM `sys_acl_levels` WHERE `Purchasable`='yes' AND `Removable`='yes' ORDER BY `Order` ASC"); |
|
297 |
foreach($aLevels as $aLevel) |
|
298 |
$aItemsCustom[] = array( |
232 |
299 |
'id' => $aLevel['id'], |
233 |
300 |
'title' => $aLevel['title'], |
234 |
301 |
'class' => $aLevel['active'] == 'yes' ? 'adm-mlevels-enabled' : 'adm-mlevels-disabled', |
235 |
|
'bx_if:enabled' => array( |
236 |
|
'condition' => $aLevel['active'] == 'yes', |
|
302 |
'actions_link' => $GLOBALS['site']['url_admin'] . 'memb_levels.php?action=actions&level=' . $aLevel['id'] . '#actions' . $aLevel['id'], |
|
303 |
'bx_if:editable' => array( |
|
304 |
'condition' => $aLevel['removable'] == 'yes', |
237 |
305 |
'content' => array( |
238 |
|
'title' => $aLevel['title'], |
239 |
|
'edit_link' => $GLOBALS['site']['url_admin'] . 'memb_levels.php?action=actions&level=' . $aLevel['id'] . '#actions' . $aLevel['id'], |
240 |
|
'bx_if:purchasable' => array( |
241 |
|
'condition' => $aLevel['purchasable'] == 'yes', |
242 |
|
'content' => array( |
243 |
|
'price_link' => $GLOBALS['site']['url_admin'] . 'memb_levels.php?action=prices&level=' . $aLevel['id'] . '#prices' . $aLevel['id'], |
244 |
|
) |
245 |
|
) |
|
306 |
'edit_link' => $GLOBALS['site']['url_admin'] . 'memb_levels.php?action=edit&level=' . $aLevel['id'], |
246 |
307 |
) |
247 |
308 |
), |
248 |
|
'bx_if:disabled' => array( |
249 |
|
'condition' => $aLevel['active'] != 'yes', |
|
309 |
'bx_if:purchasable' => array( |
|
310 |
'condition' => $aLevel['purchasable'] == 'yes', |
250 |
311 |
'content' => array( |
251 |
|
'id' => $aLevel['id'], |
252 |
|
'title' => $aLevel['title'] |
|
312 |
'price_link' => $GLOBALS['site']['url_admin'] . 'memb_levels.php?action=prices&level=' . $aLevel['id'] . '#prices' . $aLevel['id'], |
253 |
313 |
) |
254 |
|
), |
|
314 |
) |
255 |
315 |
); |
256 |
|
|
|
316 |
|
257 |
317 |
//--- Get Controls ---// |
258 |
318 |
$aButtons = array( |
… |
… |
|
262 |
322 |
); |
263 |
323 |
$sControls = BxTemplSearchResult::showAdminActionsPanel('adm-mlevels-list-form', $aButtons, 'levels'); |
264 |
|
|
265 |
|
$sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName('mlevels_list.html', array('bx_repeat:items' => $aItems, 'controls' => $sControls)); |
266 |
|
|
|
324 |
|
|
325 |
$sResult = $GLOBALS['oAdmTemplate']->parseHtmlByName( |
|
326 |
'mlevels_list.html', |
|
327 |
array( |
|
328 |
'bx_repeat:items_system' => $aItemsSystem, |
|
329 |
'bx_repeat:items_custom' => $aItemsCustom, |
|
330 |
'controls' => $sControls |
|
331 |
) |
|
332 |
); |
|
333 |
|
267 |
334 |
if($mixedResult !== true && !empty($mixedResult)) |
268 |
335 |
$sResult = MsgBox(_t($mixedResult), 3) . $sResult; |
-
r15200 |
r15320 |
|
1 |
1 |
<form id="adm-mlevels-list-form" enctype="multipart/form-data" method="post" action="" class="form_advanced"> |
2 |
2 |
<div class="adm-mlevels-items"> |
3 |
|
<bx_repeat:items> |
|
3 |
<div class="adm-mlevels-item"> |
|
4 |
<b> |
|
5 |
<bx_text:_adm_txt_mlevels_system /> |
|
6 |
</b> |
|
7 |
</div> |
|
8 |
<bx_repeat:items_system> |
|
9 |
<div class="adm-mlevels-item adm-mlevels-enabled"> |
|
10 |
<input type="checkbox" class="form_input_checkbox" id="adm-mlevels-__id__" name="levels[]" value="__id__" disabled="disabled" /> |
|
11 |
<label for="adm-mlevels-__id__">__title__</label> |
|
12 |
<a href="__actions_link__"><bx_text:_adm_txt_mlevels_actions /></a> |
|
13 |
</div> |
|
14 |
</bx_repeat:items_system> |
|
15 |
|
|
16 |
<div class="adm-mlevels-item" style="margin-top:10px"> |
|
17 |
<b> |
|
18 |
<bx_text:_adm_txt_mlevels_custom /> |
|
19 |
</b> |
|
20 |
</div> |
|
21 |
<bx_repeat:items_custom> |
4 |
22 |
<div class="adm-mlevels-item __class__"> |
5 |
|
<input type="checkbox" class="form_input_checkbox" id="adm-mlevels-__id__" name="levels[]" value="__id__" <bx_if:system>disabled="disabled"</bx_if:system> /> |
6 |
|
<bx_if:enabled> |
7 |
|
<a href="__edit_link__">__title__</a> |
8 |
|
<bx_if:purchasable> |
9 |
|
<a href="__price_link__"><bx_text:_adm_txt_mlevels_price /></a> |
10 |
|
</bx_if:purchasable> |
11 |
|
</bx_if:enabled> |
12 |
|
<bx_if:disabled> |
13 |
|
<label for="adm-mlevels-__id__">__title__</label> |
14 |
|
</bx_if:disabled> |
|
23 |
<input type="checkbox" class="form_input_checkbox" id="adm-mlevels-__id__" name="levels[]" value="__id__" /> |
|
24 |
<label for="adm-mlevels-__id__">__title__</label> |
|
25 |
<a href="__actions_link__"><bx_text:_adm_txt_mlevels_actions /></a> |
|
26 |
<bx_if:purchasable> |
|
27 |
<a href="__price_link__"><bx_text:_adm_txt_mlevels_price /></a> |
|
28 |
</bx_if:purchasable> |
|
29 |
<bx_if:editable> |
|
30 |
<a href="__edit_link__"><bx_text:_adm_txt_mlevels_edit /></a> |
|
31 |
</bx_if:editable> |
15 |
32 |
</div> |
16 |
|
</bx_repeat:items> |
|
33 |
</bx_repeat:items_custom> |
17 |
34 |
</div> |
18 |
35 |
__controls__ |
-
r15317 |
r15320 |
|
2018 |
2018 |
'_adm_btn_lang_save' => 'Save', |
2019 |
2019 |
'_adm_btn_lang_import' => 'Import', |
|
2020 |
'_adm_txt_mlevels_system' => 'System Levels', |
|
2021 |
'_adm_txt_mlevels_custom' => 'Custom Levels', |
2020 |
2022 |
'_adm_btn_mlevels_add' => 'Add', |
2021 |
2023 |
'_adm_btn_mlevels_enable' => 'Enable', |
… |
… |
|
2104 |
2106 |
'_adm_txt_keys_parameters' => 'String parameters', |
2105 |
2107 |
'_adm_txt_keys_string_for' => 'String text for {0} language', |
|
2108 |
'_adm_txt_mlevels_edit' => 'Edit', |
|
2109 |
'_adm_txt_mlevels_actions' => 'Actions', |
2106 |
2110 |
'_adm_txt_mlevels_price' => 'Pricing', |
2107 |
2111 |
'_adm_txt_mlevels_name' => 'Name', |
… |
… |
|
2110 |
2114 |
'_adm_txt_mlevels_icon_err' => 'You need to select an image for thumbnail', |
2111 |
2115 |
'_adm_txt_mlevels_description' => 'Description', |
|
2116 |
'_adm_txt_mlevels_order' => 'Order', |
2112 |
2117 |
'_adm_txt_mlevels_enabled' => 'enabled', |
2113 |
2118 |
'_adm_txt_mlevels_disabled' => 'disabled', |
-
r15316 |
r15320 |
|
1506 |
1506 |
`Purchasable` enum('yes','no') NOT NULL default 'yes', |
1507 |
1507 |
`Removable` enum('yes','no') NOT NULL default 'yes', |
|
1508 |
`Order` int(11) NOT NULL default '0', |
1508 |
1509 |
PRIMARY KEY (`ID`), |
1509 |
1510 |
UNIQUE KEY `Name` (`Name`) |
… |
… |
|
1514 |
1515 |
-- |
1515 |
1516 |
|
1516 |
|
INSERT INTO `sys_acl_levels` VALUES(1, 'Non-member', 'non-member.png', '', 'yes', 'no', 'no'); |
1517 |
|
INSERT INTO `sys_acl_levels` VALUES(2, 'Standard', 'member.png', '', 'yes', 'no', 'no'); |
1518 |
|
INSERT INTO `sys_acl_levels` VALUES(3, 'Promotion', 'promotion.png', '', 'yes', 'no', 'no'); |
|
1517 |
INSERT INTO `sys_acl_levels` VALUES(1, 'Non-member', 'non-member.png', '', 'yes', 'no', 'no', 0); |
|
1518 |
INSERT INTO `sys_acl_levels` VALUES(2, 'Standard', 'member.png', '', 'yes', 'no', 'no', 0); |
|
1519 |
INSERT INTO `sys_acl_levels` VALUES(3, 'Promotion', 'promotion.png', '', 'yes', 'no', 'no', 0); |
1519 |
1520 |
|
1520 |
1521 |
-- -------------------------------------------------------- |
-
r15200 |
r15320 |
|
36 |
36 |
function getMembershipsBy($aParams = array()) { |
37 |
37 |
$sMethod = "getAll"; |
38 |
|
$sSelectClause = $sJoinClause = $sWhereClause = ""; |
|
38 |
$sSelectClause = $sJoinClause = $sWhereClause = $sOrderClause = $sLimitClause = ""; |
39 |
39 |
if(isset($aParams['type'])) |
40 |
40 |
switch($aParams['type']) { |
… |
… |
|
49 |
49 |
$sJoinClause .= "INNER JOIN `sys_acl_level_prices` AS `tlp` ON `tl`.`ID`=`tlp`.`IDLevel`"; |
50 |
50 |
$sWhereClause = " AND `tl`.`Active`='yes' AND `tl`.`Purchasable`='yes'"; |
|
51 |
$sOrderClause = " ORDER BY `tl`.`Order` ASC, `tlp`.`Price` ASC"; |
51 |
52 |
break; |
52 |
53 |
case 'level_id': |
… |
… |
|
62 |
63 |
`tl`.`Description` AS `mem_description` " . $sSelectClause . " |
63 |
64 |
FROM `sys_acl_levels` AS `tl` " . $sJoinClause . " |
64 |
|
WHERE 1" . $sWhereClause; |
|
65 |
WHERE 1" . $sWhereClause . $sOrderClause . $sLimitClause; |
65 |
66 |
return $this->$sMethod($sSql); |
66 |
67 |
} |
|