diff --git a/ajax/controller.php b/ajax/controller.php index 775dd2e1..6f79ce0e 100644 --- a/ajax/controller.php +++ b/ajax/controller.php @@ -98,6 +98,29 @@ class Controller { "session_list" => $preparedSessions )); } + + public static function listSessionsHtml(){ + self::getUser(); + $sessions = Session::getAll(); + if (!is_array($sessions)){ + $sessions = array(); + } + + $preparedSessions = array_map( + function($x){return ($x['es_id']);}, + $sessions + ); + + $invites = Invite::getAllInvites(); + if (!is_array($invites)){ + $invites = array(); + } + + $tmpl = new \OCP\Template('office', 'part.sessions', ''); + $tmpl->assign('invites', $invites); + $tmpl->assign('sessions', $sessions); + echo $tmpl->fetchPage(); + } protected static function getUser(){ \OCP\JSON::checkLoggedIn(); diff --git a/ajax/otpoll.php b/ajax/otpoll.php index 65853472..c6dce04f 100644 --- a/ajax/otpoll.php +++ b/ajax/otpoll.php @@ -77,7 +77,7 @@ try{ ); break; case 'sync_ops': - $seqHead = $request->getParam('args/seq_head'); + $seqHead = (string) $request->getParam('args/seq_head'); if (!is_null($seqHead)){ $esId = $request->getParam('args/es_id'); $memberId = $request->getParam('args/member_id'); diff --git a/css/style.css b/css/style.css index 7b265a03..beba31b7 100755 --- a/css/style.css +++ b/css/style.css @@ -1,18 +1,26 @@ #emptyfolder { position:absolute; margin:10em 0 0 10em; font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; } -.documentslist { position:relative;top:3em; padding:5px; width:100%;} +.documentslist { padding:5px; width:100%;} .documentslist tr:hover { backgound-color:#aaa; } .documentslist tr td { padding:5px; } -#allsessions{ - position: absolute; - z-index: 100500; - top : 40px; - padding: 10px; - background: #ccc; +#office-content{ +padding-left:160px; } +#editing-sessions{ + position:absolute; + left:0; + padding:5px; + top:3em; + width:150px; + overflow:hidden; +} +#editor-content{ +position:relative;top:3em;width: 100%; +} + -#allsessions div{ +#editing-sessions div{ margin:5px 0; } diff --git a/lib/member.php b/lib/member.php index f32df6ea..90a07ee8 100644 --- a/lib/member.php +++ b/lib/member.php @@ -36,14 +36,14 @@ class Member { public static function getMembersAsArray($ids){ $memberCount = count($ids); - if (!$memberCount || !$is_array($ids)){ + if (!$memberCount || !is_array($ids)){ return array(); } $placeholders = array_fill(0, $memberCount, '?'); $stmt = implode(', ', $placeholders); $query = \OCP\DB::prepare('SELECT * FROM `*PREFIX*office_member` WHERE `member_id`IN (' . $stmt . ')'); - $result = $query->execute(array($ids)); + $result = $query->execute($ids); return $result->fetchAll(); } diff --git a/lib/op.php b/lib/op.php index 0ed5b80f..1266537d 100644 --- a/lib/op.php +++ b/lib/op.php @@ -49,10 +49,13 @@ class Op { public static function getOpsAfterJson($esId, $seq){ $ops = self::getOpsAfter($esId, $seq); + if (!is_array($ops)){ + $ops = array(); + } $ops = array_map( function($x){ - $decoded = json_decode($x['opspec']); - $decoded['memberId'] = strval($decoded['memberId']); + $decoded = json_decode($x['opspec'], true); + $decoded['memberid'] = strval($decoded['memberid']); return $decoded; }, $ops