Index: blocks/quickmail/block_quickmail.php
===================================================================
--- blocks/quickmail/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,130 @@
+<?php // $Id: block_quickmail.php,v 1.10 2007/03/02 03:06:53 mark-nielsen Exp $
+/**
+ * Quickmail - Allows teachers and students to email one another
+ *      at a course level.  Also supports group mode so students
+ *      can only email their group members if desired.  Both group
+ *      mode and student access to Quickmail are configurable by
+ *      editing a Quickmail instance.
+ *
+ * @author Mark Nielsen
+ * @version $Id: block_quickmail.php,v 1.10 2007/03/02 03:06:53 mark-nielsen Exp $
+ * @package quickmail
+ **/ 
+
+/**
+ * This is the Quickmail block class.  Contains the necessary
+ * functions for a Moodle block.  Has some extra functions as well
+ * to increase its flexibility and useability
+ *
+ * @package quickmail
+ * @todo Make a global config so that admins can set the defaults (default for student (yes/no) default for groupmode (select a groupmode or use the courses groupmode)) NOTE: make sure email.php and emaillog.php use the global config settings
+ **/
+class block_quickmail extends block_list {
+    
+    /**
+     * Sets the block name and version number
+     *
+     * @return void
+     **/
+    function init() {
+        $this->title = get_string('blockname', 'block_quickmail');
+        $this->version = 2008071601; // 2006021501;  // YYYYMMDDXX
+    }
+    
+    /**
+     * Gets the contents of the block (course view)
+     *
+     * @return object An object with an array of items, an array of icons, and a string for the footer
+     **/
+    function get_content() {
+        global $USER, $CFG;
+
+        if($this->content !== NULL) {
+            return $this->content;
+        }
+
+        $this->content = new stdClass;
+        $this->content->footer = '';
+        $this->content->items = array();
+        $this->content->icons = array();
+        
+        if (empty($this->instance) or !$this->check_permission()) {
+            return $this->content;
+        }
+
+    /// link to composing an email
+        $this->content->items[] = "<a href=\"$CFG->wwwroot/blocks/quickmail/email.php?id={$this->course->id}&amp;instanceid={$this->instance->id}\">".
+                                    get_string('compose', 'block_quickmail').'</a>';
+
+        $this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/email.gif" height="16" width="16" alt="'.get_string('email').'" />';
+
+    /// link to history log
+        $this->content->items[] = "<a href=\"$CFG->wwwroot/blocks/quickmail/emaillog.php?id={$this->course->id}&amp;instanceid={$this->instance->id}\">".
+                                    get_string('history', 'block_quickmail').'</a>';
+
+        $this->content->icons[] = '<img src="'.$CFG->pixpath.'/t/log.gif" height="14" width="14" alt="'.get_string('log').'" />';
+
+        return $this->content;
+    }
+
+    /**
+     * Loads the course
+     *
+     * @return void
+     **/
+    function specialization() {
+        global $COURSE;
+
+        $this->course = $COURSE;
+    }
+
+    /**
+     * Cleanup the history
+     *
+     * @return boolean
+     **/
+    function instance_delete() {
+        return delete_records('block_quickmail_log', 'courseid', $this->course->id);
+    }
+
+    /**
+     * Set defaults for new instances
+     *
+     * @return boolean
+     **/
+    function instance_create() {
+        $this->config = new stdClass;
+        $this->config->groupmode = $this->course->groupmode;
+        $pinned = (!isset($this->instance->pageid));
+        return $this->instance_config_commit($pinned);
+    }
+
+    /**
+     * Allows the block to be configurable at an instance level.
+     *
+     * @return boolean
+     **/
+    function instance_allow_config() {
+        return true;
+    }
+
+    /**
+     * Check to make sure that the current user is allowed to use Quickmail.
+     *
+     * @return boolean True for access / False for denied
+     **/
+    function check_permission() {
+        return has_capability('block/quickmail:cansend', get_context_instance(CONTEXT_BLOCK, $this->instance->id));
+    }
+
+    /**
+     * Get the groupmode of Quickmail.  This function pays
+     * attention to the course group mode force.
+     *
+     * @return int The group mode of the block
+     **/
+    function groupmode() {
+        return groupmode($this->course, $this->config);
+    }
+}
+?>
Index: blocks/quickmail/emaillog.php
===================================================================
--- blocks/quickmail/emaillog.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/emaillog.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,176 @@
+<?php // $Id: emaillog.php,v 1.14 2007/08/30 17:33:48 mark-nielsen Exp $
+/**
+ * emaillog.php - displays a log (or history) of all emails sent by
+ *      a specific in a specific course.  Each email log can be viewed
+ *      or deleted.
+ *
+ * @todo Add a print option?
+ * @author Mark Nielsen
+ * @version $Id: emaillog.php,v 1.14 2007/08/30 17:33:48 mark-nielsen Exp $
+ * @package quickmail
+ **/
+    
+    require_once('../../config.php');
+    require_once($CFG->libdir.'/blocklib.php');
+    require_once($CFG->libdir.'/tablelib.php');
+    
+    $id = required_param('id', PARAM_INT);    // course id
+    $action = optional_param('action', '', PARAM_ALPHA);
+    $instanceid = optional_param('instanceid', 0, PARAM_INT);
+
+    $instance = new stdClass;
+
+    if (!$course = get_record('course', 'id', $id)) {
+        error('Course ID was incorrect');
+    }
+
+    require_login($course->id);
+
+    if ($instanceid) {
+        $instance = get_record('block_instance', 'id', $instanceid);
+    } else {
+        if ($quickmailblock = get_record('block', 'name', 'quickmail')) {
+            $instance = get_record('block_instance', 'blockid', $quickmailblock->id, 'pageid', $course->id);
+        }
+    }
+
+/// This block of code ensures that Quickmail will run 
+///     whether it is in the course or not
+    if (empty($instance)) {
+        if (has_capability('block/quickmail:cansend', get_context_instance(CONTEXT_BLOCK, $instanceid))) {
+            $haspermission = true;
+        } else {
+            $haspermission = false;
+        }
+    } else {
+        // create a quickmail block instance
+        $quickmail = block_instance('quickmail', $instance);
+        $haspermission = $quickmail->check_permission();
+    }
+    
+    if (!$haspermission) {
+        error('Sorry, you do not have the correct permissions to use Quickmail.');
+    }
+    
+    // log deleting happens here (NOTE: reporting is handled below)
+    $dumpresult = false;
+    if ($action == 'dump') {
+        confirm_sesskey();
+        
+        // delete a single log or all of them
+        if ($emailid = optional_param('emailid', 0, PARAM_INT)) {
+            $dumpresult = delete_records('block_quickmail_log', 'id', $emailid);
+        } else {
+            $dumpresult = delete_records('block_quickmail_log', 'userid', $USER->id);
+        }
+    }
+
+/// set table columns and headers
+    $tablecolumns = array('timesent', 'subject', 'attachment', '');
+    $tableheaders = array(get_string('date', 'block_quickmail'), get_string('subject', 'forum'),
+                         get_string('attachment', 'block_quickmail'), get_string('action', 'block_quickmail'));
+
+    $table = new flexible_table('bocks-quickmail-emaillog');
+
+/// define table columns, headers, and base url
+    $table->define_columns($tablecolumns);
+    $table->define_headers($tableheaders);
+    $table->define_baseurl($CFG->wwwroot.'/blocks/quickmail/emaillog.php?id='.$course->id.'&amp;instanceid='.$instanceid);
+
+/// table settings
+    $table->sortable(true, 'timesent', SORT_DESC);
+    $table->collapsible(true);
+    $table->initialbars(false);
+    $table->pageable(true);
+
+/// column styles (make sure date does not wrap) NOTE: More table styles in styles.php
+    $table->column_style('timesent', 'width', '40%');
+    $table->column_style('timesent', 'white-space', 'nowrap');
+
+/// set attributes in the table tag
+    $table->set_attribute('cellspacing', '0');
+    $table->set_attribute('id', 'emaillog');
+    $table->set_attribute('class', 'generaltable generalbox');
+    $table->set_attribute('align', 'center');
+    $table->set_attribute('width', '80%');
+
+    $table->setup();  
+    
+/// SQL
+    $sql = "SELECT * 
+              FROM {$CFG->prefix}block_quickmail_log
+             WHERE courseid = $course->id 
+               AND userid = $USER->id ";
+
+    if ($table->get_sql_where()) {
+        $sql .= 'AND '.$table->get_sql_where();
+    }
+
+    $sql .= ' ORDER BY '. $table->get_sql_sort();
+
+/// set page size
+    $total = count_records('block_quickmail_log', 'courseid', $course->id, 'userid', $USER->id);
+    $table->pagesize(10, $total);
+
+    if ($pastemails = get_records_sql($sql, $table->get_page_start(), $table->get_page_size())) {
+        foreach ($pastemails as $pastemail) {
+            $table->add_data( array(userdate($pastemail->timesent),
+                                    s($pastemail->subject),
+                                    format_string($pastemail->attachment, true),
+                                    "<a href=\"email.php?id=$course->id&amp;instanceid=$instanceid&amp;emailid=$pastemail->id&amp;action=view\">".
+                                    "<img src=\"$CFG->pixpath/i/search.gif\" height=\"14\" width=\"14\" alt=\"".get_string('view').'" /></a> '.
+                                    "<a href=\"emaillog.php?id=$course->id&amp;instanceid=$instanceid&amp;sesskey=$USER->sesskey&amp;action=dump&amp;emailid=$pastemail->id\">".
+                                    "<img src=\"$CFG->pixpath/t/delete.gif\" height=\"11\" width=\"11\" alt=\"".get_string('delete').'" /></a>'));
+        }
+    }
+    
+/// Start printing everyting
+    $strquickmail = get_string('blockname', 'block_quickmail');
+    if (empty($pastemails)) {
+        $disabled = 'disabled="disabled" ';
+    } else {
+        $disabled = '';
+    }
+    $button = "<form method=\"post\" action=\"$CFG->wwwroot/blocks/quickmail/emaillog.php\">
+               <input type=\"hidden\" name=\"id\" value=\"$course->id\" />
+               <input type=\"hidden\" name=\"instanceid\" value=\"$instanceid\" />
+               <input type=\"hidden\" name=\"sesskey\" value=\"".sesskey().'" />
+               <input type="hidden" name="action" value="confirm" />
+               <input type="submit" name="submit" value="'.get_string('clearhistory', 'block_quickmail')."\" $disabled/>
+               </form>";
+    
+/// Header setup
+    if ($course->category) {
+        $navigation = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->";
+    } else {
+        $navigation = '';
+    }
+
+    print_header("$course->fullname: $strquickmail", $course->fullname, "$navigation $strquickmail", '', '', true, $button);
+
+    print_heading($strquickmail);
+    
+    $currenttab = 'history';
+    include($CFG->dirroot.'/blocks/quickmail/tabs.php');
+    
+/// delete reporting happens here
+    if ($action == 'dump') {
+        if ($dumpresult) {
+            notify(get_string('deletesuccess', 'block_quickmail'), 'notifysuccess');
+        } else {
+            notify(get_string('deletefail', 'block_quickmail'));
+        }
+    }
+
+    if ($action == 'confirm') {
+        notice_yesno(get_string('areyousure', 'block_quickmail'), 
+                     "$CFG->wwwroot/blocks/quickmail/emaillog.php?id=$course->id&amp;instanceid=$instanceid&amp;sesskey=".sesskey()."&amp;action=dump",
+                     "$CFG->wwwroot/blocks/quickmail/emaillog.php?id=$course->id&amp;instanceid=$instanceid");
+    } else {
+        echo '<div id="tablecontainer">';
+        $table->print_html();
+        echo '</div>';
+    }
+
+    print_footer();
+?>
\ No newline at end of file
Index: blocks/quickmail/tabs.php
===================================================================
--- blocks/quickmail/tabs.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/tabs.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,28 @@
+<?php // $Id: tabs.php,v 1.2 2007/03/02 03:06:53 mark-nielsen Exp $
+/**
+ * Tabs for Quickmail
+ *
+ * @author Mark Nielsen
+ * @version $Id: tabs.php,v 1.2 2007/03/02 03:06:53 mark-nielsen Exp $
+ * @package quickmail
+ **/
+
+    if (empty($course)) {
+        error('Programmer error: cannot call this script without $course set');
+    }
+    if (!isset($instanceid)) {
+        $instanceid = 0;
+    }
+    if (empty($currenttab)) {
+        $currenttab = 'compose';
+    }
+
+    $rows = array();
+    $row = array();
+
+    $row[] = new tabobject('compose', "$CFG->wwwroot/blocks/quickmail/email.php?id=$course->id&amp;instanceid=$instanceid", get_string('compose', 'block_quickmail'));
+    $row[] = new tabobject('history', "$CFG->wwwroot/blocks/quickmail/emaillog.php?id=$course->id&amp;instanceid=$instanceid", get_string('history', 'block_quickmail'));
+    $rows[] = $row;
+
+    print_tabs($rows, $currenttab);
+?>
\ No newline at end of file
Index: blocks/quickmail/lang/ja_utf8/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/ja_utf8/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/ja_utf8/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,34 @@
+<?PHP // $Id: block_quickmail.php,v 1.5 2007/03/02 03:06:55 mark-nielsen Exp $ 
+      // block_quickmail.php - created with Moodle 1.8 dev (2007012500)
+
+
+$string['action'] = '操作';
+$string['areyousure'] = '本当に履歴中のすべてのメールを削除してもよろしいですか?';
+$string['attachment'] = '添付';
+$string['attachmentalt'] = 'メールに添付ファイルを追加する';
+$string['attachmenterror'] = '有効な添付ファイルではありません! 次のファイルは存在していません： <strong>$a</strong>';
+$string['attachmentoptional'] = '添付 (任意)';
+$string['blockname'] = 'クイックメール';
+$string['check'] = 'すべてを選択';
+$string['clearhistory'] = 'すべての履歴をクリア';
+$string['compose'] = '作成';
+$string['date'] = '日時';
+$string['delete'] = '削除';
+$string['deletefail'] = '削除が失敗しました。';
+$string['deletesuccess'] = '正常に削除されました。';
+$string['email'] = 'メール';
+$string['emailfail'] = 'メールエラー:';
+$string['emailfailerror'] = 'エラーが発生したため、下記のユーザにメール送信されませんでした ...';
+$string['emailstop'] = 'メールアドレスが無効にされています:';
+$string['history'] = '履歴';
+$string['messageerror'] = 'メッセージを入力してください!';
+$string['nogroupmembers'] = 'グループメンバーなし';
+$string['notingroup'] = 'グループ外';
+$string['sendemail'] = 'メールを送信する';
+$string['subjecterror'] = '題名を入力してください!';
+$string['successfulemail'] = 'メールが正常に送信されました。';
+$string['to'] = 'To';
+$string['toerror'] = 'メールの受信者を選択してください!';
+$string['uncheck'] = 'すべての選択を解除';
+
+?>

