diff --git a/mod/data/add.php b/mod/data/add.php index 83aeff9a28f..49aa7094029 100755 --- a/mod/data/add.php +++ b/mod/data/add.php @@ -117,7 +117,11 @@ //set flag to unapproved after each edit $record = get_record('data_records','id',$rid); - $record->approved = 0; + if (isteacher($course->id)) { + $record->approved = 1; + } else { + $record->approved = 0; + } update_record('data_records',$record); foreach ($datarecord as $name=>$value){ diff --git a/mod/data/lang/en/data.php b/mod/data/lang/en/data.php index f8d0bf05498..02842192e6c 100755 --- a/mod/data/lang/en/data.php +++ b/mod/data/lang/en/data.php @@ -4,10 +4,10 @@ $string['add'] = 'Add entry'; $string['addafield'] = 'Add a Field'; $string['addtemplate'] = 'Add Template'; $string['ascending'] = 'Ascending'; -$string['atmaxentry'] = 'you are at the maximum number of entries!'; -$string['autogenallforms'] = 'Generate All Default Templates'; +$string['atmaxentry'] = 'You have entered the maximum number of entries allowed!'; +$string['autogenallforms'] = 'Generate all default templates'; $string['availablefromdate'] = 'Available from'; -$string['availabletags'] = 'Available Tags'; +$string['availabletags'] = 'Available tags'; $string['availabletodate'] = 'Available to'; $string['browse'] = 'Browse'; $string['cancel'] = 'Cancel'; @@ -23,16 +23,16 @@ $string['menu'] = 'Menu (Single-selection)'; $string['menuchoose'] = 'Choose...'; $string['emptyadd'] = 'The Add template is empty, generating a default form...'; $string['emptyaddform'] = 'You did not fill out any fields!'; -$string['entrysaved'] = 'Entry Saved'; -$string['example'] = 'Database Module Example'; -$string['fieldadded'] = 'Field Added'; -$string['fielddeleted'] = 'Field Deleted'; -$string['fieldname'] = 'Field Name'; +$string['entrysaved'] = 'Your entry has been saved'; +$string['example'] = 'Database module example'; +$string['fieldadded'] = 'Field added'; +$string['fielddeleted'] = 'Field deleted'; +$string['fieldname'] = 'Field name'; $string['fields'] = 'Fields'; -$string['fieldupdated'] = 'Field Updated'; +$string['fieldupdated'] = 'Field updated'; $string['file'] = 'File'; $string['footer'] = 'Footer'; -$string['generatedefault'] = 'Generate Default Template'; +$string['generatedefault'] = 'Generate default template'; $string['header'] = 'Header'; $string['headeraddtemplate'] = 'Defines the interface when adding new entries'; $string['headerlisttemplate'] = 'Defines browsing interface for multiple entries'; @@ -46,9 +46,9 @@ $string['listtemplate'] = 'List Template'; $string['maxentries'] = 'Maximum entries'; $string['modulename'] = 'Database'; $string['modulenameplural'] = 'Databases'; -$string['multientry'] = 'Repeated Entry'; +$string['multientry'] = 'Repeated entry'; $string['multimenu'] = 'Menu (Multiple-selection)'; -$string['multipletags'] = 'multiple tags found! template not saved'; +$string['multipletags'] = 'Multiple tags found! Template not saved'; $string['namecheckbox'] = 'Checkbox Field'; $string['namemenu'] = 'Menu Field'; $string['namemultimenu'] = 'Multiple-selection Menu Field'; @@ -58,7 +58,7 @@ $string['nameurl'] = 'URL Field'; $string['nametext'] = 'Text Field'; $string['nametextarea'] = 'Textarea Field'; $string['namepicture'] = 'Picture Field'; -$string['newentry'] = 'New Entry:'; +$string['newentry'] = 'New entry'; $string['newfield'] = 'Create a new field'; $string['nofieldindatabase'] = 'There are no fields defined for this database, please add some'; $string['nolisttemplate'] = 'List template is not yet defined'; @@ -69,25 +69,25 @@ $string['numrecords'] = 'Records'; $string['noaccess'] = 'You do not have access to this page'; $string['nomatch'] = 'No matching entries found!'; $string['norecords'] = 'No entries in database'; -$string['optionaldescription'] = 'Short Description (Optional)'; -$string['optionalfilename'] = 'File Name (Optional)'; -$string['pagesize'] = 'Number of Entries Per Page'; +$string['optionaldescription'] = 'Short description (optional)'; +$string['optionalfilename'] = 'Filename (optional)'; +$string['pagesize'] = 'Entries per page'; $string['participants'] = 'Participants'; $string['picture'] = 'Picture'; -$string['radiobutton'] = 'Radio Button(s)'; +$string['radiobutton'] = 'Radio Buttons'; $string['recorddeleted'] = 'Record Deleted'; $string['requireapproval'] = 'Require Approval?'; $string['requiredentries'] = 'Required entries'; $string['requiredentriestoview'] = 'Entries required before viewing'; $string['rsstemplate'] = 'RSS Template'; $string['save'] = 'Save'; -$string['savetemplate'] = 'Save Template'; +$string['savetemplate'] = 'Save template'; $string['singletemplate'] = 'Single Template'; $string['teachersandstudents'] = '$a->teachers and $a->students'; $string['templates'] = 'Templates'; $string['text'] = 'Text'; $string['textarea'] = 'Textarea'; -$string['type'] = 'Field Type'; +$string['type'] = 'Field type'; $string['updatefield'] = 'Update an existing field'; $string['url'] = 'Url'; $string['viewfromdate'] = 'Viewable from'; diff --git a/mod/data/lib.php b/mod/data/lib.php index e9605434f50..12a65512606 100755 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -29,7 +29,6 @@ define ('PARTICIPANTS_TS', 3); define ('DATAMAXENTRIES', 50); define ('PERPAGE_SINGLE', 1); - class data_field_base { //base class (text field) var $type = 'text'; /// Base class implements "text" field type completely. @@ -258,7 +257,7 @@ function data_generate_default_form($dataid, $mode){ } if ($mode!='addtemplate' and $mode!='rsstemplate'){ //if not adding, we put tags in there - $str .= '