|
@@ -66,13 +66,33 @@ class flow_meeting_keyClassModel extends flowModel
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 会议开始时的处理
|
|
// 会议开始时的处理
|
|
- if ($stime <= $time && $etime > $time) {
|
|
|
|
|
|
+ if (($stime <= $time && $etime > $time) || ($is_hand == 1 && $zt == 1)) {
|
|
$nzt = 1;
|
|
$nzt = 1;
|
|
// 会议开始,议题自动调整开始第一项
|
|
// 会议开始,议题自动调整开始第一项
|
|
- $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state', 'sort');
|
|
|
|
|
|
+ $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state, topic_title', 'sort');
|
|
if (isset($topic['id']) && $topic['topic_state'] < 2) {
|
|
if (isset($topic['id']) && $topic['topic_state'] < 2) {
|
|
m('meeting')->firstMeetingTopicStart($this->id);
|
|
m('meeting')->firstMeetingTopicStart($this->id);
|
|
|
|
+ // 当前议题
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 展示近几个议题状态
|
|
|
|
+ $topics = m('meeting_topics')->getall("mid={$this->id}",'id, topic_state, topic_title', 'sort');
|
|
|
|
+ for ($i = 0; $i < count($topics); $i++) {
|
|
|
|
+ $topic = $topics[$i];
|
|
|
|
+ if ($topic['topic_state'] == 3) {
|
|
|
|
+ $rs['topic'] = $this->getTopicInfoState($topic);
|
|
|
|
+ }
|
|
|
|
+ if ($topic['topic_state'] == 1) {
|
|
|
|
+ $rs['topic'] .= $this->getTopicInfoState($topic);
|
|
|
|
+ }
|
|
|
|
+ if ($topic['topic_state'] == 2) {
|
|
|
|
+ $rs['topic'] .= $this->getTopicInfoState($topic);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ $topic = m('meeting_topics')->getone("mid={$this->id}",'id, topic_state, topic_title', 'sort desc');
|
|
|
|
+ $rs['topic'] = $this->getTopicState($topic['topic_state']).$topic['topic_title'];
|
|
}
|
|
}
|
|
|
|
|
|
// 更新数据状态
|
|
// 更新数据状态
|
|
@@ -92,8 +112,8 @@ class flow_meeting_keyClassModel extends flowModel
|
|
// $ors当前单据操作信息,$crs提交过来的信息
|
|
// $ors当前单据操作信息,$crs提交过来的信息
|
|
public function flowoptmenu($ors, $crs)
|
|
public function flowoptmenu($ors, $crs)
|
|
{
|
|
{
|
|
- // 切换会议议题
|
|
|
|
- if ($ors['num'] == 'changeTopic') {
|
|
|
|
|
|
+ if ($ors['num'] == 'nextTopic') {
|
|
|
|
+ // 下一议题
|
|
$topics = $this->db->getall("select * from `[Q]meeting_topics` where mid = {$this->id} order by sort");
|
|
$topics = $this->db->getall("select * from `[Q]meeting_topics` where mid = {$this->id} order by sort");
|
|
|
|
|
|
for ($i = 0; $i < count($topics); $i++) {
|
|
for ($i = 0; $i < count($topics); $i++) {
|
|
@@ -122,6 +142,43 @@ class flow_meeting_keyClassModel extends flowModel
|
|
m('meeting_key')->update(['is_hand' => 1, 'meet_state' => 2], "id={$this->id}");
|
|
m('meeting_key')->update(['is_hand' => 1, 'meet_state' => 2], "id={$this->id}");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ } else if ($ors['num'] == 'preTopic') {
|
|
|
|
+ // 上一议题
|
|
|
|
+ $topics = $this->db->getall("select * from `[Q]meeting_topics` where mid = {$this->id} order by sort");
|
|
|
|
+ $is_end = 1;
|
|
|
|
+ for ($i = 0; $i < count($topics); $i++) {
|
|
|
|
+ // 找到结束议题
|
|
|
|
+ if ($topics[$i]['topic_state'] == 2) {
|
|
|
|
+ $id = $topics[$i]['id'];
|
|
|
|
+ // 恢复到上一状态
|
|
|
|
+ $data = [
|
|
|
|
+ 'topic_state' => $topics[$i]['topic_state'] - 1
|
|
|
|
+ ];
|
|
|
|
+ m('meeting_topics')->update($data, "id={$id}");
|
|
|
|
+ // 更新上一个状态
|
|
|
|
+ if (isset($topics[$i - 1]['topic_state'])) {
|
|
|
|
+ $id = $topics[$i - 1]['id'];
|
|
|
|
+ $data = ['topic_state' => 2];
|
|
|
|
+ m('meeting_topics')->update($data, "id={$id}");
|
|
|
|
+ }
|
|
|
|
+ // 更新下一个状态
|
|
|
|
+ if (isset($topics[$i + 1]['topic_state'])) {
|
|
|
|
+ $id = $topics[$i + 1]['id'];
|
|
|
|
+ $data = ['topic_state' => 0];
|
|
|
|
+ m('meeting_topics')->update($data, "id={$id}");
|
|
|
|
+ }
|
|
|
|
+ if (isset($topics[$i + 2]['topic_state'])) {
|
|
|
|
+ $id = $topics[$i + 2]['id'];
|
|
|
|
+ $data = ['topic_state' => 0];
|
|
|
|
+ m('meeting_topics')->update($data, "id={$id}");
|
|
|
|
+ }
|
|
|
|
+ $is_end = 0;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if ($is_end == 1 && isset($topics[$i - 1])) {
|
|
|
|
+ m('meeting_topics')->update(['topic_state'=>2], "id={$topics[$i-1]['id']}");
|
|
|
|
+ }
|
|
} else if ($ors['num'] == 'enableMeeting') {
|
|
} else if ($ors['num'] == 'enableMeeting') {
|
|
|
|
|
|
$time = time();
|
|
$time = time();
|
|
@@ -187,4 +244,17 @@ class flow_meeting_keyClassModel extends flowModel
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function getTopicInfoState($topic)
|
|
|
|
+ {
|
|
|
|
+ $zt = $topic['topic_state'];
|
|
|
|
+ $colors = ["#ff83ec", "#ff8b1a", "#00c959", "#ff4974"];
|
|
|
|
+ $title = ["【等待议题】", "【下一议题】", "【当前议题】", "【上一议题】"];
|
|
|
|
+ $info = str_replace("\n", "", $title[$zt].":".$topic['topic_title']);
|
|
|
|
+ if (isset(m('meeting')->hyarrb[$zt])) {
|
|
|
|
+ $html = '<font style="color:'.$colors[$zt].'; padding: 4px 8px; border-radius: 4px;">'.$info.'</font>.<br />';
|
|
|
|
+ return $html;
|
|
|
|
+ } else {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|