Property changes on: blocks/quickmail/lang/ja_utf8/block_quickmail.php
___________________________________________________________________
Added: svn:executable
   + *

Index: blocks/quickmail/lang/en/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/en/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/en/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,38 @@
+<?php // $Id: block_quickmail.php,v 1.10 2007/03/02 03:06:54 mark-nielsen Exp $
+/**
+ * Language entries for Quickmail
+ *
+ * @author Mark Nielsen
+ * @version $Id: block_quickmail.php,v 1.10 2007/03/02 03:06:54 mark-nielsen Exp $
+ * @package quickmail
+ **/
+
+$string['action'] = 'Action';
+$string['areyousure'] = 'Are you sure you want to delete all emails in your history?';
+$string['attachment'] = 'Attachment';
+$string['attachmentalt'] = 'Add an attachment to your email';
+$string['attachmenterror'] = 'Not a valid attachment!  The following file does not exist: <strong>$a</strong>';
+$string['attachmentoptional'] = 'Attachment (Optional)';
+$string['blockname'] = 'Quickmail';
+$string['check'] = 'Check All';
+$string['clearhistory'] = 'Clear History';
+$string['compose'] = 'Compose';
+$string['date'] = 'Date';
+$string['delete'] = 'Delete';
+$string['deletefail'] = 'Delete(s) Failed';
+$string['deletesuccess'] = 'Delete(s) Successful';
+$string['email'] = 'Email';
+$string['emailfail'] = 'email error:';
+$string['emailfailerror'] = 'The following users were not emailed due to...';
+$string['emailstop'] = 'disabled email address:';
+$string['history'] = 'History';
+$string['messageerror'] = 'Must have a message!';
+$string['nogroupmembers'] = 'No group members';
+$string['notingroup'] = 'Not in a group';
+$string['sendemail'] = 'Send Email';
+$string['subjecterror'] = 'Must have a subject!';
+$string['successfulemail'] = 'Email(s) sent successfully';
+$string['to'] = 'To';
+$string['toerror'] = 'Must select recipients for the email!';
+$string['uncheck'] = 'Uncheck All';
+?>
Index: blocks/quickmail/lang/he_utf8/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/he_utf8/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/he_utf8/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,41 @@
+<?php // $Id: block_quickmail.php,v 1.1 2007/08/30 18:46:09 mark-nielsen Exp $
+/**
+ * Language entries for Quickmail
+ *
+ * @author Mark Nielsen
+ * @version $Id: block_quickmail.php,v 1.1 2007/08/30 18:46:09 mark-nielsen Exp $
+ * @package quickmail
+ * @Translated by Miki Alliel  
+ **/
+
+$string['action'] = 'פעולה';
+$string['areyousure'] = 'האם אתה בטוח כי ברצונך למחוק את כל הדוא\"לים מההיסטוריה?';
+$string['attachment'] = 'קובץ מצורף';
+$string['attachmentalt'] = 'הוסף קובץ מצורף לדוא\"ל שלך';
+$string['attachmenterror'] = 'קובץ מצורף זה שגוי! הקובץ לא קיים: <strong>$a</strong>';
+$string['attachmentoptional'] = 'קובץ מצורף (אופציונלי)';
+$string['blockname'] = 'דוא\"ל מהיר';
+$string['check'] = 'בחר הכל';
+$string['clearhistory'] = 'נקה היסטוריה';
+$string['compose'] = 'כתוב דוא\"ל';
+$string['date'] = 'תאריך';
+$string['delete'] = 'מחק';
+$string['deletefail'] = 'מחיקה נכשלה';
+$string['deletesuccess'] = 'מחיקה הצליחה';
+$string['email'] = 'דוא\"ל';
+$string['emailfail'] = 'שגיאה בדוא\"ל';
+$string['emailfailerror'] = 'הדוא\"ל לא נשלח בהצלחה למשתמשים הבאים בגלל ש...';
+$string['emailstop'] = 'כתובות דוא\"ל מנוטרלות';
+$string['history'] = 'היסטוריה';
+$string['messageerror'] = 'חייבת להיות הודעה';
+$string['nogroupmembers'] = 'אין חברי קבוצות';
+$string['notingroup'] = 'לא נמצא בקבוצה';
+$string['quickmail:cansend'] = 'יכול לשלוח דוא\"לים דרך תוכנת quickmail';
+$string['sendemail'] = 'שלח דואר';
+$string['subjecterror'] = 'חייב להיות נושא!';
+$string['successfulemail'] = 'הדוא\"ל נשלח בהצלחה!';
+$string['to'] = 'אל';
+$string['toerror'] = 'חייב לבחור נמענים עבור הדוא\"ל';
+$string['uncheck'] = 'בטל בחירה לכל';
+
+?>
Index: blocks/quickmail/lang/hu_utf8/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/hu_utf8/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/hu_utf8/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,38 @@
+﻿<?php 
+/**
+ * Language entries for Quickmail
+ *
+ * @author Császár-Cs. Péter
+ **/
+
+$string['action'] = 'Akció';
+$string['allowstudents'] = 'Quickmail engedélyezése $a -nak';
+$string['areyousure'] = 'Biztos benne, hogy minden levelet törölni akar az előzményekből?';
+$string['attachment'] = 'Melléklet';
+$string['attachmentalt'] = 'Melléklet csatolása a levélhez';
+$string['attachmenterror'] = 'Nem megfelelő melléklet!  A következő file nem lézetik: <strong>$a</strong>';
+$string['attachmentoptional'] = 'Melléklet (Opcionális)';
+$string['blockname'] = 'Quickmail';
+$string['check'] = 'Összes ellenőrzése';
+$string['clearhistory'] = 'Előzmények törlése';
+$string['compose'] = 'Új levél';
+$string['date'] = 'Dátum';
+$string['delete'] = 'Töröl';
+$string['deletefail'] = 'Törlés sikertelen';
+$string['deletesuccess'] = 'Törlés sikeres';
+$string['email'] = 'Email';
+$string['emailfail'] = 'email hiba:';
+$string['emailfailerror'] = 'A következő felhasználók nem kaptak levelet...';
+$string['emailstop'] = 'letiltott levélcím:';
+$string['history'] = 'Előzmény';
+$string['messageerror'] = 'Üres levelet nem küldhet!';
+$string['nogroupmembers'] = 'Nincsen csoport tag';
+$string['notingroup'] = 'Nincs a csoportban';
+$string['sendemail'] = 'Levél küldése';
+$string['subjecterror'] = 'Üres tárggyal nem küldhet levelet!';
+$string['successfulemail'] = 'A levél(ek) sikeresen elküldve';
+$string['to'] = 'Címzett';
+$string['toerror'] = 'Válasszon címzettet a levelének!';
+$string['uncheck'] = 'Összes kijelölés megszüntetése';
+
+?>

