+ add editor to productplan module.

This commit is contained in:
wangchunsheng
2010-11-24 05:37:19 +00:00
parent 20505d4f6e
commit a095ae15a0
6 changed files with 10 additions and 13 deletions
+3
View File
@@ -1,3 +1,6 @@
<?php
$config->productplan->create->requiredFields = 'title,begin,end';
$config->productplan->edit->requiredFields = 'title,begin,end';
$config->productplan->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
$config->productplan->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
+2 -9
View File
@@ -68,10 +68,7 @@ class productplanModel extends model
*/
public function create($product)
{
$plan = fixer::input('post')
->stripTags('title')
->specialChars('desc')
->get();
$plan = fixer::input('post')->stripTags('title')->get();
$this->dao->insert(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->batchCheck($this->config->productplan->create->requiredFields, 'notempty')->exec();
if(!dao::isError()) return $this->dao->lastInsertID();
}
@@ -86,13 +83,9 @@ class productplanModel extends model
public function update($planID)
{
$oldPlan = $this->getById($planID);
$plan = fixer::input('post')
->stripTags('title')
->specialChars('desc')
->get();
$plan = fixer::input('post')->stripTags('title')->get();
$this->dao->update(TABLE_PRODUCTPLAN)->data($plan)->autoCheck()->batchCheck($this->config->productplan->edit->requiredFields, 'notempty')->where('id')->eq((int)$planID)->exec();
if(!dao::isError()) return common::createChanges($oldPlan, $plan);
}
/**
+1 -1
View File
@@ -35,7 +35,7 @@
<td><?php echo $plan->begin;?></td>
<td><?php echo $plan->end;?></td>
<td class='a-left nobr'><?php echo html::a(inlink('view', "id=$plan->id"), $plan->title);?></td>
<td class='a-left nobr'><?php echo nl2br($plan->desc);?></td>
<td class='a-left nobr'><?php echo $plan->desc;?></td>
<td>
<?php
common::printLink('productplan', 'edit', "planID=$plan->id", $lang->edit);
+1 -1
View File
@@ -35,7 +35,7 @@
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->desc;?></th>
<td><?php echo html::textarea('desc', '', "rows='5' class='area-1'");?></td>
<td><?php echo html::textarea('desc', '', "rows='10' class='area-1'");?></td>
</tr>
<tr>
<td colspan='2' class='a-center'>
+2 -1
View File
@@ -12,6 +12,7 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<div class='yui-d0'>
<form method='post' target='hiddenwin'>
<table class='table-1'>
@@ -34,7 +35,7 @@
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->desc;?></th>
<td><?php echo html::textarea('desc', $plan->desc, "rows='5' class='area-1'");?></td>
<td><?php echo html::textarea('desc', htmlspecialchars($plan->desc), "rows='10' class='area-1'");?></td>
</tr>
<tr>
<td colspan='2' class='a-center'>
+1 -1
View File
@@ -29,7 +29,7 @@
</tr>
<tr>
<th class='rowhead'><?php echo $lang->productplan->desc;?></th>
<td><?php echo nl2br($plan->desc);?></th>
<td class='content'><?php echo $plan->desc;?></th>
</tr>
</table>
<div class='a-center f-16px strong'>