* Add type field for doc lib.

This commit is contained in:
chenfeiCF
2018-10-16 13:25:21 +08:00
parent 32866fcaf2
commit 6d90d291cf
4 changed files with 10 additions and 6 deletions
+5
View File
@@ -4,3 +4,8 @@ CHANGE `projects` `projects` mediumtext COLLATE 'utf8_general_ci' NOT NULL AFTER
ALTER TABLE `zt_task` ADD `finishedList` text NOT NULL AFTER `finishedDate`;
update zt_config set `value` = 'files,customFiles' where `module` = 'doc' and `section` = 'custom' and `key` = 'objectLibs';
ALTER TABLE `zt_file` CHANGE `title` `title` varchar(255) COLLATE 'utf8_general_ci' NOT NULL AFTER `pathname`;
ALTER TABLE `zt_doclib` ADD `type` varchar(30) COLLATE 'utf8_general_ci' NOT NULL AFTER `id`, COMMENT='';
UPDATE `zt_doclib` SET `type` = 'product' WHERE `product` > 0;
UPDATE `zt_doclib` SET `type` = 'project' WHERE `project` > 0;
UPDATE `zt_doclib` SET `type` = 'custom' WHERE `product` = 0 AND `project` = 0;
+2 -2
View File
@@ -1,11 +1,11 @@
$(function()
{
$('#libType').change(function()
$('#type').change(function()
{
var libType = $(this).val();
changeByLibType(libType);
})
changeByLibType($('#libType').val());
changeByLibType($('#type').val());
toggleAcl($('#acl').val());
});
+2 -3
View File
@@ -273,11 +273,10 @@ class docModel extends model
public function createLib()
{
$lib = fixer::input('post')
->setForce('product', $this->post->libType == 'product' ? $this->post->product : 0)
->setForce('project', $this->post->libType == 'project' ? $this->post->project : 0)
->setForce('product', $this->post->type == 'product' ? $this->post->product : 0)
->setForce('project', $this->post->type == 'project' ? $this->post->project : 0)
->join('groups', ',')
->join('users', ',')
->remove('libType')
->get();
if($lib->acl == 'private') $lib->users = $this->app->user->account;
+1 -1
View File
@@ -23,7 +23,7 @@
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->doc->libType?></th>
<td><?php echo html::select('libType', $libTypeList, $type, "class='form-control'")?></td>
<td><?php echo html::select('type', $libTypeList, $type, "class='form-control'")?></td>
</tr>
<tr class='product'>
<th><?php echo $lang->doc->product?></th>