#19690583 Description attribute/column for document_category table added

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8305 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
mosmartin 2011-04-13 12:09:29 +00:00
parent 0e408aa459
commit 0500c227a3
9 changed files with 41 additions and 6 deletions

View file

@ -96,8 +96,11 @@
if(!$oDB->isColumnExists("document_extra_keys","eid")) return true;
if(!$oDB->isColumnExists("document_extra_vars","eid")) return true;
// 2011. 03. 30 Cubrid index 추가 요청
// 2011. 03. 30 Cubrid index Check the index in the document_extra_vars table
if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) return true;
//2011. 04. 07 adding description column to document categories
if(!$oDB->isColumnExists("document_categories","description")) return true;
return false;
}
@ -226,10 +229,13 @@
}
}
// 2011. 03. 30 Cubrid index 추가 요청
// 2011. 03. 30 Cubrid index Check the index in the document_extra_vars table
if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) {
$oDB->addIndex("document_extra_vars", "idx_document_list_order", array("document_srl","module_srl","var_idx"), false);
}
//2011. 04. 07 adding description column to document categories
if(!$oDB->isColumnExists("document_categories","description")) $oDB->addColumn('document_categories',"description","varchar",2000,0);
return new Object(0,'success_updated');

View file

@ -1015,7 +1015,7 @@ class documentController extends document {
**/
function procDocumentInsertCategory($args = null) {
// List variables
if(!$args) $args = Context::gets('module_srl','category_srl','parent_srl','title','expand','group_srls','color','mid');
if(!$args) $args = Context::gets('module_srl','category_srl','parent_srl','title','description','expand','group_srls','color','mid');
if(!$args->module_srl && $args->mid){
$mid = $args->mid;
@ -1306,6 +1306,7 @@ class documentController extends document {
$module_srl = $node->module_srl;
$parent_srl = $node->parent_srl;
$color = $node->color;
$description = $node->description;
// If node->group_srls value exists
if($group_srls) $group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s)))))',$group_srls);
else $group_check_code = "true";
@ -1314,9 +1315,12 @@ class documentController extends document {
$oModuleAdminModel = &getAdminModel('module');
$langs = $oModuleAdminModel->getLangCode($site_srl, $title);
if(count($langs)) foreach($langs as $key => $val) $xml_header_buff .= sprintf('$_titles[%d]["%s"] = "%s"; ', $category_srl, $key, str_replace('"','\\"',htmlspecialchars($val)));
$langx = $oModuleAdminModel->getLangCode($site_srl, $description);
if(count($langx)) foreach($langx as $key => $val) $xml_header_buff .= sprintf('$_descriptions[%d]["%s"] = "%s"; ', $category_srl, $key, str_replace('"','\\"',htmlspecialchars($val)));
$attribute = sprintf(
'mid="%s" module_srl="%d" node_srl="%d" parent_srl="%d" category_srl="%d" text="<?php echo (%s?($_titles[%d][$lang_type]):"")?>" url="%s" expand="%s" color="%s" document_count="%d" ',
'mid="%s" module_srl="%d" node_srl="%d" parent_srl="%d" category_srl="%d" text="<?php echo (%s?($_titles[%d][$lang_type]):"")?>" url="%s" expand="%s" color="%s" description="<?php echo (%s?($_descriptions[%d][$lang_type]):"")?>" document_count="%d" ',
$mid,
$module_srl,
$category_srl,
@ -1327,6 +1331,8 @@ class documentController extends document {
getUrl('','mid',$node->mid,'category',$category_srl),
$expand,
$color,
$group_check_code,
$category_srl,
$node->document_count
);
@ -1362,12 +1368,15 @@ class documentController extends document {
$expand = $node->expand;
$title = $node->title;
$description= $node->description;
$oModuleAdminModel = &getAdminModel('module');
$langs = $oModuleAdminModel->getLangCode($site_srl, $title);
if(count($langs)) foreach($langs as $key => $val) $php_header_buff .= sprintf('$_titles[%d]["%s"] = "%s"; ', $category_srl, $key, str_replace('"','\\"',htmlspecialchars($val)));
$langx = $oModuleAdminModel->getLangCode($site_srl, $description);
if(count($langx)) foreach($langx as $key => $val) $php_header_buff .= sprintf('$_descriptions[%d]["%s"] = "%s"; ', $category_srl, $key, str_replace('"','\\"',htmlspecialchars($val)));
// Create attributes(Use the category_srl_list to check whether to belong to the menu's node. It seems to be tricky but fast fast and powerful;)
$attribute = sprintf(
'"mid" => "%s", "module_srl" => "%d","node_srl"=>"%s","category_srl"=>"%s","parent_srl"=>"%s","text"=>$_titles[%d][$lang_type],"selected"=>(in_array(Context::get("category"),array(%s))?1:0),"expand"=>"%s","color"=>"%s", "list"=>array(%s),"document_count"=>"%d","grant"=>%s?true:false',
'"mid" => "%s", "module_srl" => "%d","node_srl"=>"%s","category_srl"=>"%s","parent_srl"=>"%s","text"=>$_titles[%d][$lang_type],"selected"=>(in_array(Context::get("category"),array(%s))?1:0),"expand"=>"%s","color"=>"%s","description"=>$_descriptions[%d][$lang_type],"list"=>array(%s),"document_count"=>"%d","grant"=>%s?true:false',
$node->mid,
$node->module_srl,
$node->category_srl,
@ -1377,6 +1386,7 @@ class documentController extends document {
$selected,
$expand,
$node->color,
$node->category_srl,
$child_buff,
$node->document_count,
$group_check_code

View file

@ -346,6 +346,7 @@
**/
function getNoticeList($obj) {
$args->module_srl = $obj->module_srl;
$args->category_srl= $obj->category_srl;
$output = executeQueryArray('document.getNoticeList', $args);
if(!$output->toBool()||!$output->data) return;
@ -607,6 +608,7 @@
$obj->category_srl = $val['category_srl'];
$obj->parent_srl = $val['parent_srl'];
$obj->title = $obj->text = $val['text'];
$obj->description = $val['description'];
$obj->expand = $val['expand']=='Y'?true:false;
$obj->color = $val['color'];
$obj->document_count = $val['document_count'];

View file

@ -96,4 +96,7 @@
$lang->success_trashed = "Successfully moved to trashcan";
$lang->msg_not_selected_document = 'There are no selected articles.';
$lang->show_voted_member = 'Show Voters';
$lang->category_description = 'Description';
$lang->about_category_description='Please input a category description';
?>

View file

@ -6,6 +6,7 @@
<column name="category_srl" var="category_srl" filter="number" notnull="notnull" />
<column name="module_srl" var="module_srl" filter="number" default="0" notnull="notnull" />
<column name="title" var="title" notnull="notnull" minlength="1" maxlength="250" />
<column name="description" var="description" maxlength="2000"/>
<column name="document_count" var="document_count" default="0" />
<column name="regdate" var="regdate" default="curdate()" />
<column name="expand" var="expand" />

View file

@ -4,6 +4,7 @@
</tables>
<columns>
<column name="title" var="title" />
<column name="description" var="description" />
<column name="list_order" var="list_order" />
<column name="last_update" var="last_update" default="curdate()" />
<column name="expand" var="expand" />

View file

@ -10,4 +10,5 @@
<column name="list_order" type="number" size="11" notnull="notnull" />
<column name="group_srls" type="text" />
<column name="color" type="varchar" size="11" />
<column name="description" type="varchar" size="2000" />
</table>

View file

@ -30,6 +30,16 @@
<p>{$lang->about_category_color}</p>
</td>
</tr>
<tr>
<th scope="row"><div>{$lang->category_description}</div></th>
<td class="wide">
<textarea name="category_description" id="category_description" class="inputTypeTextArea">{htmlspecialchars($category_info->description)}</textarea>
<a href="{getUrl('','module','module','act','dispModuleAdminLangcode','target','category_description')}" onclick="popopen(this.href);return false;" class="buttonSet buttonSetting"><span>{$lang->cmd_find_langcode}</span></a>
<p>{$lang->about_category_description}</p>
</td>
</tr>
<tr>
<th scope="row"><div>{$lang->expand}</div></th>
<td>

View file

@ -9,6 +9,7 @@
<param name="category_srl" target="category_srl" />
<param name="parent_srl" target="parent_srl" />
<param name="title" target="category_title" />
<param name="description" target="category_description" />
<param name="color" target="category_color" />
<param name="expand" target="expand" />
<param name="group_srls" target="group_srls" />