File:  [LON-CAPA] / loncom / interface / loncommunicate.pm
Revision 1.46: download - view: text, annotated - select for diffs
Sat Jul 25 23:16:04 2009 UTC (14 years, 9 months ago) by raeburn
Branches: MAIN
CVS tags: version_2_9_99_0, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, bz6209-base, bz6209, bz2851, PRINT_INCOMPLETE_base, PRINT_INCOMPLETE, HEAD, GCI_3, BZ4492-merge, BZ4492-feature_horizontal_radioresponse
- Term used for type of course used to facilitate collaborative activities,
  e.g., in a campus organization will be "Community".

    1: # The LearningOnline Network
    2: # Communicate
    3: #
    4: # $Id: loncommunicate.pm,v 1.46 2009/07/25 23:16:04 raeburn Exp $
    5: #
    6: # Copyright Michigan State University Board of Trustees
    7: #
    8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
    9: #
   10: # LON-CAPA is free software; you can redistribute it and/or modify
   11: # it under the terms of the GNU General Public License as published by
   12: # the Free Software Foundation; either version 2 of the License, or
   13: # (at your option) any later version.
   14: #
   15: # LON-CAPA is distributed in the hope that it will be useful,
   16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
   17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18: # GNU General Public License for more details.
   19: #
   20: # You should have received a copy of the GNU General Public License
   21: # along with LON-CAPA; if not, write to the Free Software
   22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   23: #
   24: # /home/httpd/html/adm/gpl.txt
   25: #
   26: # http://www.lon-capa.org/
   27: #
   28: ###
   29: 
   30: package Apache::loncommunicate;
   31: 
   32: use strict;
   33: use Apache::Constants qw(:common);
   34: use Apache::lonmsgdisplay();
   35: use Apache::loncommon;
   36: use Apache::lonlocal;
   37: use Apache::lonnet;
   38: 
   39: sub menu {
   40:     my $r=shift;
   41:     my $crstype = 'course';
   42:     my $usertype = 'student';
   43:     if (defined($env{'course.'.$env{'request.course.id'}.'.type'})) {
   44:         $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
   45:         if ($crstype eq 'Community') {
   46:             $usertype = 'member';
   47:         }   
   48:     }
   49: 	
   50: 
   51: # ------------------------------------------------------------------------ Menu
   52:     my ($can_srm,$can_dcm,$can_dff);
   53:     if ($env{'request.course.id'}) {
   54:         if ((&Apache::lonnet::allowed('srm',$env{'request.course.id'})) ||
   55:             (&Apache::lonnet::allowed('srm',$env{'request.course.id'}.'/'.
   56:                                            $env{'request.course.sec'}))) {
   57:             $can_srm = 1;
   58:         }
   59:         if ((&Apache::lonnet::allowed('dcm',$env{'request.course.id'})) ||
   60:             (&Apache::lonnet::allowed('dcm',$env{'request.course.id'}.'/'.
   61:                                            $env{'request.course.sec'}))) {
   62:             $can_dcm = 1;
   63:         }
   64:         if ((&Apache::lonnet::allowed('dff',$env{'request.course.id'})) ||
   65:             (&Apache::lonnet::allowed('dff',$env{'request.course.id'}.'/'.
   66:                                            $env{'request.course.sec'}))) {
   67:             $can_dff = 1;
   68:         }
   69:     }   
   70: 
   71: 	my @reports = (
   72: 	    {categorytitle => 'Send Messages',
   73:          items => [
   74:             {url => '/adm/email?compose=individual',
   75: 			 permission => 'F',
   76: 			 icon => 'mail-message-new.png',
   77:              linktext => 'New Message',
   78:              linktitle => 'Send a message to users.'},
   79:        
   80:             {url => '/adm/email?compose=group',
   81: 			 permission => "$can_srm",
   82:              icon => 'mail-reply-all.png',
   83:              linktext => 'New Broadcast Message',
   84: 			 help => 'Course_Broadcast_Message',
   85:              linktitle => "Send a broadcast message to members of this $crstype and/or other users."},
   86: 			 
   87: 			{url => '/adm/email?compose=upload',
   88: 			 permission => "$can_srm",
   89:              icon => 'fromfile.png',
   90:              linktext => 'New Messages from File',
   91: 			 linktitle => 'Create a message from file and send to users.'},
   92:          ]},
   93: 		);
   94: 		
   95: 		if ($can_dff || $can_dcm ){
   96: 		push(@reports,{categorytitle => 'Message Administration',
   97:          items => [
   98:             {url => '/adm/email?recordftf=query',
   99: 			 permission => "$can_dff",
  100:              icon => 'messalog.png',
  101:              linktext => 'Message Log for Selected Users',
  102: 			 help => 'Course_Face_To_Face_Records,Course_Critical_Message',
  103:              linktitle => "User notes, records of face-to-face discussions, critical messages, broadcast messages and archived messages in $crstype."},
  104:                     
  105:             {url => '/adm/email?block=display',
  106: 			 permission => "$can_dcm",
  107:              icon => 'comblock.png',
  108: 			 linktext => 'Communication Blocking',
  109:              linktitle => "Blocking of $usertype communication during exams."},
  110:          ]});
  111:         }
  112: $r->print(&Apache::lonhtmlcommon::generate_menu(@reports));
  113: 
  114: }
  115: 
  116: sub handler {
  117:     my $r = shift;
  118:     &Apache::loncommon::content_type($r,'text/html');
  119:     $r->send_http_header;
  120:     return OK if $r->header_only;
  121: #
  122: # Start document
  123: #
  124: 
  125: # ----------------------------------------------------------------- Breadcrumbs
  126:     &Apache::lonhtmlcommon::clear_breadcrumbs();
  127:     &Apache::lonhtmlcommon::add_breadcrumb
  128:         ({href=>"/adm/communicate",
  129:           text=>"Communication/Messages",
  130:           faq=>12,bug=>'Communication Tools',});
  131: 
  132: # ---------------------------------------------------------------------- Header
  133:     &Apache::lonmsgdisplay::header($r);
  134:     &menu($r);
  135:     &Apache::lonmsgdisplay::disall($r);
  136:     $r->print(&Apache::loncommon::end_page());
  137:     return OK;
  138: }
  139: 
  140: 1;
  141: __END__

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>