信呼OA版本v2.3.8
This commit is contained in:
77
webmain/system/schedule/rock_schedule_calendar.php
Normal file
77
webmain/system/schedule/rock_schedule_calendar.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
|
||||
var month;
|
||||
|
||||
var c = {
|
||||
change:function(o1, lx){
|
||||
mobj.fanmonth(lx);
|
||||
},
|
||||
nowchange:function(){
|
||||
mobj.nowmonth();
|
||||
},
|
||||
plusadd:function(){
|
||||
openinput('日程','schedule','','wfhoew{rand}');
|
||||
},
|
||||
loadschedule:function(){
|
||||
$.get(js.getajaxurl('loadschedule','{mode}','{dir}', {month:month}), function(da){
|
||||
for(var d1 in da){
|
||||
var s='',s1,d=da[d1],i;
|
||||
for(i=0;i<d.length;i++){
|
||||
s+='<div onclick="openreng_{rand}('+d[i].id+')" style="height:20px;line-height20px;overflow:hidden;cursor:pointer">'+(i+1)+'.['+d[i].time.substr(11,5)+']'+d[i].title+'</div>';
|
||||
}
|
||||
$('#s'+d1+'_{rand}').html('<div style="border-top:1px #eeeeee solid;margin-top:3px;">'+s+'</div>');
|
||||
}
|
||||
},'json');
|
||||
},
|
||||
guanli:function(){
|
||||
addtabs({num:'guanlieschedule',url:'{dir},{mode},guan',name:'日程管理'});
|
||||
},
|
||||
ricdaibn:function(){
|
||||
addtabs({num:'scheduld',url:'flow,page,scheduld,atype=my',name:'日程待办'});
|
||||
}
|
||||
};
|
||||
wfhoew{rand}=function(){
|
||||
c.loadschedule();
|
||||
}
|
||||
openreng_{rand}=function(id1){
|
||||
openxiangs('日程','schedule', id1);
|
||||
}
|
||||
var mobj = $('#veiw_{rand}').rockcalendar({
|
||||
height:viewheight-80,
|
||||
changemonth:function(y, m){
|
||||
$('#nowmonth_{rand}').html(''+y+'年'+xy10(m)+'月');
|
||||
month = ''+y+'-'+xy10(m)+'';
|
||||
c.loadschedule();
|
||||
},
|
||||
renderer:function(dt, s, d){
|
||||
var v = s;
|
||||
v+='<div style="font-size:12px;" id="s'+dt+'_{rand}"></div>';
|
||||
return v;
|
||||
}
|
||||
});
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="left" width="30%">
|
||||
<button type="button" click="change,-1" class="btn btn-default"><i class="icon-caret-left"></i> 上个月</button>
|
||||
<button type="button" click="nowchange" class="btn btn-default"><i class="icon-calendar"></i> 当月</button>
|
||||
<button type="button" click="guanli" class="btn btn-default"><i class="icon-cog"></i> 管理</button>
|
||||
<button type="button" click="ricdaibn" class="btn btn-default">日程待办</button>
|
||||
</td>
|
||||
<td align="center" width="40%">
|
||||
<div id="nowmonth_{rand}" style="font-size:16px">2015年06月</div>
|
||||
</td>
|
||||
<td align="right" width="30%">
|
||||
<button type="button" click="plusadd" class="btn btn-success"><i class="icon-plus"></i> 新增记录</button>
|
||||
<button type="button" click="change,1" class="btn btn-default">下个月 <i class="icon-caret-right"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
111
webmain/system/schedule/rock_schedule_guan.php
Normal file
111
webmain/system/schedule/rock_schedule_guan.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var a = $('#veiw_{rand}').bootstable({
|
||||
tablename:'schedule',celleditor:false,fanye:true,modenum:'schedule',sort:'id',dir:'desc',modename:'日程',
|
||||
columns:[{
|
||||
text:'标题',dataIndex:'title',editor:true,align:'left'
|
||||
},{
|
||||
text:'时间',dataIndex:'startdt',sortable:true
|
||||
},{
|
||||
text:'截止时间',dataIndex:'enddt',sortable:true
|
||||
},{
|
||||
text:'重复',dataIndex:'rate'
|
||||
},{
|
||||
text:'是否提醒',dataIndex:'txsj'
|
||||
},{
|
||||
text:'提醒给',dataIndex:'recename'
|
||||
},{
|
||||
text:'添加人',dataIndex:'optname'
|
||||
},{
|
||||
text:'状态',dataIndex:'status',type:'checkbox',editor:true,sortable:true
|
||||
}],
|
||||
itemclick:function(d){
|
||||
btn(d.uid!=adminid);
|
||||
},
|
||||
beforeload:function(){
|
||||
btn(true);
|
||||
},
|
||||
itemdblclick:function(d){
|
||||
openxiangs(this.modename,this.modenum,d.id);
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
del:function(){
|
||||
a.del({check:function(lx){if(lx=='yes')btn(true)}});
|
||||
},
|
||||
refresh:function(){
|
||||
a.reload();
|
||||
},
|
||||
clickdt:function(o1){
|
||||
js.changedate(o1,'dt1_{rand}');
|
||||
},
|
||||
search:function(o1){
|
||||
var s=get('key_{rand}').value;
|
||||
a.setparams({key:s,dt:get('dt1_{rand}').value},true);
|
||||
},
|
||||
clickwin:function(o1,lx){
|
||||
var id=0;
|
||||
if(lx==1)id=a.changeid;
|
||||
openinput('日程','schedule',id,'wfhoew{rand}');
|
||||
},
|
||||
changlx:function(o1,lx){
|
||||
$("button[id^='state{rand}']").removeClass('active');
|
||||
$('#state{rand}_'+lx+'').addClass('active');
|
||||
var as = ['my','rece'];
|
||||
a.setparams({'atype':as[lx]},true);
|
||||
}
|
||||
};
|
||||
wfhoew{rand}=function(){
|
||||
c.refresh();
|
||||
}
|
||||
function btn(bo){
|
||||
get('del_{rand}').disabled = bo;
|
||||
get('edit_{rand}').disabled = bo;
|
||||
}
|
||||
|
||||
js.initbtn(c);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<div style="width:140px" class="input-group">
|
||||
<input placeholder="日期" readonly class="form-control" id="dt1_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" click="clickdt,1" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<input class="form-control" style="width:180px" id="key_{rand}" placeholder="标题">
|
||||
</td>
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td width="80%" style="padding-left:10px">
|
||||
<div id="stewwews{rand}" class="btn-group">
|
||||
<button class="btn btn-default active" id="state{rand}_0" click="changlx,0" type="button">我创建</button>
|
||||
<button class="btn btn-default" id="state{rand}_1" click="changlx,1" type="button">提醒给我的</button>
|
||||
</div>
|
||||
</td>
|
||||
<td align="right" width="200" nowrap>
|
||||
<button class="btn btn-danger" id="del_{rand}" click="del" disabled type="button"><i class="icon-trash"></i> 删除</button>
|
||||
<button class="btn btn-info" id="edit_{rand}" click="clickwin,1" disabled type="button"><i class="icon-edit"></i> 编辑 </button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="veiw_{rand}"></div>
|
||||
93
webmain/system/schedule/rock_schedule_list.php
Normal file
93
webmain/system/schedule/rock_schedule_list.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php if(!defined('HOST'))die('not access');?>
|
||||
<script >
|
||||
$(document).ready(function(){
|
||||
var columns = [{
|
||||
text:'日期',dataIndex:'dt',width:'150px'
|
||||
},{
|
||||
text:'星期',dataIndex:'week',width:'100px'
|
||||
},{
|
||||
text:'',dataIndex:'cont',align:'left'
|
||||
}];
|
||||
var a = $('#view_{rand}').bootstable({
|
||||
tablename:'schedule',fanye:false,modedir:'{mode}:{dir}',storebeforeaction:'schedulemybefore',storeafteraction:'schedulemyafter',
|
||||
columns:columns,
|
||||
loadbefore:function(d){
|
||||
get('dt1_{rand}').value=d.startdt;
|
||||
get('dt2_{rand}').value=d.enddt;
|
||||
}
|
||||
});
|
||||
|
||||
var c = {
|
||||
search:function(){
|
||||
a.setparams({
|
||||
'startdt':get('dt1_{rand}').value,
|
||||
'enddt':get('dt2_{rand}').value
|
||||
},true);
|
||||
},
|
||||
daochu:function(){
|
||||
a.exceldown();
|
||||
},
|
||||
clickwin:function(){
|
||||
openinput('日程','schedule',0,'opegs{rand}');
|
||||
},
|
||||
guanli:function(){
|
||||
addtabs({num:'guanlieschedule',url:'flow,page,schedule,atype=my',name:'日程管理'});
|
||||
},
|
||||
calendarshow:function(){
|
||||
addtabs({num:'guanlieschedulemonth',url:'{dir},{mode},calendar',name:'日程月视图'});
|
||||
},
|
||||
ricdaibn:function(){
|
||||
addtabs({num:'scheduld',url:'flow,page,scheduld,atype=my',name:'日程待办'});
|
||||
}
|
||||
};
|
||||
js.initbtn(c);
|
||||
opegs{rand}=function(){
|
||||
a.reload();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<div>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td nowrap style="padding-right:10px">
|
||||
<button class="btn btn-primary" click="clickwin,0" type="button"><i class="icon-plus"></i> 新增</button>
|
||||
<button type="button" click="guanli" class="btn btn-default"><i class="icon-cog"></i> 管理</button>
|
||||
|
||||
<button type="button" click="ricdaibn" class="btn btn-default">日程待办</button>
|
||||
</td>
|
||||
<td nowrap>日期 </td>
|
||||
<td nowrap>
|
||||
<div style="width:140px" class="input-group">
|
||||
<input placeholder="" readonly class="form-control" id="dt1_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="return js.selectdate(this,'dt1_{rand}')" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td nowrap> 至 </td>
|
||||
<td nowrap>
|
||||
<div style="width:140px" class="input-group">
|
||||
<input placeholder="" readonly class="form-control" id="dt2_{rand}" >
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" onclick="return js.selectdate(this,'dt2_{rand}')" type="button"><i class="icon-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td style="padding-left:10px">
|
||||
<button class="btn btn-default" click="search" type="button">搜索</button>
|
||||
</td>
|
||||
<td style="padding-left:10px" width="90%">
|
||||
|
||||
|
||||
</td>
|
||||
<td align="right" nowrap>
|
||||
<button class="btn btn-default" click="calendarshow" type="button"><i class="icon-calendar"></i> 月视图</button>
|
||||
<button class="btn btn-default" click="daochu,1" type="button">导出</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="blank10"></div>
|
||||
<div id="view_{rand}"></div>
|
||||
<div class="tishi">列表上显示的是:我创建的日程/提醒给我的</div>
|
||||
64
webmain/system/schedule/scheduleAction.php
Normal file
64
webmain/system/schedule/scheduleAction.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
class scheduleClassAction extends Action
|
||||
{
|
||||
public function loadscheduleAjax()
|
||||
{
|
||||
$month = $this->request('month');
|
||||
$startdt= ''.$month.'-01';
|
||||
$endddt = c('date')->getenddt($month);
|
||||
$arr = m('schedule')->getlistdata($this->adminid, $startdt, $endddt);
|
||||
$this->returnjson($arr);
|
||||
}
|
||||
|
||||
|
||||
public function schedulemybefore($table)
|
||||
{
|
||||
return array(
|
||||
'where' => ' and id=0',
|
||||
'fields'=> 'id'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function schedulemyafter($table, $rows)
|
||||
{
|
||||
$dtobj = c('date');
|
||||
$startdt = $this->post('startdt', $this->date);
|
||||
$enddt = $this->post('enddt');
|
||||
if($enddt=='')$enddt = $dtobj->adddate($startdt,'d',10);
|
||||
$jg = $dtobj->datediff('d',$startdt, $enddt);
|
||||
if($jg>60){
|
||||
$jg = 60;
|
||||
$enddt = $enddt = $dtobj->adddate($startdt,'d',60);
|
||||
}
|
||||
|
||||
$rows = m('schedule')->getlistdata($this->adminid, $startdt, $enddt);
|
||||
$barr = array();
|
||||
$dt = $startdt;
|
||||
for($i=0; $i<=$jg; $i++){
|
||||
if($i>0)$dt = $dtobj->adddate($dt,'d',1);
|
||||
$w = $dtobj->cnweek($dt);
|
||||
$status = 1;
|
||||
if($w=='六'||$w=='日')$status = 0;
|
||||
$str = '';
|
||||
if(isset($rows[$dt]))foreach($rows[$dt] as $k=>$rs){
|
||||
$str.=''.($k+1).'.['.$rs['timea'].']'.$rs['title'].'';
|
||||
if($rs['optname']!=$this->adminname)$str.=' ——'.$rs['optname'].'创建';
|
||||
$str.='<br>';
|
||||
}
|
||||
$sbarr = array(
|
||||
'dt' => $dt,
|
||||
'week' => '星期'.$w,
|
||||
'status' => $status,
|
||||
'cont' => $str
|
||||
);
|
||||
$barr[] = $sbarr;
|
||||
}
|
||||
$arr['startdt'] = $startdt;
|
||||
$arr['enddt'] = $enddt;
|
||||
$arr['rows'] = $barr;
|
||||
$arr['totalCount'] = $jg+1;
|
||||
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user