* code for task #1579.
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse company view file of admin module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package admin
|
||||
* @version $Id: browsecompany.html.php 4129 2013-01-18 01:58:14Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<table align='center' class='table-1'>
|
||||
<tr class='colhead'>
|
||||
<th><?php echo $lang->company->id;?></th>
|
||||
<th><?php echo $lang->company->name;?></th>
|
||||
<th><?php echo $lang->company->phone;?></th>
|
||||
<th><?php echo $lang->company->fax;?></th>
|
||||
<th><?php echo $lang->company->address;?></th>
|
||||
<th><?php echo $lang->company->zipcode;?></th>
|
||||
<th><?php echo $lang->company->website;?></th>
|
||||
<th><?php echo $lang->company->backyard;?></th>
|
||||
<th><?php echo $lang->company->pms;?></th>
|
||||
<th><?php echo $lang->company->guest;?></th>
|
||||
<th><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
<?php foreach($companies as $company):?>
|
||||
<tr>
|
||||
<td class='a-center'><?php echo $company->id;?></td>
|
||||
<td><?php echo $company->name;?></td>
|
||||
<td><?php echo $company->phone;?></td>
|
||||
<td><?php echo $company->fax;?></td>
|
||||
<td><?php echo $company->address;?></td>
|
||||
<td><?php echo $company->zipcode;?></td>
|
||||
<td><?php echo html::a($company->website, $company->website, '_blank');?></td>
|
||||
<td><?php echo html::a($company->backyard,$company->backyard, '_blank');?></td>
|
||||
<td><?php echo html::a('http://' . $company->pms, $company->pms, '_blank');?></td>
|
||||
<td><?php echo $lang->company->guestList[(int)$company->guest];?></td>
|
||||
<td>
|
||||
<?php echo html::a($this->createLink('company', 'edit', "companyID=$company->id"), $this->lang->company->edit);?>
|
||||
<?php echo html::a($this->createLink('company', 'delete', "companyID=$company->id"), $this->lang->company->delete, "hiddenwin");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -1,9 +1,7 @@
|
||||
<?php
|
||||
$config->company = new stdclass();
|
||||
$config->company->create = new stdclass();
|
||||
$config->company->edit = new stdclass();
|
||||
$config->company->create->requiredFields = 'name,pms';
|
||||
$config->company->edit->requiredFields = 'name,pms';
|
||||
$config->company->edit->requiredFields = 'name';
|
||||
|
||||
global $lang, $app;
|
||||
$app->loadLang('action');
|
||||
|
||||
@@ -108,34 +108,6 @@ class company extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a company.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->company->create();
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
die(js::locate($this->createLink('admin', 'browsecompany'), 'parent'));
|
||||
}
|
||||
|
||||
$this->lang->set('menugroup.company', 'admin');
|
||||
$this->lang->company->menu = $this->lang->admin->menu;
|
||||
$this->lang->company->menuOrder = $this->lang->admin->menuOrder;
|
||||
|
||||
$title = $this->lang->admin->common . $this->lang->colon . $this->lang->company->create;
|
||||
$position[] = html::a($this->createLink('admin', 'browsecompany'), $this->lang->admin->company);
|
||||
$position[] = $this->lang->company->create;
|
||||
$this->view->title = $title;
|
||||
$this->view->position = $position;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a company.
|
||||
*
|
||||
@@ -180,29 +152,6 @@ class company extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a company.
|
||||
*
|
||||
* @param int $companyID
|
||||
* @param string $confirm yes|no
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($companyID, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
echo js::confirm($this->lang->company->confirmDelete, $this->createLink('company', 'delete', "companyID=$companyID&confirm=yes"));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->company->delete($companyID);
|
||||
echo js::locate($this->createLink('admin', 'browseCompany'), 'parent');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Company dynamic.
|
||||
*
|
||||
|
||||
@@ -61,23 +61,6 @@ class companyModel extends model
|
||||
return $this->dao->findById((int)$companyID)->from(TABLE_COMPANY)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a company.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$company = fixer::input('post')->get();
|
||||
$this->dao->insert(TABLE_COMPANY)
|
||||
->data($company)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->company->create->requiredFields, 'notempty')
|
||||
->batchCheck('name,pms', 'unique')
|
||||
->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a company.
|
||||
*
|
||||
@@ -94,20 +77,8 @@ class companyModel extends model
|
||||
->data($company)
|
||||
->autoCheck()
|
||||
->batchCheck($this->config->company->edit->requiredFields, 'notempty')
|
||||
->batchCheck('name,pms', 'unique', "id != '$companyID'")
|
||||
->batchCheck('name', 'unique', "id != '$companyID'")
|
||||
->where('id')->eq($companyID)
|
||||
->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a company.
|
||||
*
|
||||
* @param int $companyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($companyID)
|
||||
{
|
||||
return $this->dao->delete()->from(TABLE_COMPANY)->where('id')->eq((int)$companyID)->limit(1)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view of company module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2013 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
|
||||
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @package company
|
||||
* @version $Id: create.html.php 4129 2013-01-18 01:58:14Z wwccss $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<form method='post' target='hiddenwin' id='dataform'>
|
||||
<table align='center' class='table-5'>
|
||||
<caption><?php echo $lang->company->create;?></caption>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->name;?></th>
|
||||
<td><?php echo html::input('name', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->phone;?></th>
|
||||
<td><?php echo html::input('phone', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->fax;?></th>
|
||||
<td><?php echo html::input('fax', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->address;?></th>
|
||||
<td><?php echo html::input('address', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->zipcode;?></th>
|
||||
<td><?php echo html::input('zipcode', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->website;?></th>
|
||||
<td><?php echo html::input('website', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->backyard;?></th>
|
||||
<td><?php echo html::input('backyard', '', "class='text-1'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class='rowhead'><?php echo $lang->company->guest;?></th>
|
||||
<td><?php echo html::radio('guest', $lang->company->guestList);?></td>
|
||||
</tr>
|
||||
<tr><td colspan='2' class='a-center'><?php echo html::submitButton();?></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -484,17 +484,13 @@ $lang->svn->methodOrder[15] = 'apiSync';
|
||||
$lang->resource->company = new stdclass();
|
||||
$lang->resource->company->index = 'index';
|
||||
$lang->resource->company->browse = 'browse';
|
||||
$lang->resource->company->create = 'create';
|
||||
$lang->resource->company->edit = 'edit';
|
||||
$lang->resource->company->view = 'view';
|
||||
$lang->resource->company->delete = 'delete';
|
||||
$lang->resource->company->dynamic= 'dynamic';
|
||||
|
||||
$lang->company->methodOrder[0] = 'index';
|
||||
$lang->company->methodOrder[5] = 'browse';
|
||||
$lang->company->methodOrder[10] = 'create';
|
||||
$lang->company->methodOrder[15] = 'edit';
|
||||
$lang->company->methodOrder[20] = 'delete';
|
||||
$lang->company->methodOrder[25] = 'dynamic';
|
||||
|
||||
/* Department. */
|
||||
|
||||
@@ -102,8 +102,6 @@ $lang->install->errorNotSaveConfig = "Hasn't save the config file. ";
|
||||
|
||||
$lang->install->getPriv = 'Set admin';
|
||||
$lang->install->company = 'Company name';
|
||||
$lang->install->pms = 'ZenTaoPMS domain';
|
||||
$lang->install->pmsNote = 'The domain name or ip address of ZenTaoPMS, no http://';
|
||||
$lang->install->account = 'Administrator';
|
||||
$lang->install->password = 'Admin password';
|
||||
$lang->install->errorEmptyPassword = "Can't be empty";
|
||||
|
||||
@@ -102,8 +102,6 @@ $lang->install->errorNotSaveConfig = '还没有保存配置文件';
|
||||
|
||||
$lang->install->getPriv = '设置帐号';
|
||||
$lang->install->company = '公司名称';
|
||||
$lang->install->pms = 'PMS地址';
|
||||
$lang->install->pmsNote = '即通过什么地址可以访问到禅道项目管理,设置域名或者IP地址即可,不需要http';
|
||||
$lang->install->account = '管理员帐号';
|
||||
$lang->install->password = '管理员密码';
|
||||
$lang->install->errorEmptyPassword = '密码不能为空';
|
||||
|
||||
@@ -597,7 +597,6 @@ class user extends control
|
||||
{
|
||||
if(strpos($this->referer, $loginLink) === false and
|
||||
strpos($this->referer, $denyLink) === false and
|
||||
strpos($this->referer, $this->app->company->pms) !== false
|
||||
)
|
||||
{
|
||||
$this->locate($this->referer);
|
||||
|
||||
Reference in New Issue
Block a user