Changeset 342 for trunk/app/views/groups

Show
Ignore:
Timestamp:
03/25/08 01:03:27 (8 months ago)
Author:
aarkerio
Message:

eCourses fixes

Location:
trunk/app/views/groups
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/views/groups/admin_edit.ctp

    r264 r342  
    11<?php  
    2  //die( var_dump( $this->data ) );  
    3  if ($othAuth->group('id') != 1 && $this->data["User"]["id"] != $othAuth->user('id')) 
     2 //die( debug( $this->data ) );  
     3 if ( $cU['User']['group_id'] != 1 ) 
    44 { 
    5   exit('Error, you are not allowed to be here'); 
     5  $this->flash('Error, you are not allowed to be here'); 
    66 } 
    77 
    8  echo $html->formTag('/admin/groups/edit/','post', array("onsubmit"=>"return validateData()"));  
    9  echo $html->hiddenTag('Group/id');  
     8 echo $form->create('Group',array("onsubmit"=>"return validateData()"));  
     9 echo $form->hidden('Group.id');  
    1010?> 
    1111<fieldset> 
    1212  <legend><?php echo $this->data['Group']['name']; ?> group</legend> 
    13    
    14   <?php echo $form->labelTag('Group/code', 'Access Code:' );?><br />  
    15   <?php echo $html->input('Group/code', array("size"=>4, "maxlength"=>4)); ?> 
    16   <?php echo $html->tagErrorMsg('Group/code', 'Code is required.'); ?> 
    17   <br /> 
    18    
    19   <p><?php echo $html->submit('Save') ?></p> 
    20 </fieldset> 
    21 </form> 
    22 </div> 
     13    
     14  <?php  
     15    echo $form->input('Group.code', array("size"=>7, "maxlength"=>7));  
     16    echo $form->error('Group.code', 'Code is required.');  
     17     
     18    if ( $this->data['Group']['id'] == 4) 
     19    { 
     20        echo $form->label('Group.active', 'Enabled: ');  
     21       echo $form->checkbox('Group.active', array('value'=>2));  
     22    } 
     23  ?> 
     24  <br /></fieldset> 
     25  <?php echo $form->end('Save'); ?> 
    2326 
    2427<script type="text/javascript"> 
    2528function validateData() 
    26 {  
     29{ ᾉ 
    2730  var code  = document.getElementById("GroupCode"); 
    2831   
    29   if (code.value.length != 4) 
     32  if (code.value.length < 4) 
    3033  { 
    31     alert('The code must have four characters'); 
     34    alert('The code must have at least four characters'); 
    3235    code.focus(); 
    3336    return false; 
  • trunk/app/views/groups/admin_listing.ctp

    r264 r342  
    99<?php 
    1010//die(print_r($data)); 
    11 $th = array ('Edit', 'Title', 'Code'); 
     11$th = array ('Edit', 'Title', 'Code', 'Status'); 
    1212 
    1313echo $html->tableHeaders($th);  
     
    1515foreach ($data as $val)  
    1616{ 
     17  $st = ($val['Group']['active'] == 1) ? 'Enabled' : 'Disabled'; 
    1718  $tr = array ( 
    1819           $gags->sendEdit($val['Group']['id'], 'groups'), 
    1920             $val['Group']['name'], 
    20                  $val['Group']['code'] 
     21             $val['Group']['code'], 
     22             $st 
    2123         ); 
    2224