Property changes on: blocks/quickmail/lang/hu_utf8/block_quickmail.php
___________________________________________________________________
Added: svn:executable
   + *

Index: blocks/quickmail/lang/it_utf8/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/it_utf8/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/it_utf8/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,41 @@
+<?php // $Id
+/**
+ * Language entries for Quickmail
+ *
+ * @author Mark Nielsen
+ * @version $Id
+ * @package quickmail
+ * Translation by Lorenzo Nicora
+ **/
+
+$string['action'] = 'Azione';
+$string['areyousure'] = 'Sei certo di voler cancellare tutte le e-mail dallo storico?';
+$string['attachment'] = 'Allegato';
+$string['attachmentalt'] = 'Aggiungi un allegato alla e-mail';
+$string['attachmenterror'] = 'Allegato non valido!  Il file <strong>$a</strong> non esiste';
+$string['attachmentoptional'] = 'Allegato (Opzionale)';
+$string['blockname'] = 'Quickmail';
+$string['check'] = 'Seleziona Tutti';
+$string['clearhistory'] = 'Cancella Storico';
+$string['compose'] = 'Invia';
+$string['date'] = 'Data';
+$string['delete'] = 'Elimina';
+$string['deletefail'] = 'Cancellazione Fallita';
+$string['deletesuccess'] = 'Cancellazione Eseguita';
+$string['email'] = 'Email';
+$string['emailfail'] = 'errore e-mail:';
+$string['emailfailerror'] = 'Le e-mail non sono state inviate ai seguenti utenti, a causa di...';
+$string['emailstop'] = 'indirizzo e-mail disabilitato:';
+$string['history'] = 'Storico';
+$string['messageerror'] = 'Devi scrivere un messaggio!';
+$string['nogroupmembers'] = 'Nessun membro del Gruppo';
+$string['notingroup'] = 'Non appartiene a nessun Gruppo';
+$string['quickmail:cansend'] = 'Può inviare mail con Quickmail';
+$string['sendemail'] = 'Invia E-mail';
+$string['subjecterror'] = 'Devi specificare un Soggetto!';
+$string['successfulemail'] = 'E-mail inviate con successo';
+$string['to'] = 'A';
+$string['toerror'] = 'Devi selezionare dei destinatari per la mail!';
+$string['uncheck'] = 'Deseleziona Tutti';
+
+?>
Index: blocks/quickmail/lang/es/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/es/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/es/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,42 @@
+<?php // $Id: block_quickmail.php,v 1.3 2007/03/02 03:06:55 mark-nielsen Exp $
+
+/**
+ * Language entries for Quickmail
+ *
+ * @author Mark Nielsen; Translation provided by Rodrigo Filgueira
+ * @version $Id: block_quickmail.php,v 1.3 2007/03/02 03:06:55 mark-nielsen Exp $
+ * @package quickmail
+ **/
+
+$string['composeemail'] = 'Escribir correo';
+$string['action'] = 'Accin';
+$string['attachment'] = 'Adjunto';
+$string['attachmentoptional'] = 'Adjunto (Opcional)';
+$string['attachmenterror'] = 'Adjuno no valido!  Este archivo no existe: <strong>$a</strong>';
+$string['blockname'] = 'Correo';
+$string['check'] = 'Marcar todos';
+$string['clearhistory'] = 'Borrar el histrico';
+$string['composenew'] = 'Crear nuevo Correo';
+$string['date'] = 'Fecha';
+$string['delete'] = 'Eliminar';
+$string['deletefail'] = 'Fallo al eliminar';
+$string['deletesuccess'] = 'Eliminar exitoso';
+$string['email'] = 'Email';
+$string['emailfail'] = 'error de email:';
+$string['emailfailerror'] = 'A los siguientes usuarios no se les envi el correo debido a...';
+$string['emailhistory'] = 'Historial de Correos';
+$string['emailstop'] = 'direccion de correo deshabilitada:';
+$string['messageerror'] = 'Debe escribir algn mensaje!';
+$string['nogroupmembers'] = 'Grupo sin miebros';
+$string['notingroup'] = 'Sin pertenencia a grupos';
+$string['sendemail'] = 'Enviar correo';
+$string['subjecterror'] = 'Debe especificar un tema!';
+$string['successfulemail'] = 'Correo(s) enviados exitosamente';
+$string['to'] = 'Destinatario';
+$string['toerror'] = 'Debe indicar uno o mas destinatarios!';
+$string['uncheck'] = 'Desmarcar todos';
+$string['view'] = 'Ver';
+$string['attachmentalt'] = 'Adjunte un archivo a su correo';
+
+
+?>
Index: blocks/quickmail/lang/fr/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/fr/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/fr/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,37 @@
+<?PHP // $Id: block_quickmail.php,v 1.2 2006/09/30 20:58:09 mark-nielsen Exp $
+
+/**
+ * Language entries for Quickmail
+ *
+ * @author Mark Nielsen
+ * @version $Id: block_quickmail.php,v 1.2 2006/09/30 20:58:09 mark-nielsen Exp $
+ * @package quickmail
+ **/ 
+
+$string['action'] = 'Action';
+$string['attachment'] = 'Pice jointe';
+$string['attachmenterror'] = 'Pice jointe non valide!  Le fichier: <strong>$a</strong> n\'existe pas';
+$string['blockname'] = 'Quickmail';
+$string['check'] = 'Tout slectionner';
+$string['clearhistory'] = 'Supprimer l\'historique ';
+$string['composenew'] = 'Composer un nouveau Courriel';
+$string['date'] = 'Date';
+$string['delete'] = 'Supprimer';
+$string['deletefail'] = 'Erreur dans Suppression(s)';
+$string['deletesuccess'] = 'Suppression(s) russie(s)';
+$string['email'] = 'Courriel';
+$string['emailfail'] = 'Pas de Courriel pour les utilisateurs suivants:';
+$string['emailhistory'] = 'Historique Quickmail';
+$string['messageerror'] = 'Message obligatoire!';
+$string['noemailssent'] = 'Aucune courriel envoy';
+$string['sendemail'] = 'Envoyez Courriel';
+$string['subjecterror'] = 'Sujet obligatoire!';
+$string['successfulemail'] = 'Envoi Courriel(s) russi!';
+$string['to'] = 'A';
+$string['toerror'] = 'Destinataire(s) obligatoire!';
+$string['uncheck'] = 'Tout dselectionner';
+$string['view'] = 'Examiner';
+
+
+?>
+
Index: blocks/quickmail/lang/en_utf8/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/en_utf8/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/en_utf8/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,41 @@
+<?php // $Id: block_quickmail.php,v 1.3 2007/03/02 03:06:54 mark-nielsen Exp $
+/**
+ * Language entries for Quickmail
+ *
+ * @author Mark Nielsen
+ * @version $Id: block_quickmail.php,v 1.3 2007/03/02 03:06:54 mark-nielsen Exp $
+ * @package quickmail
+ **/
+
+$string['action'] = 'Action';
+$string['areyousure'] = 'Are you sure you want to delete all emails in your history?';
+$string['attachment'] = 'Attachment';
+$string['attachmentalt'] = 'Add an attachment to your email';
+$string['attachmenterror'] = 'Not a valid attachment!  The following file does not exist: <strong>$a</strong>';
+$string['attachmentoptional'] = 'Attachment (Optional)';
+$string['blockname'] = 'Quickmail';
+$string['check'] = 'Check All';
+$string['clearhistory'] = 'Clear History';
+$string['compose'] = 'Compose';
+$string['date'] = 'Date';
+$string['delete'] = 'Delete';
+$string['deletefail'] = 'Delete(s) Failed';
+$string['deletesuccess'] = 'Delete(s) Successful';
+$string['email'] = 'Email';
+$string['emailfail'] = 'email error:';
+$string['emailfailerror'] = 'The following users were not emailed due to...';
+$string['emailstop'] = 'disabled email address:';
+$string['history'] = 'History';
+$string['messageerror'] = 'Must have a message!';
+$string['nogroupmembers'] = 'No group members';
+$string['notingroup'] = 'Not in a group';
+$string['quickmail:cansend'] = 'Can send emails with Quickmail';
+$string['quickmail:canrecv'] = 'Appears in Quickmail recipient list';
+$string['sendemail'] = 'Send Email';
+$string['subjecterror'] = 'Must have a subject!';
+$string['successfulemail'] = 'Email(s) sent successfully';
+$string['to'] = 'To';
+$string['toerror'] = 'Must select recipients for the email!';
+$string['uncheck'] = 'Uncheck All';
+
+?>
Index: blocks/quickmail/lang/pt_utf8/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/pt_utf8/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/pt_utf8/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,42 @@
+<?php
+/**
+* Language entries for Quickmail
+*
+* @author Mark Nielsen
+* @version $Id: block_quickmail.php,v 1.1 2007/12/30 18:50:20 mark-nielsen Exp $
+* @package quickmail
+* @translation Jaime Villate, 2007/12/06
+**/
+
+$string['action'] = 'Acção';
+$string['areyousure'] = 'Tem a certeza que quer apagar todas as mensagens do seu historial?';
+$string['attachment'] = 'Anexo';
+$string['attachmentalt'] = 'Adicionar um anexo à sua mensagem';
+$string['attachmenterror'] = 'O Anexo não é válido! O seguinte ficheiro não existe: <strong>$a</strong>';
+$string['attachmentoptional'] = 'Anexo (Opcional)';
+$string['blockname'] = 'Correio Rápido';
+$string['check'] = 'Seleccionar todos';
+$string['clearhistory'] = 'Apagar Historial';
+$string['compose'] = 'Compor mensagem';
+$string['date'] = 'Data';
+$string['delete'] = 'eliminar';
+$string['deletefail'] = 'Não foi possível eliminar';
+$string['deletesuccess'] = 'Eliminado(s) com Sucesso';
+$string['email'] = 'Correio electrónico';
+$string['emailfail'] = 'Erro no correio electrónico:';
+$string['emailfailerror'] = 'Não foi enviado correio para os seguintes utilizadores devido a ...';
+$string['emailstop'] = 'desactivado o endereço de correio:';
+$string['history'] = 'Historial';
+$string['messageerror'] = 'Deve escrever um Assunto!';
+$string['nogroupmembers'] = 'Não há membros no grupo';
+$string['notingroup'] = 'Não pertence a um grupo';
+$string['quickmail:cansend'] = 'Pode enviar mensagens com Correio Rápido';
+$string['sendemail'] = 'Enviar Correio';
+$string['subjecterror'] = 'Deve escrever um Assunto!';
+$string['successfulemail'] = 'Correio enviado com sucesso!';
+$string['to'] = 'Para';
+$string['toerror'] = 'Deve seleccionar destinatário(s) da mensagem!';
+$string['uncheck'] = 'Desmarcar Todos';
+$string['view'] = 'Ver';
+
+?>
Index: blocks/quickmail/lang/ja/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/ja/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/ja/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,34 @@
+<?PHP // $Id: block_quickmail.php,v 1.5 2007/03/02 03:06:55 mark-nielsen Exp $ 
+      // block_quickmail.php - created with Moodle 1.8 dev (2007012500)
+
+
+$string['action'] = '操作';
+$string['areyousure'] = '本当に履歴中のすべてのメールを削除してもよろしいですか?';
+$string['attachment'] = '添付';
+$string['attachmentalt'] = 'メールに添付ファイルを追加する';
+$string['attachmenterror'] = '有効な添付ファイルではありません! 次のファイルは存在していません： <strong>$a</strong>';
+$string['attachmentoptional'] = '添付 (任意)';
+$string['blockname'] = 'クイックメール';
+$string['check'] = 'すべてを選択';
+$string['clearhistory'] = 'すべての履歴をクリア';
+$string['compose'] = '作成';
+$string['date'] = '日時';
+$string['delete'] = '削除';
+$string['deletefail'] = '削除が失敗しました。';
+$string['deletesuccess'] = '正常に削除されました。';
+$string['email'] = 'メール';
+$string['emailfail'] = 'メールエラー:';
+$string['emailfailerror'] = 'エラーが発生したため、下記のユーザにメール送信されませんでした ...';
+$string['emailstop'] = 'メールアドレスが無効にされています:';
+$string['history'] = '履歴';
+$string['messageerror'] = 'メッセージを入力してください!';
+$string['nogroupmembers'] = 'グループメンバーなし';
+$string['notingroup'] = 'グループ外';
+$string['sendemail'] = 'メールを送信する';
+$string['subjecterror'] = '題名を入力してください!';
+$string['successfulemail'] = 'メールが正常に送信されました。';
+$string['to'] = 'To';
+$string['toerror'] = 'メールの受信者を選択してください!';
+$string['uncheck'] = 'すべての選択を解除';
+
+?>

