Project

General

Profile

« Previous | Next » 

Revision 1502

Added by DarkViper over 13 years ago

fixed c&p mistake

View differences:

branches/2.8.x/CHANGELOG
12 12

  
13 13
=============================== FEATURES FREEZE ================================
14 14
----------------------------------- Fixes 2.8.2 --------------------------------
15
11 Aug-2011 Build 1502 Werner v.d.Decken(DarkViper)
16
# fixed c&p mistake
15 17
11 Aug-2011 Build 1501 Werner v.d.Decken(DarkViper)
16 18
- removed stoneaged code from 2.4
17 19
11 Aug-2011 Build 1500 Werner v.d.Decken(DarkViper)
branches/2.8.x/wb/admin/interface/version.php
52 52

  
53 53
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
54 54
if(!defined('VERSION')) define('VERSION', '2.8.2');
55
if(!defined('REVISION')) define('REVISION', '1501');
55
if(!defined('REVISION')) define('REVISION', '1502');
branches/2.8.x/wb/framework/class.order.php
63 63
		$retval = false;
64 64
		$sql  = 'SELECT `'.$this->_FieldOrder.'` `order`, `'.$this->_FieldGroup.'` `group` ';
65 65
		$sql .= 'FROM `'.$this->_Table.'` WHERE `'.$this->_FieldId.'`=\''.$id.'\'';
66
		// get Position and Group for Element to move
66 67
		if(($res1 = $this->_DB->query($sql))) {
67 68
			if(($rec1 = $res1->fetchRow())) {
68 69
				$sql  = 'SELECT `'.$this->_FieldId.'` `id`, `'.$this->_FieldOrder.'` `order` ';
69 70
				$sql .= 'FROM `'.$this->_Table.'` ';
70 71
				$sql .= 'WHERE `'.$this->_FieldGroup.'`=\''.$rec1['group'].'\' ';
71 72
				if($direction == self::MOVE_UP) {
73
					// search for Element with next lower Position
74
					$sql .=     'AND `'.$this->_FieldOrder.'`<\''.$rec1['order'].'\' ';
75
					$sql .= 'ORDER BY `'.$this->_FieldOrder.'` DESC';
76
				}else {
77
					// search for Element with next higher Position
72 78
					$sql .=     'AND `'.$this->_FieldOrder.'`>\''.$rec1['order'].'\' ';
73 79
					$sql .= 'ORDER BY `'.$this->_FieldOrder.'` ASC';
74
				}else {
75
					$sql .=     'AND `'.$this->_FieldOrder.'`<\''.$rec1['order'].'\' ';
76
					$sql .= 'ORDER BY `'.$this->_FieldOrder.'` DESC';
77 80
				}
81
				// get Id and Position of the Element to change with
78 82
				if(($res2 = $this->_DB->query($sql))) {
79 83
					if(($rec2 = $res2->fetchRow())) {
80 84
						$sql  = 'UPDATE `'.$this->_Table.'` ';
81 85
						$sql .= 'SET `'.$this->_FieldOrder.'`=\''.$rec1['order'].'\' ';
82 86
						$sql .= 'WHERE `'.$this->_FieldId.'`=\''.$rec2['id'].'\'';
87
						// update Position number of target
83 88
						if($this->_DB->query($sql)) {
84 89
							$sql  = 'UPDATE `'.$this->_Table.'` ';
85 90
							$sql .= 'SET `'.$this->_FieldOrder.'`=\''.$rec2['order'].'\' ';
86 91
							$sql .= 'WHERE `'.$this->_FieldId.'`=\''.$id.'\'';
92
							// update Position number source
87 93
							$retval = $this->_DB->query($sql);
88 94
						}
89 95
					}

Also available in: Unified diff