translation

This commit is contained in:
wlx 2013-11-11 08:10:13 +00:00
parent 1a394fe8ef
commit 3bf9812d72
8 changed files with 92 additions and 398 deletions

View File

@ -961,327 +961,19 @@ class DataController extends Zend_Controller_Action
$mailtp=new EmailText($this->db,'online-download-en',$data); $mail=new WestdcMailer($this->view->config->smtp); $mail->setBodyText($mailtp->getBody()); $mail->setFrom($this->view->config->service->email,'CARD data service'); $mail->addTo($user->email); $mail->setSubject($mailtp->getSubject()); @$mail->send(); $mailtp=new EmailText($this->db,'online-download-en',$data); $mail=new WestdcMailer($this->view->config->smtp); $mail->setBodyText($mailtp->getBody()); $mail->setFrom($this->view->config->service->email,'CARD data service'); $mail->addTo($user->email); $mail->setSubject($mailtp->getSubject()); @$mail->send();
$sql="update onlineapp set has_send_mail=true where id=?"; $sth=$this->db->prepare($sql); $sth->execute(array($onlineappid)); } } $sql="update onlineapp set has_send_mail=true where id=?"; $sth=$this->db->prepare($sql); $sth->execute(array($onlineappid)); } }
/* /* * 离线申请(可以包括在线数据),在无数据参数时,则显示已有列表 */ function orderAction() { $this->view->pageID = "account-dataorder"; $ac = $this->_request->getParam('ac'); $uuid = $this->_request->getParam('uuid'); $del = $this->_request->getParam('del'); $apply = $this->_request->getParam('apply'); $finish = $this->_request->getParam('finish'); $cancel = $this->_request->getParam('cancel'); $wsn = $this->_request->getParam('wsn'); $pdf = $this->_request->getParam('pdf'); $selections = $this->_request->getParam('data'); //if (empty($uuid)) $this->_redirect('/data'); $userid = view::User('id'); //添加到数据篮 if ($uuid) { //存在历史遗留问题,原来的数据并不能保证唯一 $order = new Order(); $state = $order->addOrder($uuid); if($state !== true) { if(!is_array($state)) { $this->view->msg = view::Msg('alert-error',$state); }else{ $service_type = $order->serviceTypeTest($state['service_type']); if($service_type !== false) { view::Post($this,$service_type,$state['service_url']."?href=".urlencode(view::getHostLink()."/data/order/")."&uuid=".$state['uuid']."&uid=".$userid); }else{ $this->view->msg = view::Msg('alert-error',"Error: could not add this dataset."); } } }else{ $this->view->msg = view::Msg('alert-success',"Success! You can add more dataset or submit your application."); } if (empty($ac)) $ac='offline1'; } elseif ($selections) { if(empty($uuid)) { $this->view->msg = view::Msg('alert-error',"Error: Wrong parameter."); } $order = new Order(); $state = $order->addOrder($uuid,$selections); if($state !== true) { $this->view->msg = view::Msg('alert-error',$state); }else{ $this->view->msg = view::Msg('alert-success',"Success! You can add more dataset or submit your application."); } if (empty($ac)) $ac='offline1'; } //删除申请 elseif ($del) { $order = new Order(); $state = $order->del($del); if($state !== true) { $this->view->msg = view::Msg('alert-error',$state); }else{ $this->view->msg = view::Msg('alert-success',"The order is canceled."); } $this->_redirect('/data/order'); } //提交申请 elseif ($apply) { if($apply == "all" || !is_numeric($apply)) { $apply = -1; }
* 离线申请(可以包括在线数据),在无数据参数时,则显示已有列表 $order = new Order(); $state = $order->apply($apply); if($state !== true) { $this->view->msg = view::Msg('alert-error',$state); }else{ $this->view->msg = view::Msg('alert-success',"Please click Submitting to generate your pdf Order."); } if (empty($ac)) $ac='offline2'; } //完成 elseif ($finish) { if ($finish=='all') { $sql=$this->db->quoteInto("update dataorder set ts_approved=now() where status=0 and userid=?",$userid); $this->db->query($sql); $sql="update ftpuser set datacount=0 where userid=?"; $this->db->query($sql,array($userid)); } else { $sql="update dataorder set ts_approved=now() where status=0 and userid=? and id=?"; $this->db->query($sql,array($userid,(int)$finish)); $sql="update ftpuser set datacount=datacount-1 where userid=? and datacount>0"; $this->db->query($sql,array($userid)); } } elseif($wsn){ $this->_helper->viewRenderer('order-wsn'); return true; }
*/ elseif ($cancel) { if ($cancel=='all') { $sql=$this->db->quoteInto("update dataorder set ts_approved=now(),status=-1 where status=0 and userid=?",$userid); $this->db->query($sql); $sql="update ftpuser set datacount=0 where userid=?"; $this->db->query($sql,array($userid)); } else { $sql="update dataorder set ts_approved=now(),status=-1 where status in (0,1,2) and userid=? and id=?"; $this->db->query($sql,array($userid,(int)$cancel)); $sql="update ftpuser set datacount=datacount-1 where userid=? and datacount>0"; $this->db->query($sql,array($userid)); } if (empty($ac)) $ac='offline2'; } //生成PDF离线申请文件 elseif ($pdf) { //用户信息可以从SESSION中读取离线申请信息 //$sql="select * from users where id=?"; $order = new Order(); $rows = $order->getOrderItemForPdf(); $this->view->projectType = $order->projectType; if ($rows) { $this->_helper->viewRenderer('pdf'); $this->view->data2 = $rows; if ($this->_request->isPost()) { $this->view->formData = $formData = $this->_request->getPost(); $datalist=''; foreach($rows as $i=>$row) { $datalist.=($i+1).". ".$row['title'].";"; } $formData['datalist'] = $datalist; if (@$formData['save']) { $order->setPdfData($rows); $s = $order->SaveOrder($formData); if($s !== true) { $this->view->error = view::Msg('alert-error',$s); return true; } //不能修改顺序 $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(); return true; } elseif ($formData['submit']) { //生成PDF $order->setPdfData($rows); $s = $order->SubmitOrder($formData); if($s !== true) { $this->view->error = view::Msg('alert-error',$s); return true; }
function orderAction() $this->view->msg = view::Msg('alert-success','Message: Your offline order is submitted. Please <a href="/data/order/ac/offline3">upload your PDF with personal signature</a>.',0); if (empty($ac)) $ac='offline3'; } } else { $sql="select u.* from users u left join offlineapp o on u.id=o.userid where u.id=? ORDER BY o.id DESC"; $row=$this->db->fetchRow($sql,array($userid)); $this->view->formData = $row; } } else{ $this->view->msg=view::Msg('alert-error',"Error: You have not submitted any order, or you need to wait the auditing.",0); } return true; }//pdf if($ac == "commitapplicationform") { $offlineappid = $this->_getParam('offlineappid'); if(!is_numeric($offlineappid) || $offlineappid < 1) { view::Post($this,"Wrong parameter",-1); return true; } $order = new Order(); $status = $order->commitApplicationForm($offlineappid); if( $status !== true) { view::Post($this,$status,-1); }else{ view::Post($this,"Your order has submitted, please wait CARD receive your order.",'/data/order/ac/offline3'); } return true; }
//index $this->view->ac = $ac; $this->_helper->viewRenderer('order'); if ($ac=='' || $ac=='online') { $this->view->tabID='order-online'; } else if ($ac=='offline1') { $this->view->tabID='order-offline1'; } else if ($ac=='offline2') { $this->view->tabID='order-offline2'; } else if ($ac=='offline3') { $this->view->tabID='order-offline3'; } else if ($ac=='offline4') { $this->view->tabID='order-offline4'; }
//显示已经申请的数据,包括已经提交的申请和未提交的申请,还有已经处理完成的申请,正在进行的在线数据下载 $sql="select d.*,m.title,m.datatype,off.applicationform from dataorder d right join en.metadata m on d.uuid=m.uuid left join offlineapp off ON off.id = d.offlineappid where d.userid=? order by d.status,d.ts_created desc"; $rows=$this->db->fetchAll($sql,array($userid)); $showorders = array(); $counts = array( 'onlineapp' => 0, 'offline1' => 0, 'offline2' => 0, 'offline3' => 0, 'offline4' => 0 ); if(count($rows) > 0) { foreach($rows as $k=>$v) { switch($v['status']) { case 0: $counts['onlineapp'] ++; break; case 1: $counts['offline1'] ++; break; case 2: $counts['offline2'] ++; break; case 3: $counts['offline3'] ++; break; case 4: $counts['offline3'] ++; break; case 5: $counts['offline4'] ++; break; }
switch($ac){ default : if($v['status'] == 0 && !empty($v['ts_approved']))$showorders[] = $rows[$k]; break; case 'online' : if($v['status'] == 0 && !empty($v['ts_approved']))$showorders[] = $rows[$k]; break; case 'offline1' : if($v['status'] == 1) $showorders[] = $rows[$k]; break; case 'offline2' : if($v['status'] == 2)
{ {
$this->view->pageID = "account-dataorder"; $showorders[] = $rows[$k]; $this->view->offlineappid = $v['offlineappid']; $this->view->applicationform = $v['applicationform']; $this->view->offlineappstatus = $v['status'];
$ac = $this->_request->getParam('ac'); } break; case 'offline3' : if($v['status'] == 3 || $v['status'] == 4)
$uuid = $this->_request->getParam('uuid');
$del = $this->_request->getParam('del');
$apply = $this->_request->getParam('apply');
$finish = $this->_request->getParam('finish');
$cancel = $this->_request->getParam('cancel');
$wsn = $this->_request->getParam('wsn');
$pdf = $this->_request->getParam('pdf');
$selections = $this->_request->getParam('data');
//if (empty($uuid)) $this->_redirect('/data');
$userid = view::User('id');
//添加到数据篮
if ($uuid)
{ {
//存在历史遗留问题,原来的数据并不能保证唯一 $showorders[] = $rows[$k]; $this->view->offlineappid = $v['offlineappid']; $this->view->applicationform = $v['applicationform']; $this->view->offlineappstatus = $v['status'];
} break; case 'offline4' : if($v['status'] == 5) $showorders[] = $rows[$k]; break; } } } $this->view->counts = $counts; view::addPaginator($showorders,$this,10); }
$order = new Order();
$state = $order->addOrder($uuid);
if($state !== true)
{
if(!is_array($state))
{
$this->view->msg = view::Msg('alert-error',$state);
}else{
$service_type = $order->serviceTypeTest($state['service_type']);
if($service_type !== false)
{
view::Post($this,$service_type,$state['service_url']."?href=".urlencode(view::getHostLink()."/data/order/")."&uuid=".$state['uuid']."&uid=".$userid);
}else{
$this->view->msg = view::Msg('alert-error',"Error: could not add this dataset.");
}
}
}else{
$this->view->msg = view::Msg('alert-success',"Success! You can add more dataset or submit your application.");
}
if (empty($ac)) $ac='offline1';
}
elseif ($selections)
{
if(empty($uuid))
{
$this->view->msg = view::Msg('alert-error',"Error: Wrong parameter.");
}
$order = new Order();
$state = $order->addOrder($uuid,$selections);
if($state !== true)
{
$this->view->msg = view::Msg('alert-error',$state);
}else{
$this->view->msg = view::Msg('alert-success',"Success! You can add more dataset or submit your application.");
}
if (empty($ac)) $ac='offline1';
}
//删除申请
elseif ($del) {
$order = new Order();
$state = $order->del($del);
if($state !== true)
{
$this->view->msg = view::Msg('alert-error',$state);
}else{
$this->view->msg = view::Msg('alert-success',"The order is canceled.");
}
$this->_redirect('/data/order');
}
//提交申请
elseif ($apply) {
if($apply == "all" || !is_numeric($apply))
{
$apply = -1;
}
$order = new Order();
$state = $order->apply($apply);
if($state !== true)
{
$this->view->msg = view::Msg('alert-error',$state);
}else{
$this->view->msg = view::Msg('alert-success',"提交成功您可以点击“提交离线申请”来生成PDF申请表");
}
if (empty($ac)) $ac='offline2';
}
//完成
elseif ($finish) {
if ($finish=='all') {
$sql=$this->db->quoteInto("update dataorder set ts_approved=now() where status=0 and userid=?",$userid);
$this->db->query($sql);
$sql="update ftpuser set datacount=0 where userid=?";
$this->db->query($sql,array($userid));
} else {
$sql="update dataorder set ts_approved=now() where status=0 and userid=? and id=?";
$this->db->query($sql,array($userid,(int)$finish));
$sql="update ftpuser set datacount=datacount-1 where userid=? and datacount>0";
$this->db->query($sql,array($userid));
}
}
elseif($wsn)
{
$this->_helper->viewRenderer('order-wsn');
return true;
}
elseif ($cancel) {
if ($cancel=='all') {
$sql=$this->db->quoteInto("update dataorder set ts_approved=now(),status=-1 where status=0 and userid=?",$userid);
$this->db->query($sql);
$sql="update ftpuser set datacount=0 where userid=?";
$this->db->query($sql,array($userid));
} else {
$sql="update dataorder set ts_approved=now(),status=-1 where status in (0,1,2) and userid=? and id=?";
$this->db->query($sql,array($userid,(int)$cancel));
$sql="update ftpuser set datacount=datacount-1 where userid=? and datacount>0";
$this->db->query($sql,array($userid));
}
if (empty($ac)) $ac='offline2';
}
//生成PDF离线申请文件
elseif ($pdf) {
//用户信息可以从SESSION中读取离线申请信息
//$sql="select * from users where id=?";
$order = new Order();
$rows = $order->getOrderItemForPdf();
$this->view->projectType = $order->projectType;
if ($rows) {
$this->_helper->viewRenderer('pdf');
$this->view->data2 = $rows;
if ($this->_request->isPost()) {
$this->view->formData = $formData = $this->_request->getPost();
$datalist='';
foreach($rows as $i=>$row)
{
$datalist.=($i+1).". ".$row['title'].";";
}
$formData['datalist'] = $datalist;
if (@$formData['save']) {
$order->setPdfData($rows);
$s = $order->SaveOrder($formData);
if($s !== true)
{
$this->view->error = view::Msg('alert-error',$s);
return true;
}
//不能修改顺序
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
return true;
} elseif ($formData['submit']) {
//生成PDF
$order->setPdfData($rows);
$s = $order->SubmitOrder($formData);
if($s !== true)
{
$this->view->error = view::Msg('alert-error',$s);
return true;
}
$this->view->msg = view::Msg('alert-success','提示信息:您的离线申请已经提交,请<a href="/data/order/ac/offline3">在线上传PDF的签字版PDF文件</a>。',0);
if (empty($ac)) $ac='offline3';
}
} else {
$sql="select u.* from users u left join offlineapp o on u.id=o.userid where u.id=? ORDER BY o.id DESC";
$row=$this->db->fetchRow($sql,array($userid));
$this->view->formData = $row;
}
} else{
$this->view->msg=view::Msg('alert-error',"错误:您还没有提交任何离线申请的数据,或您的数据申请已经提交(等待处理过程中)!",0);
}
return true;
}//pdf
if($ac == "commitapplicationform")
{
$offlineappid = $this->_getParam('offlineappid');
if(!is_numeric($offlineappid) || $offlineappid < 1)
{
view::Post($this,"参数错误",-1);
return true;
}
$order = new Order();
$status = $order->commitApplicationForm($offlineappid);
if( $status !== true)
{
view::Post($this,$status,-1);
}else{
view::Post($this,"申请已提交,请等待管理员接收并通过数据所有者审核",'/data/order/ac/offline3');
}
return true;
}
//index
$this->view->ac = $ac;
$this->_helper->viewRenderer('order');
if ($ac=='' || $ac=='online')
{
$this->view->tabID='order-online';
} else if ($ac=='offline1') {
$this->view->tabID='order-offline1';
} else if ($ac=='offline2') {
$this->view->tabID='order-offline2';
} else if ($ac=='offline3') {
$this->view->tabID='order-offline3';
} else if ($ac=='offline4') {
$this->view->tabID='order-offline4';
}
//显示已经申请的数据,包括已经提交的申请和未提交的申请,还有已经处理完成的申请,正在进行的在线数据下载
$sql="select d.*,m.title,m.datatype,off.applicationform from dataorder d
left join metadata m on d.uuid=m.uuid
left join offlineapp off ON off.id = d.offlineappid
where d.userid=? order by d.status,d.ts_created desc";
$rows=$this->db->fetchAll($sql,array($userid));
$showorders = array();
$counts = array(
'onlineapp' => 0,
'offline1' => 0,
'offline2' => 0,
'offline3' => 0,
'offline4' => 0
);
if(count($rows) > 0) {
foreach($rows as $k=>$v)
{
switch($v['status']) {
case 0:
$counts['onlineapp'] ++;
break;
case 1:
$counts['offline1'] ++;
break;
case 2:
$counts['offline2'] ++;
break;
case 3:
$counts['offline3'] ++;
break;
case 4:
$counts['offline3'] ++;
break;
case 5:
$counts['offline4'] ++;
break;
}
switch($ac){
default :
if($v['status'] == 0 && !empty($v['ts_approved']))$showorders[] = $rows[$k];
break;
case 'online' :
if($v['status'] == 0 && !empty($v['ts_approved']))$showorders[] = $rows[$k];
break;
case 'offline1' :
if($v['status'] == 1) $showorders[] = $rows[$k];
break;
case 'offline2' :
if($v['status'] == 2)
{
$showorders[] = $rows[$k];
$this->view->offlineappid = $v['offlineappid'];
$this->view->applicationform = $v['applicationform'];
$this->view->offlineappstatus = $v['status'];
}
break;
case 'offline3' :
if($v['status'] == 3 || $v['status'] == 4)
{
$showorders[] = $rows[$k];
$this->view->offlineappid = $v['offlineappid'];
$this->view->applicationform = $v['applicationform'];
$this->view->offlineappstatus = $v['status'];
}
break;
case 'offline4' :
if($v['status'] == 5) $showorders[] = $rows[$k];
break;
}
}
}
$this->view->counts = $counts;
view::addPaginator($showorders,$this,10);
}
/* * 查看数据缩略图 */ function thumbAction() { $page=(int)$this->_request->getParam('page'); if (empty($page)) $page=1; $offset=$this->limit*($page-1); $state=$this->db->query("select count(*) from en.normalmetadata"); $row=$state->fetchAll(); $sum=$row[0]['count']; $select=$this->db->select(); $select->from('en.normalmetadata as m','m.*') ->order('m.title desc')->limitPage($page,9); $this->view->metadata = $this->db->fetchAll($select); $this->view->page=new Pagination($sum,$page,$this->limit); } /* * 查看数据缩略图 */ function thumbAction() { $page=(int)$this->_request->getParam('page'); if (empty($page)) $page=1; $offset=$this->limit*($page-1); $state=$this->db->query("select count(*) from en.normalmetadata"); $row=$state->fetchAll(); $sum=$row[0]['count']; $select=$this->db->select(); $select->from('en.normalmetadata as m','m.*') ->order('m.title desc')->limitPage($page,9); $this->view->metadata = $this->db->fetchAll($select); $this->view->page=new Pagination($sum,$page,$this->limit); }

