Source for file LC_Page_Admin_System_Masterdata.php
Documentation is available at LC_Page_Admin_System_Masterdata.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2007 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(CLASS_PATH .
"pages/LC_Page.php");
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Admin_System_Masterdata.php 17576 2008-08-28 06:08:09Z Seasoft $
$this->tpl_subnavi =
'system/subnavi.tpl';
$this->tpl_subno =
'masterdata';
$this->tpl_subtitle =
'マスタデータ管理';
$this->arrMasterDataName =
$this->getMasterDataNames(array("mtb_pref",
if (!isset
($_POST["mode"])) $_POST["mode"] =
"";
switch ($_POST["mode"]) {
$this->checkMasterDataName();
$this->errorMessage =
$this->checkUniqueID();
if (empty($this->errorMessage)) {
foreach ($_POST['id'] as $key =>
$val) {
$arrData[$val] =
$_POST['name'][$key];
$masterData->objQuery->begin();
$masterData->deleteMasterData($this->masterDataName, false);
// TODO カラム名はメタデータから取得した方が良い
$masterData->registMasterData($this->masterDataName,
array("id", "name", "rank"),
$masterData->objQuery->commit();
$this->tpl_onload =
"window.alert('マスタデータの設定が完了しました。');";
$this->checkMasterDataName();
$masterData->getDbMasterData($this->masterDataName);
$objView->assignobj($this);
$objView->display(MAIN_FRAME);
function checkMasterDataName() {
if (in_array($_POST['master_data_name'], $this->arrMasterDataName)) {
$this->masterDataName =
$_POST['master_data_name'];
* @param array $ignores 取得しないマスタデータ名の配列
* @return array マスタデータ名の配列
function getMasterDataNames($ignores =
array()) {
$arrMasterDataName =
$dbFactory->findTableNames("mtb_");
foreach ($arrMasterDataName as $val) {
foreach ($ignores as $ignore) {
unset
($arrMasterDataName[$i]);
return $arrMasterDataName;
* 重複した値が存在する場合はエラーメッセージを表示する.
* @return void|stringエラーが発生した場合はエラーメッセージを返す.
function checkUniqueID() {
for ($i =
0; $i <
count($arrId); $i++
) {
for ($j =
$i +
1; $j <
count($arrId); $j++
) {
return $id .
" が重複しているため登録できません.";
Documentation generated on Tue, 28 Apr 2009 18:11:52 +0900 by phpDocumentor 1.4.2