Property changes on: blocks/quickmail/lang/ja/block_quickmail.php
___________________________________________________________________
Added: svn:executable
   + *

Index: blocks/quickmail/lang/sk/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/sk/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/sk/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,41 @@
+<?PHP // $Id: block_quickmail.php,v 1.4 2007/03/02 03:06:55 mark-nielsen Exp $
+
+/**
+ * Language entries for Quickmail
+ *
+ * @author Mark Nielsen
+ * @version $Id: block_quickmail.php,v 1.4 2007/03/02 03:06:55 mark-nielsen Exp $
+ * @package quickmail
+ **/
+
+
+$string['action'] = 'Akcia';
+$string['attachment'] = 'Prloha';
+$string['attachmenterror'] = 'Prloha nie je validn!  Nasledovn sbor neexistuje: <strong>$a</strong>';
+$string['blockname'] = 'Quickmail';
+$string['check'] = 'Oznai vetkch';
+$string['clearhistory'] = 'Vymaza histriu';
+$string['composenew'] = 'Psanie novho mailu';
+$string['date'] = 'Dtum';
+$string['delete'] = 'Vymaza';
+$string['deletefail'] = 'Vymazanie sa nepodarilo';
+$string['deletesuccess'] = 'Vymazanie spen';
+$string['email'] = 'Email';
+$string['emailfail'] = 'Chyba v emaile:';
+$string['emailfailerror'] = 'Nasledovnm uvateom nebol poslan email z dvodu...';
+$string['emailhistory'] = 'Histria Quickmailu';
+$string['emailstop'] = 'zablokovan emailov adresa:';
+$string['messageerror'] = 'Mus ma sprvu!';
+$string['noemailssent'] = 'iadne zaznamenan sprvy';
+$string['nogroupmembers'] = 'iadni lenovia skupiny';
+$string['notingroup'] = 'Nie je v skupine';
+$string['sendemail'] = 'Posla sprvu';
+$string['subjecterror'] = 'Treba zada predmet sprvy!';
+$string['successfulemail'] = 'Mail(y) boli spene poslan!';
+$string['to'] = 'Komu';
+$string['toerror'] = 'Je potrebn vybra prjemcu sprvy!';
+$string['uncheck'] = 'Odznai vetkch';
+$string['view'] = 'Pohad';
+
+
+?>
Index: blocks/quickmail/lang/de_utf8/block_quickmail.php
===================================================================
--- blocks/quickmail/lang/de_utf8/block_quickmail.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/lang/de_utf8/block_quickmail.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,42 @@
+<?php // $Id: block_quickmail.php,v 1.3 2007/03/02 03:06:54 mark-nielsen Exp $
+
+/**
+ * Language entries for Quickmail
+ *
+ * @author Mark Nielsen; Translation provided by Jagemann Consult www.e-instructor.de
+ * @version $Id: block_quickmail.php,v 1.3 2007/03/02 03:06:54 mark-nielsen Exp $
+ * @package quickmail
+ **/
+
+$string['composeemail'] = 'Email verfassen';
+$string['action'] = 'Aktion';
+$string['attachment'] = 'Anhang';
+$string['attachmentoptional'] = 'Anhang (Optional)';
+$string['attachmenterror'] = 'Kein gltiger Anhang!  Die nachstehende Datei existiert nicht auf dem Server: <strong>$a</strong>';
+$string['blockname'] = 'Quickmail';
+$string['check'] = 'Alle markieren';
+$string['clearhistory'] = 'Bisher gesendete Mails lschen?';
+$string['composenew'] = 'Neue Email verfassen';
+$string['date'] = 'Datum';
+$string['delete'] = 'Lschen';
+$string['deletefail'] = 'Lschen(s) fehlgeschlagen';
+$string['deletesuccess'] = 'Lschen(s) erfolgreich';
+$string['email'] = 'Email';
+$string['emailfail'] = 'Fehler Email:';
+$string['emailfailerror'] = 'Die nachstehenden Teilnehmer sind nicht erreichbar...';
+$string['emailhistory'] = 'Bisher gesendete Emails';
+$string['emailstop'] = 'Deaktivierte Emailadressen:';
+$string['messageerror'] = 'Sie mssen eine Nachricht eintragen!';
+$string['nogroupmembers'] = 'Keine Mitglieder in Gruppen';
+$string['notingroup'] = 'Nicht in einer Gruppe';
+$string['sendemail'] = 'Email senden';
+$string['subjecterror'] = 'Sie mssen einen Betreff angeben!';
+$string['successfulemail'] = 'Email(s) wurden erfolgreich gesendet';
+$string['to'] = 'Zu';
+$string['toerror'] = 'Sie mssen mindestens einen Teilnehmer fr eine Email auswhlen!';
+$string['uncheck'] = 'Alle Markierungen aufheben';
+$string['view'] = 'Ansicht';
+$string['attachmentalt'] = 'Einen Anhang zur Email hinzufgen';
+
+
+?>
\ No newline at end of file

