- Timestamp:
- 09/22/08 23:22:18 (2 months ago)
- Location:
- trunk/app
- Files:
-
- 1 added
- 9 modified
-
config/sql/postgresql/karamelo.sql (modified) (3 diffs)
-
config/sql/postgresql/results.sql (modified) (1 diff)
-
controllers/chats_controller.php (modified) (1 diff)
-
controllers/messages_controller.php (modified) (1 diff)
-
controllers/vclassrooms_controller.php (modified) (1 diff)
-
locale/eng/LC_MESSAGES/default.po (modified) (1 diff)
-
views/messages/display.ctp (modified) (3 diffs)
-
views/vclassrooms/chat.ctp (modified) (3 diffs)
-
views/vclassrooms/show.ctp (modified) (1 diff)
-
webroot/img/static/chat-icon.jpg (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/config/sql/postgresql/karamelo.sql
r688 r773 1 1 -- --- 2 2 -- KARAMELO TABLES --- Chipotle Software 2002-2008 3 -- ---4 -- Name: groups; Type: TABLE; Schema: public; Owner: www-data; Tablespace:5 6 -- College information7 3 8 4 \i ./colleges.sql … … 70 66 \i ./results.sql 71 67 \i ./participations.sql 68 \i ./chats.sql 72 69 73 70 \i ./shares.sql 74 71 \i ./metadatas.sql 72 -- ** School resource (Books, CDs, DVDs, Magazines, etc) ** 75 73 \i ./resources.sql 76 74 … … 85 83 \i ./uploads.sql 86 84 \i ./reports.sql 87 \i ./comments_lessons.sql 85 -- ** Comments in Lesson model ** 88 86 \i ./annotations.sql -
trunk/app/config/sql/postgresql/results.sql
r745 r773 6 6 test_id int NOT NULL REFERENCES tests(id) ON DELETE CASCADE, 7 7 vclassroom_id int NOT NULL REFERENCES vclassrooms(id) ON DELETE CASCADE, 8 created timestamp(0) with time zone DEFAULT now() NOT NULL 8 created timestamp(0) with time zone DEFAULT now() NOT NULL, 9 9 PRIMARY KEY (user_id, test_id, vclassroom_id, question_id) 10 10 ); -
trunk/app/controllers/chats_controller.php
r762 r773 46 46 public function getMessages($vclassroom_id) 47 47 { 48 $conditions = array('Chat.vclassroom_id'=>$vclassroom_id); 49 $fields = array('Chat.message', 'Chat.created', 'User.username');; 50 $order = 'Chat.id DESC'; 51 $limit = 15; 48 $this->layout = 'ajax'; 49 $conditions = array('Chat.vclassroom_id'=>$vclassroom_id); 50 $fields = array('Chat.message', 'Chat.created', 'User.username');; 51 $order = 'Chat.id DESC'; 52 $limit = 15; 52 53 53 54 $this->set('data', $this->Chat->findAll($conditions, $fields, $order, $limit)); -
trunk/app/controllers/messages_controller.php
r759 r773 206 206 foreach ($this->data['Message'] as $v): 207 207 if ( $v != 0): 208 $this->Message->del($v);208 $this->Message->del($v); 209 209 endif; 210 210 endforeach; 211 211 212 $this->msgFlash( 'Message deleted.','/messages/listing');212 $this->msgFlash(__('Data removed', true),'/messages/listing'); 213 213 } 214 214 -
trunk/app/controllers/vclassrooms_controller.php
r756 r773 51 51 // student belongs to this class? 52 52 if ( $this->Auth->user()): 53 $this->set('belongs', $this->Vclassroom->belongs($this->Auth->user('id'), $vclassroom_id));53 $this->set('belongs', $this->Vclassroom->belongs($this->Auth->user('id'), $vclassroom_id)); 54 54 else: 55 $this->set('belongs', false);55 $this->set('belongs', false); 56 56 endif; 57 57 $this->Vclassroom->unbindAll(); -
trunk/app/locale/eng/LC_MESSAGES/default.po
r675 r773 7 7 msgid "Join us" 8 8 msgstr "Join us" 9 10 msgid "from_dep" 11 msgstr "From Dep" 9 12 10 13 msgid "logged_in" -
trunk/app/views/messages/display.ctp
r684 r773 3 3 echo $html->para(null, $html->link($html->image('admin/compose_on.gif', array('alt'=>'New message','title'=>'New message')), 4 4 '/messages/compose', null, false, false)); 5 ?> 6 <div id="charging" style="display:none;"><?php echo $html->image('static/loading.gif', array("alt"=>"Loading")); ?></div> 7 <?php 5 6 echo $html->div(null,$html->image('static/loading.gif',array('alt'=>'Loading')),array('id'=>'charging','style'=>'display:none;')); 8 7 9 8 echo '<b>From</b>:' . $data['User']['username'] . '<br />'; … … 13 12 echo '<input type="button" value="'.__('Reply', true).'" onclick="hU()" />'; 14 13 15 echo $ajax->div( "delbutton", array("style"=>"text-align:right"));16 echo $form->create('Message', array('onsubmit'=>'return confirm(\' Are you sure to delete?\')','action'=>'delete'));14 echo $ajax->div('delbutton', array('style'=>'text-align:right')); 15 echo $form->create('Message', array('onsubmit'=>'return confirm(\''.__('Are you sure to want to delete this?', true).'\')','action'=>'delete')); 17 16 echo $form->hidden('Message.id', array('value'=>$data['Message']['id'])); 18 17 echo $form->end(__('Delete', true)); 19 echo $ajax->divEnd( "delbutton");18 echo $ajax->divEnd('delbutton'); 20 19 ?> 21 20 … … 31 30 ?> 32 31 <fieldset> 33 <legend> Reply</legend>32 <legend><?php __('Reply'); ?></legend> 34 33 <?php 35 34 echo $session->read('Auth.User.username') . " writes: <br />"; 36 35 37 echo $form->input('Message.title', array( "size" => 35, "maxlength" => 50, "value"=> 'Re: ' . $data["Message"]["title"])) . "<br />";36 echo $form->input('Message.title', array('size'=>35,'maxlength'=>50,'value'=> 'Re: ' . $data['Message']['title'])) . "<br />"; 38 37 echo $form->label('Message.body', 'Message:').'<br />'; 39 echo $form->textarea('Message.body', array( "cols"=>50, "rows"=>10, "value"=>"\n\n".'>> '.$data["User"]["username"] .' wrote: ' . $data["Message"]["body"]));40 echo $ajax->submit(__('Reply', true), array( "url" => "/messages/add",38 echo $form->textarea('Message.body', array('cols'=>50,'rows'=>10,'value'=>"\n\n".'>> '.$data['User']['username'] .' wrote: ' . $data["Message"]["body"])); 39 echo $ajax->submit(__('Reply', true), array('url' => '/messages/add', 41 40 "update"=>"formhidden", 42 41 "before" => "MyFCKObject.UpdateEditorFormValue();", -
trunk/app/views/vclassrooms/chat.ctp
r761 r773 30 30 //<![CDATA[ 31 31 32 setTimeout("getChatText(<?php echo $data['Vclassroom']['id']; ?>);", 2000);32 setTimeout("getChatText(<?php echo $data['Vclassroom']['id']; ?>);",3000); 33 33 34 34 // Get student total points … … 43 43 {method: 'get', parameters: params, onFailure: reportError}); 44 44 45 setTimeout("getChatText("+vclassroom_id+")",4000); 46 } 47 48 function reportError(request) 49 { 50 alert('Sorry. There was an error.'); 45 51 } 46 52 … … 52 58 } 53 59 54 function ping() { 60 function ping() 61 { 55 62 // Send ping, to let the server know I'm still here 56 63 var url = base_url + 'ping.php'; -
trunk/app/views/vclassrooms/show.ctp
r760 r773 19 19 $t="javascript:window.open('/vclassrooms/chat/".$blog['User']['id']."/".$data['Vclassroom']['id']."', 'blank', 'toolbar=no, scrollbars=yes,width=700,height=400')"; 20 20 echo $html->link( 21 $html->image('static/ feature_chatroom.jpg', array('alt'=>'Chatroom','title'=>'Chatroom','style'=>'margin-right:12px')21 $html->image('static/chat-icon.jpg', array('alt'=>'Chatroom','title'=>'Chatroom','style'=>'margin-right:12px') 22 22 ), '#', array("onclick"=>$t), null, null, false); 23 23
