Changeset 395

Show
Ignore:
Timestamp:
04/14/08 10:20:01 (9 months ago)
Author:
aarkerio
Message:

Fixed test controller

Location:
trunk/app
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/config/sql/karamelo_postgres.sql

    r386 r395  
    318318    "created" timestamp(0) with time zone DEFAULT now() NOT NULL, 
    319319    "status" smallint DEFAULT 0 NOT NULL, 
    320     "user_id" integer NOT NULL REFERENCES users(id) ON DELETE CASCADE, 
    321     "ecourse_id" integer NOT NULL REFERENCES ecourses(id) ON DELETE CASCADE, 
    322     "secret" varchar(6),   -- secreto code to allow students register by themselves 
    323     "access" smallint NOT NULL DEFAULT 0 
     320    "user_id" int NOT NULL REFERENCES users(id) ON DELETE CASCADE, 
     321    "ecourse_id" int NOT NULL REFERENCES ecourses(id) ON DELETE CASCADE, 
     322    "secret" varchar(6),   -- secret code to allow students register by themselves 
     323    "access" smallint NOT NULL DEFAULT 0 -- public / only with code 
    324324); 
    325325 
     
    569569CREATE TABLE "tests_vclassrooms" ( 
    570570 "id" serial PRIMARY KEY, 
    571  "test_id" int NOT NULL REFERENCES tests(id), 
    572  "vclassroom_id" int NOT NULL REFERENCES vclassrooms(id), 
     571 "test_id" int NOT NULL REFERENCES tests(id) ON DELETE CASCADE, 
     572 "vclassroom_id" int NOT NULL REFERENCES vclassrooms(id) ON DELETE CASCADE, 
    573573  UNIQUE  ("test_id", "vclassroom_id") 
    574574); 
  • trunk/app/views/ecourses/admin_vclassrooms.ctp

    r365 r395  
    66echo $html->getCrumbs(' / ');  
    77 
    8 $str =  'Virtual clasrooms  on ' . $data['Ecourse']['title'] . ' e-Course'; 
     8$str =  'Classrooms  on ' . $data['Ecourse']['title']; 
    99 
    1010if ( isset( $historic ) ) 
  • trunk/app/views/elements/admin_menu.ctp

    r352 r395  
    88         $html->link('eCourses', '/admin/ecourses/listing') => array( 
    99                                                                 $html->link('Add eCourses', '/admin/ecourses/add'), 
    10                                                                          $html->link('Classrooms', '/admin/vclassrooms/listing') 
     10                                                                         $html->link('Classrooms', '/admin/vclassrooms/listing'), 
     11                                                                         $html->link('Forums', '/admin/catforums/listing') 
    1112                                                             ), 
    1213             $html->link('Webquests', '/admin/webquests/listing'), 
  • trunk/app/views/entries/admin_start.ctp

    r322 r395  
    4949     <?php echo $html->link($html->image('static/forums.png', array("title"=>"Forums", "alt"=>"Forums")), '/admin/catforums/listing', null, null, false); ?> 
    5050  </span> 
    51   <a href="/admin/caforums/listing" title="Phorums" class="main-item-caption">Forums</a> 
     51  <a href="/admin/catforums/listing" title="Phorums" class="main-item-caption">Forums</a> 
    5252</div> 
    5353 
  • trunk/app/views/forums/admin_add.ctp

    r393 r395  
    66echo $html->div('title_section', 'Add New Forum'); 
    77 
    8 if ( $vclassrooms == null) 
    9 { 
     8if ( $vclassrooms == null): 
    109    echo $html->para(null, $html->link('You need to have at last one classroom enabled to add new forums', '/admin/ecourses/listing')); 
    11 } 
    12 else 
    13 { 
     10else: 
     11 
    1412  echo $form->create('Forum'); 
    1513  echo $form->hidden('Forum.catforum_id', array('value'=>$catforum_id)); 
     
    1816   <legend><?php __('New Forum'); ?></legend> 
    1917<?php  
    20   echo $form->label('Forum.vclassroom_id',  'Class:'); 
     18  echo $form->label('Forum.vclassroom_id', 'Class:'); 
    2119  echo $form->select('Forum.vclassroom_id', $vclassrooms, null, null, false); 
    2220  echo $form->input('Forum.title', array("size" => 40, "maxlength" => 60));  
    2321  echo $form->error('Forum.title', 'A forum title is required.');  
     22  
     23  echo $html->div('required', $form->label('Forum.description','Description:').$form->textarea('Forum.description', array('rows'=>10,'cols'=>50))); 
     24 
     25echo $form->label('Forum.status', 'Activate forum:') . $form->checkbox('Forum.status', array("value"=>1));  
     26 
     27echo '</fieldset>'; 
     28 
     29echo $form->end('Save');  
     30 
     31endif; 
    2432?> 
    25   <p> 
    26     <?php  
    27         echo $form->label('Forum.description', 'Description:' ) . '<br />'; 
    28         echo $form->textarea('Forum.description', array("rows" => 10, "cols" => 50)); 
    29         echo $form->error('Forum.description', 'A phorum description is required.'); 
    30      ?> 
    31   </p> 
    32   <br /> 
    33      <?php echo $form->label('Forum.status', 'Activate forum:') . $form->checkbox('Forum.status', array("value"=>1)); ?><br /> 
    34   <p><br /></fieldset> 
    35   <?php echo $form->end('Save');  
    36 } 
    37 ?></p> 
  • trunk/app/views/vclassrooms/admin_listing.ctp

    r352 r395  
    33  echo $html->getCrumbs(' / ');  
    44  echo $html->div('title_section', 'Classrooms'); 
    5   echo $html->link($html->image('actions/new.png', array("alt"=>"Add classroom", "title"=>"Add classroom")), '/admin/vclassrooms/add', null, null, false);  
     5 
     6  echo $html->link($html->image('actions/new.png', array("alt"=>"Add classroom", "title"=>"Add classroom")), '/admin/ecourses/listing', null, null, false);  
    67?> 
    78