mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
when migration to 1.7, if url is empty, shortcut type change to 'Y'
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12148 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e63d71738b
commit
e8b7ba2711
3 changed files with 43 additions and 0 deletions
|
|
@ -38,6 +38,11 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute update
|
||||
* @return Object
|
||||
|
|
@ -57,6 +62,32 @@
|
|||
if(!$oDB->isColumnExists('menu_item', 'is_shortcut'))
|
||||
{
|
||||
$oDB->addColumn('menu_item', 'is_shortcut', 'char', 1, 'N');
|
||||
|
||||
// check empty url and change shortcut type
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$output = $oMenuAdminModel->getMenus();
|
||||
|
||||
if(is_array($output))
|
||||
{
|
||||
foreach($output AS $key=>$value)
|
||||
{
|
||||
unset($args);
|
||||
$args->menu_srl = $value->menu_srl;
|
||||
$output2 = executeQueryArray('menu.getMenuItems', $args);
|
||||
if(is_array($output2->data))
|
||||
{
|
||||
foreach($output2->data AS $key2=>$value2)
|
||||
{
|
||||
if($value2->is_shortcut == 'N' && !$value2->url)
|
||||
{
|
||||
$value2->is_shortcut = 'Y';
|
||||
|
||||
$output3 = executeQuery('menu.updateMenuItem', $value2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
<column name="parent_srl" var="parent_srl" />
|
||||
<column name="name" var="name" notnull="notnull" />
|
||||
<column name="url" var="url" />
|
||||
<column name="is_shortcut" var="is_shortcut" />
|
||||
<column name="open_window" var="open_window" />
|
||||
<column name="expand" var="expand" />
|
||||
<column name="normal_btn" var="normal_btn" />
|
||||
|
|
|
|||
11
modules/menu/queries/updateMenuShortcutForMigration.xml
Normal file
11
modules/menu/queries/updateMenuShortcutForMigration.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="updateMenuShortcutForMigration" action="update">
|
||||
<tables>
|
||||
<table name="menu_item" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="is_shortcut" var="is_shortcut" default="Y" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="menu_item_srl" var="menu_item_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
Loading…
Add table
Add a link
Reference in a new issue