Changeset 21441 for branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php
- Timestamp:
- 2012/02/06 11:05:15 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php
r21376 r21441 73 73 $this->initForm($objFormParam, $_POST); 74 74 75 switch ($this->getMode()) {75 switch ($this->getMode()) { 76 76 case 'confirm' : 77 77 $message = $this->lfDoChange($objFormParam); … … 119 119 $arrTarget = $this->lfGetTargetData($objFormParam); 120 120 $message = ""; 121 if (is_array($arrTarget) && count($arrTarget) == 0) {121 if (is_array($arrTarget) && count($arrTarget) == 0) { 122 122 $message = "window.alert('変更対象となるデータはありませんでした。');"; 123 123 return $message; 124 } elseif (!is_array($arrTarget) && $arrTarget != "") {124 } elseif (!is_array($arrTarget) && $arrTarget != "") { 125 125 return $arrTarget; // window.alert が返ってきているはず。 126 126 } 127 127 128 128 // 変更対象の設定変更 129 foreach ($arrTarget as $item) {129 foreach ($arrTarget as $item) { 130 130 $index_name = $item['table_name'] . '_' . $item['column_name'] . "_key"; 131 131 $arrField = array( 'fields' => array($item['column_name'] => array())); 132 if ($item['indexflag_new'] == '1') {132 if ($item['indexflag_new'] == '1') { 133 133 $objQuery->createIndex($item['table_name'], $index_name, $arrField); 134 } else{134 } else { 135 135 $objQuery->dropIndex($item['table_name'], $index_name); 136 136 } … … 150 150 151 151 // 変更されている対象を走査 152 for ($i = 1; $i <= count($arrIndexFlag); $i++) {152 for ($i = 1; $i <= count($arrIndexFlag); $i++) { 153 153 //入力値チェック 154 154 $param = array('indexflag' => $arrIndexFlag[$i], … … 163 163 $objErr->doFunc(array("カラム名(" . $i . ")", 'column_name', STEXT_LEN), array("GRAPH_CHECK", "EXIST_CHECK", "MAX_LENGTH_CHECK")); 164 164 $arrErr = $objErr->arrErr; 165 if (count($arrErr) != 0) {165 if (count($arrErr) != 0) { 166 166 // 通常の送信ではエラーにならないはずです。 167 167 $message = "window.alert('不正なデータがあったため処理を中断しました。');"; 168 168 return $message; 169 169 } 170 if ($param['indexflag'] != $param['indexflag_new']) {170 if ($param['indexflag'] != $param['indexflag_new']) { 171 171 // 入力値がデータにある対象テーブルかのチェック 172 172 if ($objQuery->exists('dtb_index_list', 'table_name = ? and column_name = ?', array($param['table_name'], $param['column_name']))) { … … 191 191 192 192 $table = ""; 193 foreach ($arrIndexList as $key => $arrIndex) {193 foreach ($arrIndexList as $key => $arrIndex) { 194 194 // テーブルに対するインデックス一覧を取得 195 if ($table !== $arrIndex["table_name"]) {195 if ($table !== $arrIndex["table_name"]) { 196 196 $table = $arrIndex["table_name"]; 197 197 $arrIndexes = $objQuery->listTableIndexes($table); … … 199 199 // インデックスが設定されているかを取得 200 200 $idx_name = $table . "_" . $arrIndex["column_name"] . "_key"; 201 if (array_search($idx_name, $arrIndexes) === false) {201 if (array_search($idx_name, $arrIndexes) === false) { 202 202 $arrIndexList[$key]['indexflag'] = ''; 203 203 } else {
Note: See TracChangeset
for help on using the changeset viewer.