Change Log of Joomsport: 增加赛事晋级图第二至第四阶段布局
来源:互联网 发布:如何制作erp软件 编辑:程序博客网 时间:2024/05/14 11:54
这个图表非常复杂,需要仔细分析下:
Level1的比赛信息的格式有一些不同,其他level上面的就都是一样了。
将 /administrator/components/com_joomsport/admin.joomsport.html.php
中的方法bl_editMatch做修改:
将:
<!-- level --><?phpif(3 == $lists['tourn_type']){?><tr><td><?php echo JText::_( "級別" ); ?></td><td><?phpecho JHTML::_('select.genericlist',$lists['levels'],'level','class="inputbox"','id','lev_name',( (isset($row->level)) ? $row->level : 0 ));?></td></tr><?php}?><!-- end by Vincent 6th-Dec-2011 -->
改为:来为淘汰盃的比赛也增加level字段的编辑界面,但是请注意此处将不同于主席盃,不再是一个下拉列表
<!-- level --><?phpif(3 == $lists['tourn_type']){ ?><tr><td><?php echo JText::_( "級別" ); ?></td><td><?phpecho JHTML::_('select.genericlist',$lists['levels'],'level','class="inputbox"','id','lev_name',( (isset($row->level)) ? $row->level : 0 )); ?></td></tr><?php}else if(2 == $lists['tourn_type']){?><tr><td><?php echo JText::_( "級別" ); ?></td><td><input type="text" maxlength="1" size="2" name="level" value="<?php echo (isset($row->level)) ? $row->level : 0;?>" /></td></tr><?php}?><!-- end by Vincent 6th-Dec-2011 -->
除此以外,我们需要多两个字段来记录一个新出现的信息:
将两个字段放在match表里,名为alias1和alias2;
将文件
/administrator/components/com_joomsport/admin.joomsport.class.php
添加这两个新字段:
class JTableMatch extends JTable{var $id= null;var $m_id = null;var $team1_id = null;var $team2_id= null;var $score1 = null;var $score2 = null;// added by Vincent 9th Dec 2011var $number_label1 = null;var $number_label2 = null;// end// added by Vincent 10th Dec 2011var $comment1 = null;var $comment2 = null;// end// added by Vincent 15th Jan 2012var $alias1 = null;var $alias2 = null;// endvar $match_descr= null;var $published= null;var $is_extra= null;var $m_played= null;var $m_date= null;var $m_time= null;var $m_location= null;var $bonus1= null;var $bonus2= null;var $m_remark= null;//added by Vincent 5th Dec 2011var $grp_id= null;var $ordering= null;var $level= null;function __construct( &$db ){parent::__construct( '#__bl_match', 'id', $db );}}
将 /administrator/components/com_joomsport/admin.joomsport.html.php中的方法bl_editMatch:
<!-- added by Vincent 15th-Jan-2012 --><?phpif(2 == $lists['tourn_type']){ ?><tr><td width="100"><?php echo JText::_( '用於淘汰盃賽事第二至四階段的球隊介紹' ); ?></td><td><?php echo $lists['teams1'].' <input type="text" name="alias1" value="'.$row->alias1.'" size="5" maxlength="15" />?:?<input type="text" name="alias2" value="'.$row->alias2.'" size="5" maxlength="15" /> '.$lists['teams2'];?></td></tr><?php}?><!-- end -->
另外,现在系统将容许用户创建一个比赛,该比赛的主场与客场是同一个球队,将文件/administrator/components/com_joomsport/admin.joomsport.html.php中的方法bl_editMday:去掉其JavaScript函数中,对于同一场比赛两支球队需要ID不同的验证
function bl_add_match(){var team1 = getObj('teams1');var team2 = getObj('teams2');var score1 = getObj('add_score1').value;var score2 = getObj('add_score2').value;var tm_played = getObj('tm_played').checked;if (team1.value == 0 || team2.value == 0) {alert("<?php echo JText::_( 'BLBE_JSMDNOT1' ); ?>");return;}if (((score1) == '' || (score2) == '') && tm_played){alert("<?php echo JText::_( 'BLBE_JSMDNOT1' ); ?>");return;}//commented by Vincent 15th Jan 2012//if ( team1.value == team2.value ){//alert("<?php echo JText::_( 'BLBE_JSMDNOT2' ); ?>");return;//}
--------------------------------------------------------------------以上部分已与server同步---------------------------------------------------------------------------------
在/components/com_joomsport/views/competebranch/tmpl/路径下创建两个文件:kickoffSecondPart.php与kickoffSecondPart.xml
kickoffSecondPart.xml内容如下:
<?xml version="1.0" encoding="utf-8"?><metadata><layout title="淘汰盃第二至四階段佈局"><message><![CDATA[賽事晉級圖淘汰盃第二至四階段佈局]]></message></layout><state><name>賽事晉級圖淘汰盃第二至四階段佈局</name><description>賽事晉級圖淘汰盃第二至四階段佈局</description><url addpath="/administrator/components/com_joomsport/elements"><param name="sid" type="season" default="0" label="Select Season" description="Season" /><param name="md_id" type="matchday" default="0" label="Select matchday" description="MatchDay of stage" /></url><params></params></state></metadata>
这部分之后可能会再调整,一会儿再回来。
另外:对该视图的default.xml和kickoff.xml做修改,来区别不同局部。
现在来看这个视图的main controller文件:/components/com_joomsport/views/competebranch/view.html.php
在display方法里加入代码:
/* * added by Vincent 15 Jan 2012 */if($this->getLayout() == 'kickoffSecondPart') {$this->_displayKickoffSecondPart($tpl);return;}
所以,现在来看下这个新的成员方法_displayKickoffSecondPart应该完成哪些事。
1. 首先,前三个任务与上一个布局一样,它应该得到参数,即是season id与matchday id;
2. 根据season id得到比赛名称;
3. 得到当下的联赛盃season id,用它来确定每个team所属的group(甲乙丙丁);
1.
- Change Log of Joomsport: 增加赛事晋级图第二至第四阶段布局
- Change Log of Joomsport: Error in Joomsport (Synchronized with Server)
- Change Log for Bug-Fixing of Joomsport
- Change Log of Joomsport: Overwrite the CSS
- Change Log of Joomsport:[VIEW]晉級圖: 增加ranking_alias字段到team,重新使用match的match_descr字段(synchronized)
- Change Log of Joomsport: [VIEW]晉級圖-淘汰盃:增加字段number_label1,number_label2到match表(synchronized with ser)
- Change Log of Joomsport: [VIEW]晉級圖-淘汰盃 增加comment1, comment2到match表(synchronized with server)
- Change Log for Pruning Undesired Code of Joomsport
- Change Log of Joomsport: Adding 't_type' field for Tournament
- Change Log of Joomsport: Add One Field 'm_remark' to match
- Change Log of Joomsport: Create view 'arrangement' with parameter 'month'
- Change Log of Joomsport: Add two fields to season table
- Change Log of Joomsport: Remove Undesired HTML(Synchronized with Server)
- Change Log of Joomsport: [VIEW]晉級圖-主席盃、碟及盾:给match表增加三个字段:grp_id,ordering,level(synchronized with ser
- Change Log of Joomsport: Adding Order to Teams within one Group
- Change Log of Joomsport: Add Tournament-Season Name to Group List
- Change Log of Joomsport: Add more fields to season (Synchronized with Server)
- Change Log of Joomsport: 改變[VIEW]賽事編排的mon參數(Synchronized with server)
- 还原真实的cache recovery
- Ubuntu下安装virtualbox虚拟windows xp后设置bridge网络连接访问ipv6
- 在项目中集成hibernate遇到的问题(1)
- PHP+MySQL+Apache介绍
- MySQL: mini-transaction简析
- Change Log of Joomsport: 增加赛事晋级图第二至第四阶段布局
- memcached文章
- zoj 1092||poj 2240 Arbitrage( bellman 最短路)
- 虚拟机
- 想做一个推荐系统,求志同道合者。。。
- Redis C客户端API
- Java集合类
- 编号(长度)动态规划
- linux do while{}