View File

@ -1,6 +1,6 @@
<?php <?php
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('我的账户'); $this->headTitle('My account');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
?> ?>
<div class="row"> <div class="row">
@ -10,7 +10,7 @@
</div><!--/.well --> </div><!--/.well -->
</div><!--/span--> </div><!--/span-->
<div class="span9"> <div class="span9">
<h3>修改账户信息</h3> <h3>Setting</h3>
<hr /> <hr />
<?php if(!empty($this->msg)) { ?> <?php if(!empty($this->msg)) { ?>
<?php if(!empty($this->jump_url)) {?> <?php if(!empty($this->jump_url)) {?>
@ -19,7 +19,7 @@
<?php echo $this->msg ?> <?php echo $this->msg ?>
</div> </div>
<?php if(!empty($this->jump_url)) { ?> <?php if(!empty($this->jump_url)) { ?>
<br /><a href="<?= $this->jump_url ?>">如果页面没有自动跳转请点击这里</a> <br /><a href="<?= $this->jump_url ?>">Please click this url if you could not auto jump.</a>
<script language="javascript">setTimeout("self.location='<?php echo $this->jump_url ?>'",3000);</script> <script language="javascript">setTimeout("self.location='<?php echo $this->jump_url ?>'",3000);</script>
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
@ -38,44 +38,45 @@
<?php } ?> <?php } ?>
<form action="/account/edit" method="post" class="form-horizontal"> <form action="/account/edit" method="post" class="form-horizontal">
<div class="control-group "> <div class="control-group ">
<label class="control-label">头像</label> <label class="control-label">Gravatar</label>
<div class="controls"> <div class="controls">
<img src="<?= $this->avatar ?>" class="img-polaroid"> <img src="<?= $this->avatar ?>" class="img-polaroid">
<span class="help-inline">您的头像信息使用<a href="https://cn.gravatar.com/">Gravatar</a>头像信息<br />请使用西部数据中心注册的Email账号在<a href="https://cn.gravatar.com/">Gravatar</a>网站设置头像<br />设置好头像后重新登录网站即可更新头像</span> <span class="help-inline">Your gravatar use <a href="https://cn.gravatar.com/">Gravatar</a>.<br />Please use the email you registered in CARD register in
<a href="https://cn.gravatar.com/">Gravatar</a> to set the gravatar.<br />You need re-login to change the gravatar.</span>
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">真实姓名</label> <label class="control-label">Real name</label>
<div class="controls"> <div class="controls">
<input type="text" name="realname" value="<?php echo empty($this->info['realname']) ? "":$this->info['realname']; ?>" /> <input type="text" name="realname" value="<?php echo empty($this->info['realname']) ? "":$this->info['realname']; ?>" />
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">工作单位</label> <label class="control-label">Organization</label>
<div class="controls"> <div class="controls">
<input type="text" name="unit" value="<?php echo empty($this->info['unit']) ? "":$this->info['unit']; ?>" class="span8" /> <input type="text" name="unit" value="<?php echo empty($this->info['unit']) ? "":$this->info['unit']; ?>" class="span8" />
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">联系地址</label> <label class="control-label">Address</label>
<div class="controls"> <div class="controls">
<input type="text" name="address" value="<?php echo empty($this->info['address']) ? "":$this->info['address']; ?>" class="span8" /> <input type="text" name="address" value="<?php echo empty($this->info['address']) ? "":$this->info['address']; ?>" class="span8" />
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">联系电话</label> <label class="control-label">Phone</label>
<div class="controls"> <div class="controls">
<input type="text" name="phone" value="<?php echo empty($this->info['phone']) ? "":$this->info['phone']; ?>" /> <input type="text" name="phone" value="<?php echo empty($this->info['phone']) ? "":$this->info['phone']; ?>" />
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">邮编</label> <label class="control-label">Zip code</label>
<div class="controls"> <div class="controls">
<input type="text" name="postcode" value="<?php echo empty($this->info['postcode']) ? "":$this->info['postcode']; ?>" /> <input type="text" name="postcode" value="<?php echo empty($this->info['postcode']) ? "":$this->info['postcode']; ?>" />
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">项目类型</label> <label class="control-label">Fund type</label>
<div class="controls"> <div class="controls">
<select id="project_type" name="project_type"> <select id="project_type" name="project_type">
<?php if(!empty($this->projectType)) { ?> <?php if(!empty($this->projectType)) { ?>
@ -99,27 +100,27 @@
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">项目编号</label> <label class="control-label">Fund number</label>
<div class="controls"> <div class="controls">
<input type="text" name="project_id" value="<?php echo empty($this->info['project_id']) ? "":$this->info['project_id']; ?>" /> <input type="text" name="project_id" value="<?php echo empty($this->info['project_id']) ? "":$this->info['project_id']; ?>" />
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">项目名称</label> <label class="control-label">Funt name</label>
<div class="controls"> <div class="controls">
<input type="text" name="project_title" value="<?php echo empty($this->info['project_title']) ? "":$this->info['project_title']; ?>" class="span8" /> <input type="text" name="project_title" value="<?php echo empty($this->info['project_title']) ? "":$this->info['project_title']; ?>" class="span8" />
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">项目简介</label> <label class="control-label">Last Data Usage</label>
<div class="controls"> <div class="controls">
<textarea name="project" class="span8"><?php echo empty($this->info['project']) ? "":$this->info['project']; ?></textarea> <textarea name="project" class="span8"><?php echo empty($this->info['project']) ? "":$this->info['project']; ?></textarea>
</div> </div>
</div> </div>
<div class="form-actions"> <div class="form-actions">
<input type="hidden" name="submit" value="submit" /> <input type="hidden" name="submit" value="submit" />
<button type="submit" class="btn btn-primary">确定</button> <button type="submit" class="btn btn-primary">Ok</button>
<button type="button" class="btn">取消</button> <button type="button" class="btn">Cancel</button>
</div> </div>
</form> </form>
<?php }?> <?php }?>

View File

@ -1,10 +1,10 @@
<?php <?php
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('用户登录'); $this->headTitle('Login');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/register.css'); $this->headLink()->appendStylesheet('/css/register.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">Home</a>');
$this->breadcrumb('<a href="/account/fetchpwd">找回密码</a>'); $this->breadcrumb('<a href="/account/fetchpwd">Fetch password</a>');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
<?php if (!empty($this->messages)) : ?> <?php if (!empty($this->messages)) : ?>
@ -20,5 +20,5 @@ foreach ($this->messages as $info)echo $info;
</div> </div>
<?php endif; ?> <?php endif; ?>
<div id="tool"> <div id="tool">
<a href="/account/login">登录 </a> <a href="/account/register">注册新用户</a> <a href="/account/login">Login </a> <a href="/account/register">Register new user</a>
</div> </div>

View File

@ -1,6 +1,6 @@
<?php <?php
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('我的账户'); $this->headTitle('My account');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
?> ?>
<div class="row"> <div class="row">
@ -10,15 +10,15 @@
</div><!--/.well --> </div><!--/.well -->
</div><!--/span--> </div><!--/span-->
<div class="span9"> <div class="span9">
<h3>账户信息</h3> <h3>Account</h3>
<hr /> <hr />
<?php if(!empty($this->info)) {?> <?php if(!empty($this->info)) {?>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>头像</dt> <dt>Gravatar</dt>
<dd><img src="<?= $this->avatar ?>" class="img-polaroid"></dd> <dd><img src="<?= $this->avatar ?>" class="img-polaroid"></dd>
</dl> </dl>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>用户名</dt> <dt>Username</dt>
<dd><?php echo $this->info['username'] ?></dd> <dd><?php echo $this->info['username'] ?></dd>
</dl> </dl>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
@ -26,23 +26,23 @@
<dd><?php echo $this->info['email'] ?></dd> <dd><?php echo $this->info['email'] ?></dd>
</dl> </dl>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>真实姓名</dt> <dt>Real Name</dt>
<dd><?php echo $this->info['realname'] ?></dd> <dd><?php echo $this->info['realname'] ?></dd>
</dl> </dl>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>工作单位</dt> <dt>Organization</dt>
<dd><?php echo $this->info['unit'] ?></dd> <dd><?php echo $this->info['unit'] ?></dd>
</dl> </dl>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>项目</dt> <dt>Fund</dt>
<dd><?php echo $this->info['project_title'] ?></dd> <dd><?php echo $this->info['project_title'] ?></dd>
</dl> </dl>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>账号注册时间</dt> <dt>Register date</dt>
<dd><?php echo date("Y-m-d H:i",strtotime($this->info['ts_created'])) ?></dd> <dd><?php echo date("Y-m-d H:i",strtotime($this->info['ts_created'])) ?></dd>
</dl> </dl>
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>上次登录时间</dt> <dt>Last login</dt>
<dd><?php echo date("Y-m-d H:i",strtotime($this->info['ts_last_login'])) ?></dd> <dd><?php echo date("Y-m-d H:i",strtotime($this->info['ts_last_login'])) ?></dd>
</dl> </dl>
<?php } ?> <?php } ?>

View File

@ -1,19 +1,19 @@
<?php <?php
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('用户注册'); $this->headTitle('Register');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/register.css'); $this->headLink()->appendStylesheet('/css/register.css');
$this->breadcrumb('<a href="/">首页</a>'); $this->breadcrumb('<a href="/">Home</a>');
$this->breadcrumb('<a href="/account/register">用户注册</a>'); $this->breadcrumb('<a href="/account/register">Register</a>');
$this->breadcrumb()->setSeparator(' > '); $this->breadcrumb()->setSeparator(' > ');
?> ?>
<div class="row-fluit"> <div class="row-fluit">
<div class="span12"> <div class="span12">
<img src="/images/pass_login1.gif" />&nbsp;确认服务条款&nbsp;&nbsp; <img src="/images/pass_login1.gif" />&nbsp;Agree the terms&nbsp;&nbsp;
<img src="/images/pass_pic_arrowhead_2.gif" />&nbsp;&nbsp; <img src="/images/pass_pic_arrowhead_2.gif" />&nbsp;&nbsp;
<img src="/images/pass_login2.gif" />&nbsp;填写基本信息&nbsp;&nbsp; <img src="/images/pass_login2.gif" />&nbsp;Input your base information&nbsp;&nbsp;
<img src="/images/pass_pic_arrowhead_2.gif" />&nbsp;&nbsp; <img src="/images/pass_pic_arrowhead_2.gif" />&nbsp;&nbsp;
<img src="/images/pass_login3.gif" />&nbsp;注册完成 <img src="/images/pass_login3.gif" />&nbsp;Finish register
<?php echo $this->form;?> <?php echo $this->form;?>
</div> </div>
</div> </div>

View File

@ -1,6 +1,6 @@
<?php <?php
$this->headTitle($this->config->title->site); $this->headTitle($this->config->title->site);
$this->headTitle('我的账户'); $this->headTitle('My account');
$this->headTitle()->setSeparator(' - '); $this->headTitle()->setSeparator(' - ');
$this->theme->AppendPlus($this,'colorbox'); $this->theme->AppendPlus($this,'colorbox');
?> ?>
@ -11,12 +11,12 @@
</div><!--/.well --> </div><!--/.well -->
</div><!--/span--> </div><!--/span-->
<div class="span9"> <div class="span9">
<h3>修改安全性设置</h3> <h3>Security</h3>
<hr /> <hr />
<div class="tabbable"> <div class="tabbable">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li <?php if($this->section == "email" || empty($this->section)) echo 'class="active"'?>><a href="#tab2" data-toggle="tab">电子邮箱</a></li> <li <?php if($this->section == "email" || empty($this->section)) echo 'class="active"'?>><a href="#tab2" data-toggle="tab">Email</a></li>
<li <?php if($this->section == "password") echo 'class="active"'?>><a href="#tab3" data-toggle="tab">修改密码</a></li> <li <?php if($this->section == "password") echo 'class="active"'?>><a href="#tab3" data-toggle="tab">Change password</a></li>
</ul> </ul>
<?php if(!empty($this->error)) { ?> <?php if(!empty($this->error)) { ?>
<?= $this->error ?> <?= $this->error ?>
@ -32,16 +32,16 @@
</div> </div>
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label">密码:</label> <label class="control-label">Password:</label>
<div class="controls"> <div class="controls">
<input type="password" name="password" /> <input type="password" name="password" />
<span class="help-inline">如果要修改邮箱,请输入原密码</span> <span class="help-inline">Require old password to change the Email</span>
</div> </div>
</div> </div>
<div class="form-actions"> <div class="form-actions">
<input type="hidden" name="submit" value="submit" /> <input type="hidden" name="submit" value="submit" />
<button type="submit" class="btn btn-green" class="btn btn-primary">保存</button> <button type="submit" class="btn btn-green" class="btn btn-primary">Save</button>
<button type="reset" id="reset" class="btn">取消</button> <button type="reset" id="reset" class="btn">Cancel</button>
</div> </div>
</form> </form>
</div> </div>
@ -50,28 +50,28 @@
<div id="password"> <div id="password">
<form action="/account/secure" method="post" class="form-horizontal"> <form action="/account/secure" method="post" class="form-horizontal">
<div class="control-group "> <div class="control-group ">
<label class="control-label">当前密码</label> <label class="control-label">Old Password</label>
<div class="controls"> <div class="controls">
<input name="password" type="password" value="" /> <input name="password" type="password" value="" />
<span class="help-inline">如果要修改密码,请输入原密码</span> <span class="help-inline">Require old password to change the Password</span>
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">新密码</label> <label class="control-label">New Password</label>
<div class="controls"> <div class="controls">
<input type="password" name="new_password" value="" /> <input type="password" name="new_password" value="" />
</div> </div>
</div> </div>
<div class="control-group "> <div class="control-group ">
<label class="control-label">确认新密码</label> <label class="control-label">New Password Confirm</label>
<div class="controls"> <div class="controls">
<input type="password" name="new_password_confrim" value="" /> <input type="password" name="new_password_confrim" value="" />
</div> </div>
</div> </div>
<div class="form-actions"> <div class="form-actions">
<input type="hidden" name="submit" value="submit" /> <input type="hidden" name="submit" value="submit" />
<button type="submit" class="btn btn-primary">确定</button> <button type="submit" class="btn btn-primary">Submit</button>
<button type="button" class="btn">取消</button> <button type="button" class="btn">Cancel</button>
</div> </div>
</form> </form>
</div> </div>

View File

@ -37,7 +37,8 @@
<?php if (!empty($this->paginator)) : ?> <?php if (!empty($this->paginator)) : ?>
<div class="pagenavi"><?= $this->paginator; ?></div> <div class="pagenavi"><?= $this->paginator; ?></div>
<?php if ($this->tabID=='order-offline2') { ?> <?php if ($this->tabID=='order-offline2') { ?>
<div class="well alert alert-error">Note: 成一个订单需要三个步骤,即<strong>生成pdf</strong><strong>上传签字后的pdf</strong><strong>确认订单</strong>。请确保上传的pdf和当前订单中的数据相同否则无法受理。若不相同请重新生成、上传。</div> <div class="well alert alert-error">Note: One order require 3 steps, first generate the <strong>PDF</strong>, second <strong>upload the pdf with personal signature</strong>, and
<strong>confirm the order</strong>. Please make sure the data list in your uploaded pdf is same as your order.</div>
<?php } ?> <?php } ?>
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<thead> <thead>
@ -49,27 +50,27 @@ echo '<a class="btn btn-primary" href="/data/order/apply/all">Put all into Appli
} elseif ($this->tabID=='order-offline2') { } elseif ($this->tabID=='order-offline2') {
if(count($this->paginator)) if(count($this->paginator))
{ {
echo '<a class="btn btn-primary" href="/data/order/pdf/1">生成pdf</a> '; echo '<a class="btn btn-primary" href="/data/order/pdf/1">pdf</a> ';
if($this->offlineappid >1) if($this->offlineappid >1)
{ {
if(empty($this->applicationform)) if(empty($this->applicationform))
{ {
echo '<a class="btn btn-primary" href="javascript:void(0);" onclick="upload.showUploadForm('.$this->offlineappid.');">上传pdf</a>'; echo '<a class="btn btn-primary" href="javascript:void(0);" onclick="upload.showUploadForm('.$this->offlineappid.');">upload pdf</a>';
} }
else else
{ {
echo '<a class="btn btn-warning" href="javascript:void(0);" onclick="upload.showUploadForm('.$this->offlineappid.');">重新上传pdf</a> echo '<a class="btn btn-warning" href="javascript:void(0);" onclick="upload.showUploadForm('.$this->offlineappid.');">re-upload pdf</a>
<a class="btn btn-success" href="/data/order/ac/commitapplicationform/?offlineappid='.$this->offlineappid.'">确认订单</a>'; <a class="btn btn-success" href="/data/order/ac/commitapplicationform/?offlineappid='.$this->offlineappid.'">confirm order</a>';
} }
} }
} }
} elseif ($this->tabID=='order-offline3') { } elseif ($this->tabID=='order-offline3') {
if(count($this->paginator)) if(count($this->paginator))
{ {
echo "请等待审核"; echo "Wait approvement";
} }
} elseif ($this->tabID=='order-offline4') { } elseif ($this->tabID=='order-offline4') {
echo '通过时间'; echo 'Approved time';
} }
?> ?>
@ -87,18 +88,18 @@ echo '通过时间';
<td> <td>
<?php <?php
if ($this->tabID=='order-offline1') { if ($this->tabID=='order-offline1') {
echo '<a href="/data/order/apply/'.$order['id'].'" class="btn btn-primary">放入订单</a> echo '<a href="/data/order/apply/'.$order['id'].'" class="btn btn-primary">put into order</a>
<a href="/data/order/cancel/'.$order['id'].'" class="btn">移除</a>'; <a href="/data/order/cancel/'.$order['id'].'" class="btn">remove</a>';
} elseif ($this->tabID=='order-offline2') { } elseif ($this->tabID=='order-offline2') {
switch($order['status']) { switch($order['status']) {
case 2: case 2:
if(empty($order['applicationform'])) if(empty($order['applicationform']))
echo "请生成pdf并上传".' <a class="btn" href="/data/order/cancel/'.$order['id'].'">移除</a>'; echo "Please scan the pdf and upload".' <a class="btn" href="/data/order/cancel/'.$order['id'].'">remove</a>';
else else
echo '<span class="label label-success">PDF已上传,请确认订单</span>'; echo '<span class="label label-success">You have uploaded the PDF, please confirm the order</span>';
break; break;
case 3: case 3:
echo '<span class="label label-success">申请表已上传</span>'; echo '<span class="label label-success">PDF has been uploaded.</span>';
break; break;
default: default:
break; break;
@ -107,18 +108,18 @@ if ($this->tabID=='order-offline1') {
switch($order['status']) { switch($order['status']) {
case 3: case 3:
if(!empty($order['applicationform'])) if(!empty($order['applicationform']))
echo '<span class="label label-success">申请表已上传</span>'; echo '<span class="label label-success">PDF has been uploaded.</span>';
else else
echo '<span class="label label-warning">请上传申请表</span>'; echo '<span class="label label-warning">Please upload the PDF</span>';
break; break;
case 4: case 4:
if(!empty($order['applicationform'])) if(!empty($order['applicationform']))
{ echo "已收到申请,请等待审批。日期:";echo date('Y-m-d',strtotime($order['ts_received']));} { echo "The order has received, please wait the approvement. Date: ";echo date('Y-m-d',strtotime($order['ts_received']));}
else else
echo '<span class="label label-warning">请上传申请表</span>'; echo '<span class="label label-warning">Please upload the PDF</span>';
break; break;
case 5: case 5:
echo "已通过申请,请查收邮件"; echo "Approved, please check email";
break; break;
default: default:
break; break;

View File

@ -8,19 +8,19 @@ class RegisterForm extends Zend_Form
$this->setName('Register'); $this->setName('Register');
$username = new Zend_Form_Element_Text('username'); $username = new Zend_Form_Element_Text('username');
$username->setLabel('用户名')->setRequired(true) $username->setLabel('Username')->setRequired(true)
->addFilter('StripTags') ->addFilter('StringTrim') ->addFilter('StripTags') ->addFilter('StringTrim')
->addValidator('StringLength',false,array(3,50)) ->addValidator('StringLength',false,array(3,50))
->addPrefixPath('Validator','validator/','validate') ->addPrefixPath('Validator','validator/','validate')
->addValidator('NotInTable',false,array('username')); ->addValidator('NotInTable',false,array('username'));
$password=new Zend_Form_Element_Password('password'); $password=new Zend_Form_Element_Password('password');
$password->setLabel('密码') $password->setLabel('Password')
->setRequired(true) ->setRequired(true)
->setDescription('长度在6到20位字符之间') ->setDescription('Length in 6-20 chars')
->addValidator('StringLength',false,array(6,20)); ->addValidator('StringLength',false,array(6,20));
$password_confirm=new Zend_Form_Element_Password('password_confirm'); $password_confirm=new Zend_Form_Element_Password('password_confirm');
$password_confirm->setLabel('确认密码')->addPrefixPath('Validator','validator/','validate') $password_confirm->setLabel('Confirm password')->addPrefixPath('Validator','validator/','validate')
->setRequired(true)->addValidator('Confirmation',false,array('password')); ->setRequired(true)->addValidator('Confirmation',false,array('password'));
$email=new Zend_Form_Element_Text('email'); $email=new Zend_Form_Element_Text('email');
@ -30,7 +30,7 @@ class RegisterForm extends Zend_Form
->addValidator('NotEmpty') ->addValidator('NotEmpty')
->addValidator('EmailAddress'); ->addValidator('EmailAddress');
$email_repeat=new Zend_Form_Element_Text('email_repeat'); $email_repeat=new Zend_Form_Element_Text('email_repeat');
$email_repeat->setLabel('确认E-Mail') $email_repeat->setLabel('Confirm E-Mail')
->setRequired(true) ->setRequired(true)
->addPrefixPath('Validator','validator/','validate') ->addPrefixPath('Validator','validator/','validate')
->addValidator('NotInTable',false,array('email')) ->addValidator('NotInTable',false,array('email'))
@ -38,21 +38,21 @@ class RegisterForm extends Zend_Form
$realname=new Zend_Form_Element_Text('realname'); $realname=new Zend_Form_Element_Text('realname');
$realname->setLabel('真实姓名')->setRequired(false); $realname->setLabel('Real name')->setRequired(false);
$phone=new Zend_Form_Element_Text('phone'); $phone=new Zend_Form_Element_Text('phone');
$phone->setLabel('电话')->setRequired(false); $phone->setLabel('Phone')->setRequired(false);
$unit=new Zend_Form_Element_Text('unit'); $unit=new Zend_Form_Element_Text('unit');
$unit->setLabel('单位')->setRequired(false); $unit->setLabel('Organization')->setRequired(false);
$address=new Zend_Form_Element_Text('address'); $address=new Zend_Form_Element_Text('address');
$address->setLabel('联系地址')->setRequired(false); $address->setLabel('Address')->setRequired(false);
$project=new Zend_Form_Element_Textarea('project'); $project=new Zend_Form_Element_Textarea('project');
$project->setLabel('科研项目')->setRequired(false)->setAttrib('rows',4); $project->setLabel('Fund')->setRequired(false)->setAttrib('rows',4);
$id = new Zend_Form_Element_Hidden('id'); $id = new Zend_Form_Element_Hidden('id');
$submit = new Zend_Form_Element_Submit('注册'); $submit = new Zend_Form_Element_Submit('Register');
$submit->setAttrib('id', 'submitbutton'); $submit->setAttrib('id', 'submitbutton');
$this->addElements(array($id, $username,$password,$password_confirm,$email,$email_repeat,$realname,$phone,$unit,$address,$project,$submit)); $this->addElements(array($id, $username,$password,$password_confirm,$email,$email_repeat,$realname,$phone,$unit,$address,$project,$submit));