Property changes on: blocks/quickmail/lang/de_utf8/block_quickmail.php
___________________________________________________________________
Added: svn:executable
   + *

Index: blocks/quickmail/db/mysql.sql
===================================================================
--- blocks/quickmail/db/mysql.sql	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/db/mysql.sql	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,14 @@
+# $Id: mysql.sql,v 1.3 2006/04/19 22:39:18 michaelpenne Exp $
+
+create table prefix_block_quickmail_log
+   ( id int(10) unsigned not null auto_increment,
+     courseid int(10) unsigned not null,
+     userid int(10) unsigned not null,
+     mailto text not null,
+     subject varchar(255) not null,
+     message text not null,
+     attachment varchar(255) not null,
+     format tinyint(3) unsigned not null default 1,
+     timesent int(10) unsigned not null,
+     PRIMARY KEY  (id)
+    );
\ No newline at end of file
Index: blocks/quickmail/db/postgres7.php
===================================================================
--- blocks/quickmail/db/postgres7.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/db/postgres7.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,32 @@
+<?PHP  //$Id: postgres7.php,v 1.2 2006/02/01 19:54:59 michaelpenne Exp $
+//
+// This file keeps track of upgrades to Moodle's
+// blocks system.
+//
+// Sometimes, changes between versions involve
+// alterations to database structures and other
+// major things that may break installations.
+//
+// The upgrade function in this file will attempt
+// to perform all the necessary actions to upgrade
+// your older installtion to the current version.
+//
+// If there's something it cannot do itself, it
+// will tell you what you need to do.
+//
+// Versions are defined by backup_version.php
+//
+// This file is tailored to PostgreSQL
+
+function quickmail_upgrade($oldversion=0) {
+
+    global $CFG;
+    
+    $result = true;
+    
+    if ($oldversion < 2004090200 && $result) {
+        $result = true;
+    }
+
+    return $result;
+}
Index: blocks/quickmail/db/install.xml
===================================================================
--- blocks/quickmail/db/install.xml	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/db/install.xml	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<XMLDB PATH="blocks/quickmail/db" VERSION="20070301" COMMENT="XMLDB file for block blocks/quickmail"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
+>
+  <TABLES>
+      <TABLE NAME="block_quickmail_log" COMMENT="Stores the email history for the quickmail block">
+        <FIELDS>
+          <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
+          <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
+          <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="mailto"/>
+          <FIELD NAME="mailto" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="subject"/>
+          <FIELD NAME="subject" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="mailto" NEXT="message"/>
+          <FIELD NAME="message" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="subject" NEXT="attachment"/>
+          <FIELD NAME="attachment" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="message" NEXT="format"/>
+          <FIELD NAME="format" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="attachment" NEXT="timesent"/>
+          <FIELD NAME="timesent" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format"/>
+        </FIELDS>
+        <KEYS>
+          <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for block_quickmail_log" NEXT="courseid"/>
+          <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary" NEXT="userid"/>
+          <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="courseid"/>
+        </KEYS>
+      </TABLE>
+  </TABLES>
+</XMLDB>
\ No newline at end of file
Index: blocks/quickmail/db/access.php
===================================================================
--- blocks/quickmail/db/access.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/db/access.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,49 @@
+<?php
+//
+// Capability definitions for the this block.
+//
+// The capabilities are loaded into the database table when the block is
+// installed or updated. Whenever the capability definitions are updated,
+// the module version number should be bumped up.
+//
+// The system has four possible values for a capability:
+// CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
+//
+//
+// CAPABILITY NAMING CONVENTION
+//
+// It is important that capability names are unique. The naming convention
+// for capabilities that are specific to modules and blocks is as follows:
+//   [mod/block]/<component_name>:<capabilityname>
+//
+// component_name should be the same as the directory name of the mod or block.
+//
+// Core moodle capabilities are defined thus:
+//    moodle/<capabilityclass>:<capabilityname>
+//
+// Examples: mod/forum:viewpost
+//           block/recent_activity:view
+//           moodle/site:deleteuser
+//
+// The variable name for the capability definitions array follows the format
+//   $<componenttype>_<component_name>_capabilities
+//
+// For the core capabilities, the variable is $moodle_capabilities.
+
+
+$block_quickmail_capabilities = array(
+
+    'block/quickmail:cansend' => array(
+
+        'captype' => 'write',
+        'contextlevel' => CONTEXT_BLOCK,
+        'legacy' => array(
+            'teacher' => CAP_ALLOW,
+            'editingteacher' => CAP_ALLOW,
+            'coursecreator' => CAP_ALLOW,
+            'admin' => CAP_ALLOW
+        )
+    ),
+);
+
+?>
\ No newline at end of file
Index: blocks/quickmail/db/mysql.php
===================================================================
--- blocks/quickmail/db/mysql.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/db/mysql.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,43 @@
+<?PHP  //$Id: mysql.php,v 1.3 2006/02/01 19:54:59 michaelpenne Exp $
+//
+// This file keeps track of upgrades to Moodle's
+// blocks system.
+//
+// Sometimes, changes between versions involve
+// alterations to database structures and other
+// major things that may break installations.
+//
+// The upgrade function in this file will attempt
+// to perform all the necessary actions to upgrade
+// your older installtion to the current version.
+//
+// If there's something it cannot do itself, it
+// will tell you what you need to do.
+//
+// Versions are defined by backup_version.php
+//
+// This file is tailored to MySQL
+
+function quickmail_upgrade($oldversion=0) {
+
+    global $CFG;
+    
+    $result = true;
+    
+    if ($oldversion < 2005012800 && $result) {
+        execute_sql(" create table ".$CFG->prefix."block_quickmail_log
+                    ( id int(10) unsigned not null auto_increment,
+                      courseid int(10) unsigned not null,
+                      userid int(10) unsigned not null,
+                      mailto text not null,
+                      subject varchar(255) not null,
+                      message text not null,
+                      attachment varchar(255) not null,
+                      format tinyint(3) unsigned not null default 1,
+                      timesent int(10) unsigned not null,
+                      PRIMARY KEY  (`id`)
+                    )");
+    }
+
+    return $result;
+}
Index: blocks/quickmail/db/postgres7.sql
===================================================================
--- blocks/quickmail/db/postgres7.sql	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/db/postgres7.sql	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,14 @@
+# $Id: postgres7.sql,v 1.4 2006/05/19 19:47:47 mark-nielsen Exp $
+
+create table prefix_block_quickmail_log (
+    id serial,
+    courseid integer not null default 0,
+    userid integer not null default 0,
+    mailto text not null default '',
+    subject varchar(255) not null default '',
+    message text not null default '',
+    attachment varchar(255) not null default '',
+    format int4 not null default 1,
+    timesent integer not null default 0,
+    PRIMARY KEY (id)
+);
\ No newline at end of file
Index: blocks/quickmail/db/upgrade.php
===================================================================
--- blocks/quickmail/db/upgrade.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/db/upgrade.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,27 @@
+<?php  //$Id: upgrade.php,v 1.2 2007/03/02 03:06:54 mark-nielsen Exp $
+
+// This file keeps track of upgrades to this block
+//
+// Sometimes, changes between versions involve
+// alterations to database structures and other
+// major things that may break installations.
+//
+// The upgrade function in this file will attempt
+// to perform all the necessary actions to upgrade
+// your older installtion to the current version.
+//
+// If there's something it cannot do itself, it
+// will tell you what you need to do.
+//
+// The commands in here will all be database-neutral,
+// using the functions defined in lib/ddllib.php
+
+function xmldb_block_quickmail_upgrade($oldversion=0) {
+    $result = true;
+
+    // Nothing for now
+
+    return $result;
+}
+
+?>
\ No newline at end of file
Index: blocks/quickmail/styles.php
===================================================================
--- blocks/quickmail/styles.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/styles.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,37 @@
+/***
+*** General Table Styles
+***/
+
+.blocks-quickmail .generaltable .r0 {
+    background-color: #f0f0f0;
+}
+
+.blocks-quickmail .generaltable .r1 {
+    background-color: #fafafa;
+}
+
+/***
+*** Flexible Table Styles (emaillog.php)
+***/
+
+body#blocks-quickmail-emaillog table#emaillog .header {
+    text-align: left;
+}
+
+body#blocks-quickmail-emaillog table#emaillog .header .commands {
+    display: inline;
+}
+
+body#blocks-quickmail-emaillog table#emaillog td  {
+    border-left-width: 1px;
+    border-right-width: 1px;
+    border-left-style: solid;
+    border-right-style: solid;
+    vertical-align: bottom;
+    border-color: #DDDDDD;
+}
+
+body#blocks-quickmail-emaillog table#emaillog .header,
+body#blocks-quickmail-emaillog table#emaillog .cell {
+    padding: 4px;
+}
\ No newline at end of file
Index: blocks/quickmail/email.html
===================================================================
--- blocks/quickmail/email.html	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/email.html	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,98 @@
+<?php // $Id: email.html,v 1.13 2007/03/02 03:06:53 mark-nielsen Exp $
+/**
+ * email.html - Prints the email form for Quickmail
+ *
+ * @author Mark Nielsen
+ * @version $Id: email.html,v 1.13 2007/03/02 03:06:53 mark-nielsen Exp $
+ * @package quickmail
+ **/
+?>
+
+<form name="theform" method="post" action="email.php" enctype="multipart/form-data">
+<table border="0" cellpadding="5">
+<tr valign="top">
+    <td align="right"><strong><?php print_string('to', 'block_quickmail'); ?>:</strong></td>
+    <td>
+        <a href="javascript:void(0);" onclick="block_quickmail_toggle(true, 1, 0);"><?php print_string('selectall'); ?></a> / <a href="javascript:void(0);" onclick="block_quickmail_toggle(false, 1, 0);"><?php print_string('deselectall'); ?></a>
+        <br />
+        <br />
+        <?php print_table($table); ?>
+    </td>
+</tr>
+<tr valign="top">
+    <td align="right"><b><?php print_string('subject', 'forum'); ?>:</b></td>
+    <td>
+        <input type="text" name="subject" size="60" value="<?php p($form->subject); ?>" />
+    </td>
+</tr>
+<tr valign="top">
+    <td align="right"><b>
+     <?php print_string('message', 'forum'); ?>:
+     </b></td>
+    <td align="left" rowspan="2">
+    <?php print_textarea($usehtmleditor, 25, 65, 630, 400, 'message', $form->message); ?>
+    </td>
+</tr>
+<tr valign="top">
+    <td align="right" valign="center" nowrap="nowrap">
+        <font size="2">
+            <?php
+                helpbutton('reading', get_string('helpreading'), 'moodle', true, true);
+                echo '<br />';
+                helpbutton('writing', get_string('helpwriting'), 'moodle', true, true);
+                echo '<br />';
+                if ($usehtmleditor) {
+                   helpbutton('richtext', get_string('helprichtext'), 'moodle', true, true);
+                } else {
+                   emoticonhelpbutton('theform', 'message');
+                } 
+            ?>
+         </font>
+    </td>
+</tr>
+
+<tr valign="top">
+    <td align="right"><b><?php print_string('formattexttype'); ?>:</b></td>
+    <td>
+    <?php 
+        if ($usehtmleditor) {   /// Trying this out for a while
+            print_string('formathtml');
+            echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
+        } else {
+            choose_from_menu(format_text_menu(), 'format', $form->format, '');
+        }
+        helpbutton('textformat', get_string('helpformatting'));
+     ?>
+    </td>
+</tr>
+
+<tr valign="top">
+    <td align="right" nowrap="nowrap">
+        <b><?php print_string('attachmentoptional', 'block_quickmail'); ?>:</b>
+    </td>
+    <td>
+    <?php
+        if (has_capability('moodle/course:managefiles', $context)) {
+            echo '<input type="text" name="attachment" size="90" value="'.$form->attachment.'" alt="'.get_string('attachmentalt', 'block_quickmail').'" /><br />';
+            button_to_popup_window ("/files/index.php?id=$course->id&choose=theform.attachment", "coursefiles", $strchooseafile, 500, 750, $strchooseafile);
+        } else {
+            $maxbytes = get_max_upload_file_size($CFG->maxbytes, $course->maxbytes);
+            echo '<input type="hidden" name="MAX_FILE_SIZE" value="'.$maxbytes.'" />';
+            echo '<input type="file" name="attachment" size="45" alt="'.get_string('attachmentalt', 'block_quickmail').'" /> ';
+            print_string('maxsize', '', display_size($maxbytes));
+        }
+    ?>
+    </td>
+</tr>
+
+<tr>
+    <td align="center" colspan="2">
+    <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
+    <input type="hidden" name="id" value="<?php echo $course->id; ?>" />
+    <input type="hidden" name="instanceid" value="<?php echo $instanceid; ?>" />
+    <input type="submit" name="cancel" value="<?php print_string('cancel') ?>" />
+    <input type="submit" name="sendemail" value="<?php print_string('sendemail', 'block_quickmail') ?>" />
+    </td>
+</tr>
+</table>
+</form>
Index: blocks/quickmail/config_instance.html
===================================================================
--- blocks/quickmail/config_instance.html	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/config_instance.html	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,41 @@
+<?php // $Id: config_instance.html,v 1.6 2007/03/02 03:06:53 mark-nielsen Exp $
+/**
+ * config_instance.html - prints the configuration form for
+ *      the Quickmail instance settings.
+ *
+ * @author Mark Nielsen
+ * @version $Id: config_instance.html,v 1.6 2007/03/02 03:06:53 mark-nielsen Exp $
+ * @package quickmail
+ **/
+    
+    print_simple_box_start('center', '20%');
+?>
+<table cellpadding="5" cellspacing="0" align="center">
+<tr valign="top">
+    <td align="right">
+        <strong><?php print_string('groupmode'); ?>:</strong>
+    </td>
+    <td align="left">
+        <?php
+            $options = array();
+            $options[NOGROUPS]       = get_string('groupsnone');
+            $options[SEPARATEGROUPS] = get_string('groupsseparate');
+            $options[VISIBLEGROUPS]  = get_string('groupsvisible');
+            choose_from_menu($options, 'groupmode', $this->config->groupmode, '', '', 0, false, $this->course->groupmodeforce);
+            helpbutton('groupmode', get_string('groupmode'));
+
+            if ($this->course->groupmodeforce) {
+                // if On, then the dropdown is disabled and wont submit,
+                //  which means we loose Quickmails groupmode setting.
+                echo '<input type="hidden" name="groupmode" value="'.$this->config->groupmode.'" />';
+            }
+        ?>
+    </td>
+</tr> 
+<tr>
+    <td colspan="2" align="center">
+        <p><input type="submit" value="<?php print_string('savechanges') ?>" /></p>
+    </td>
+</tr>
+</table>
+<?php print_simple_box_end(); ?>
\ No newline at end of file
Index: blocks/quickmail/javascript.php
===================================================================
--- blocks/quickmail/javascript.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/javascript.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,22 @@
+/**
+ * JavaScript for checking or unchecking 
+ * all the students or all students in a group.
+ *
+ * @param toggle Check All/None
+ * @param start the first checkbox to be changed
+ * @param end the last checkbox to be changed
+ * return boolean
+ **/
+function block_quickmail_toggle(toggle, start, end) {
+    // Element ID
+    var id = 'mailto'+start;
+
+    // iterate through all of the appropriate checkboxes and change their state
+    while(document.getElementById(id) && start != end) {
+        document.getElementById(id).checked = toggle;
+        start++;
+        id = 'mailto'+start;
+    }
+
+    return false;
+}
\ No newline at end of file
Index: blocks/quickmail/email.php
===================================================================
--- blocks/quickmail/email.php	(.../vendor/moodle/1.9weekly)	(revision 0)
+++ blocks/quickmail/email.php	(.../branches/1.9.5-LAE1.0/Quickmail)	(revision 139)
@@ -0,0 +1,392 @@
+<?php // $Id: email.php,v 1.19 2007/08/30 18:41:26 mark-nielsen Exp $
+/**
+ * email.php - Used by Quickmail for sending emails to users enrolled in a specific course.
+ *      Calls email.hmtl at the end.
+ *
+ * @author Mark Nielsen
+ * @version $Id: email.php,v 1.19 2007/08/30 18:41:26 mark-nielsen Exp $
+ * @package quickmail
+ **/
+    
+    require_once('../../config.php');
+    require_once($CFG->libdir.'/blocklib.php');
+
+    $id         = required_param('id', PARAM_INT);  // course ID
+    $instanceid = optional_param('instanceid', 0, PARAM_INT);
+    $action     = optional_param('action', '', PARAM_ALPHA);
+
+    $instance = new stdClass;
+
+    if (!$course = get_record('course', 'id', $id)) {
+        error('Course ID was incorrect');
+    }
+
+    require_login($course->id);
+    $context = get_context_instance(CONTEXT_BLOCK, $instanceid);
+
+    if ($instanceid) {
+        $instance = get_record('block_instance', 'id', $instanceid);
+    } else {
+        if ($quickmailblock = get_record('block', 'name', 'quickmail')) {
+            $instance = get_record('block_instance', 'blockid', $quickmailblock->id, 'pageid', $course->id);
+        }
+    }
+
+/// This block of code ensures that Quickmail will run 
+///     whether it is in the course or not
+    if (empty($instance)) {
+        $groupmode = groupmode($course);
+        if (has_capability('block/quickmail:cansend', get_context_instance(CONTEXT_BLOCK, $instanceid))) {
+            $haspermission = true;
+        } else {
+            $haspermission = false;
+        }
+    } else {
+        // create a quickmail block instance
+        $quickmail = block_instance('quickmail', $instance);
+        
+        $groupmode     = $quickmail->groupmode();
+        $haspermission = $quickmail->check_permission();
+    }
+    
+    if (!$haspermission) {
+        error('Sorry, you do not have the correct permissions to use Quickmail.');
+    }
+
+    // TO DO: Revise quickmail to auto-install support for the block/quickmail:canrecv capability.
+    // This code is commmented out because Quickmail will not function out-of-the-box with 'canrecv' logic in place
+    // if (!$courseusers = get_users_by_capability($context, 'block/quickmail:canrecv', 'u.*', 'u.lastname, u.firstname', '', '', '', '', false)) {
+    if (!$courseusers = get_users_by_capability($context, 'moodle/course:view', 'u.*', 'u.lastname, u.firstname', '', '', '', '', false)) {
+        error('No course users found to email');
+    }
+
+    if ($action == 'view') {
+        // viewing an old email.  Hitting the db and puting it into the object $form
+        $emailid = required_param('emailid', PARAM_INT);
+        $form = get_record('block_quickmail_log', 'id', $emailid);
+        $form->mailto = explode(',', $form->mailto); // convert mailto back to an array
+
+    } else if ($form = data_submitted()) {   // data was submitted to be mailed
+        confirm_sesskey();
+
+        if (!empty($form->cancel)) {
+            // cancel button was hit...
+            redirect("$CFG->wwwroot/course/view.php?id=$course->id");
+        }
+        
+        // prepare variables for email
+        $form->subject = stripslashes($form->subject);
+        $form->subject = clean_param(strip_tags($form->subject, '<lang><span>'), PARAM_RAW); // Strip all tags except multilang
+        $form->message = clean_param($form->message, PARAM_CLEANHTML);
+
+        // make sure the user didn't miss anything
+        if (!isset($form->mailto)) {
+            $form->error = get_string('toerror', 'block_quickmail');
+        } else if (!$form->subject) {
+            $form->error = get_string('subjecterror', 'block_quickmail');
+        } else if (!$form->message) {
+            $form->error = get_string('messageerror', 'block_quickmail');
+        }
+
+        // process the attachment
+        $attachment = $attachname = '';
+        if (has_capability('moodle/course:managefiles', $context)) {
+            $form->attachment = trim($form->attachment);
+            if (isset($form->attachment) and !empty($form->attachment)) {
+                $form->attachment = clean_param($form->attachment, PARAM_PATH);
+            
+                if (file_exists($CFG->dataroot.'/'.$course->id.'/'.$form->attachment)) {
+                    $attachment = $course->id.'/'.$form->attachment;
+            
+                    $pathparts = pathinfo($form->attachment);
+                    $attachname = $pathparts['basename'];
+                } else {
+                    $form->error = get_string('attachmenterror', 'block_quickmail', $form->attachment);
+                }
+            }
+        } else {
+            require_once($CFG->libdir.'/uploadlib.php');
+        
+            $um = new upload_manager('attachment', false, true, $course, false, 0, true);
+
+            // process the student posted attachment if it exists
+            if ($um->process_file_uploads('temp/block_quickmail')) {
+                
+                // original name gets saved in the database
+                $form->attachment = $um->get_original_filename();
+
+                // check if file is there
+                if (file_exists($um->get_new_filepath())) {
+                    // get path to the file without $CFG->dataroot
+                    $attachment = 'temp/block_quickmail/'.$um->get_new_filename();
+                
+                    // get the new name (name may change due to filename collisions)
+                    $attachname = $um->get_new_filename();
+                } else {
+                    $form->error = get_string("attachmenterror", "block_quickmail", $form->attachment);
+                }
+            } else {
+                $form->attachment = ''; // no attachment
+            }
+        }
+           
+        // no errors, then email
+        if(!isset($form->error)) {
+            $mailedto = array(); // holds all the userid of successful emails
+            
+            // get the correct formating for the emails
+            $form->plaintxt = format_text_email($form->message, $form->format); // plain text
+            $form->html = format_text($form->message, $form->format);        // html
+
+            // run through each user id and send a copy of the email to him/her
+            // not sending 1 email with CC to all user ids because emails were required to be kept private
+            foreach ($form->mailto as $userid) { 
+
+                // Added by Damon 9/7/07 to fix problem with sending to large numbers of people
+                // 300 seconds is 5 minutes
+                set_time_limit(300);
+ 
+                if (!$courseusers[$userid]->emailstop) {
+                    $mailresult = email_to_user($courseusers[$userid], $USER, $form->subject, $form->plaintxt, $form->html, $attachment, $attachname);
+                    // checking for errors, if there is an error, store the name
+                    if (!$mailresult || (string) $mailresult == 'emailstop') {
+                        $form->error = get_string('emailfailerror', 'block_quickmail');
+                        $form->usersfail['emailfail'][] = $courseusers[$userid]->lastname.', '.$courseusers[$userid]->firstname;
+                    } else {
+                        // success
+                        $mailedto[] = $userid;
+                    }
+                } else {
+                    // blocked email
+                    $form->error = get_string('emailfailerror', 'block_quickmail');
+                    $form->usersfail['emailstop'][] = $courseusers[$userid]->lastname.', '.$courseusers[$userid]->firstname;
+                }
+            }
+            
+            // cleanup - delete the uploaded file
+            if (isset($um) and file_exists($um->get_new_filepath())) {
+                unlink($um->get_new_filepath());
+            }
+
+            // prepare an object for the insert_record function
+            $log = new stdClass;
+            $log->courseid   = $course->id;
+            $log->userid     = $USER->id;
+            $log->mailto     = implode(',', $mailedto);
+            $log->subject    = addslashes($form->subject);
+            $log->message    = addslashes($form->message);
+            $log->attachment = $form->attachment;
+            $log->format     = $form->format;
+            $log->timesent   = time();
+            if (!insert_record('block_quickmail_log', $log)) {
+                error('Email not logged.');
+            }
+
+            if(!isset($form->error)) {  // if no emailing errors, we are done
+                // inform of success and continue
+                redirect("$CFG->wwwroot/course/view.php?id=$course->id", get_string('successfulemail', 'block_quickmail'));
+            }
+        }
+        // so people can use quotes.  It will display correctly in the subject input text box
+        $form->subject = s($form->subject);
+
+    } else {
+        // set them as blank
+        $form->subject = $form->message = $form->format = $form->attachment = '';
+    }
+
+/// Create the table object for holding course users in the To section of email.html
+    
+    // table object used for printing the course users
+    $table              = new stdClass;
+    $table->cellpadding = '10px';    
+    $table->width       = '100%';
+
+    $t    = 1;    // keeps track of the number of users printed (used for javascript)
+    $cols = 4;    // number of columns in the table
+
+    if ($groupmode == NOGROUPS) { // no groups, basic view
+        $table->head  = array();
+        $table->align = array('left', 'left', 'left', 'left');
+        $cells        = array();
+
+        foreach($courseusers as $user) { 
+            if (isset($form->mailto) && in_array($user->id, $form->mailto)) {
+                $checked = 'checked="checked"';
+            } else {
+                $checked = '';
+            }       
+        
+            $cells[] = "<input type=\"checkbox\" $checked id=\"mailto$t\" value=\"$user->id\" name=\"mailto[]\" />".
+                        "<label for=\"mailto$t\">".fullname($user, true).'</label>';
+            $t++;
+        }
+        $table->data = array_chunk($cells, $cols);
+    } else {
+        $groups      = new stdClass;    // holds the groups to be displayed
+        $buttoncount = 1;               // counter for the buttons (used by javascript)
+        $ingroup     = array();         // keeps track of the users that belong to groups
+        
+        // determine the group mode
+        if (has_capability('moodle/site:accessallgroups', $context)) {
+            // teachers/admins default to the more liberal group mode
+            $groupmode = VISIBLEGROUPS;
+        }
+        
+        // set the groups variable
+        switch ($groupmode) {
+            case VISIBLEGROUPS:
+                $groups = groups_get_all_groups($course->id);
+		$groups = array_keys($groups); 
+                break;
+
+            case SEPARATEGROUPS:
+                $groups = groups_get_user_groups($course->id);
+		$groups = array_keys($groups);
+                break;
+        }
+
+        // Add a fake group for those who are not group members
+        $groups[] = 0;
+
+        $notingroup = array();
+        if ($allgroups = groups_get_all_groups($course->id)) {
+	    $allgroups = array_keys($allgroups);
+            foreach ($courseusers as $user) {
+                $nomembership = true;
+                foreach ($allgroups as $group) {
+                    if (groups_is_member($group, $user->id)) {
+                        $nomembership = false;
+                        break;
+                    }
+                }
+                if ($nomembership) {
+                    $notingroup[] = $user->id;
+                }
+            }
+        }
+
+        // set up the table
+        $table->head        = array(get_string('groups'), get_string('groupmembers'));
+        $table->align       = array('center', 'left');
+        $table->size        = array('100px', '*');
+        
+        foreach($groups as $group) {            
+            $start = $t;
+            $cells = array();  // table cells (each is a check box next to a user name)
+            foreach($courseusers as $user) { 
+                if (groups_is_member($group, $user->id) or                    // is a member of the group or
+                   ($group == 0 and in_array($user->id, $notingroup)) ) {     // this is our fake group and this user is not a member of another group
+                                                    
+                    if (isset($form->mailto) && in_array($user->id, $form->mailto)) {
+                        $checked = 'checked="checked"';
+                    } else {
+                        $checked = '';
+                    }
+        
+                    $cells[] = "<input type=\"checkbox\" $checked id=\"mailto$t\" value=\"$user->id\" name=\"mailto[$user->id]\" />".
+                                "<label for=\"mailto$t\">".fullname($user, true).'</label>';
+                    $t++;
+                }
+            }
+            $end = $t;
+            
+            // cell1 has the group picture, name and check button
+            $cell1 = '';
+            if ($group) {
+                $groupobj = groups_get_group($group);
+                $cell1   .= print_group_picture($groupobj, $course->id, false, true).'<br />';
+            }
+            if ($group) {
+                $cell1 .= groups_get_group_name($group);
+            } else {
+                $cell1 .= get_string('notingroup', 'block_quickmail');
+            }
+            if (count($groups) > 1 and !empty($cells)) {
+                $selectlinks = '<a href="javascript:void(0);" onclick="block_quickmail_toggle(true, '.$start.', '.$end.');">'.get_string('selectall').'</a> / 
+                                <a href="javascript:void(0);" onclick="block_quickmail_toggle(false, '.$start.', '.$end.');">'.get_string('deselectall').'</a>';
+            } else {
+                $selectlinks = '';
+            }
+            $buttoncount++;
+            
+            // cell2 has the checkboxes and the user names inside of a table
+            if (empty($cells) and !$group) {
+                // there is no one that is not in a group, so no need to print our 'nogroup' group
+                continue;
+            } else if (empty($cells)) {
+                // cells is empty, so there are no group members for that group
+                $cell2 = get_string('nogroupmembers', 'block_quickmail');
+            } else {
+                $cell2 = '<table cellpadding="5px">';
+                $rows = array_chunk($cells, $cols);
+                foreach ($rows as $row) {
+                    $cell2 .= '<tr><td nowrap="nowrap">'.implode('</td><td nowrap="nowrap">', $row).'</td></tr>';
+                }
+                $cell2 .= '</table>';
+            }
+            // add the 2 cells to the table
+            $table->data[] = array($cell1, $selectlinks.$cell2);
+        }
+    }
+
+    // get the default format       
+    if ($usehtmleditor = can_use_richtext_editor()) {
+        $defaultformat = FORMAT_HTML;
+    } else {
+        $defaultformat = FORMAT_MOODLE;
+    }
+    
+    // set up some strings
+    $readonly       = '';
+    $strchooseafile = get_string('chooseafile', 'resource');
+    $strquickmail   = get_string('blockname', 'block_quickmail');
+
+/// Header setup
+    if ($course->category) {
+        $navigation = "<a href=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</a> ->";
+    } else {
+        $navigation = '';
+    }
+
+    print_header($course->fullname.': '.$strquickmail, $course->fullname, "$navigation $strquickmail", '', '', true);
+
+    // print the email form START
+    print_heading($strquickmail);
+
+    // error printing
+    if (isset($form->error)) {
+        notify($form->error);
+        if (isset($form->usersfail)) {
+            $errorstring = '';
+
+            if (isset($form->usersfail['emailfail'])) {
+                $errorstring .= get_string('emailfail', 'block_quickmail').'<br />';
+                foreach($form->usersfail['emailfail'] as $user) {
+                    $errorstring .= $user.'<br />';
+                }               
+            }
+
+            if (isset($form->usersfail['emailstop'])) {
+                $errorstring .= get_string('emailstop', 'block_quickmail').'<br />';
+                foreach($form->usersfail['emailstop'] as $user) {
+                    $errorstring .= $user.'<br />';
+                }               
+            }
+            notice($errorstring, "$CFG->wwwroot/course/view.php?id=$course->id", $course);
+        }
+    }
+
+    $currenttab = 'compose';
+    include($CFG->dirroot.'/blocks/quickmail/tabs.php');
+
+    print_simple_box_start('center');
+    require($CFG->dirroot.'/blocks/quickmail/email.html');
+    print_simple_box_end();
+    
+    if ($usehtmleditor) {
+        use_html_editor('message');
+    }
+
+    print_footer($course);
+?>
