Permalink
Browse files

- Exported entries are now linked instead of copied to the main gloss…

…ary.

- Short tags are gone.
- Little changes in ES language.
  • Loading branch information...
willcast
willcast committed Sep 29, 2003
1 parent e75547e commit ad58adac109d37179ed223c926d4e740b7ad17a8
View
@@ -34,6 +34,7 @@
$string['explainspecial'] = "<b>Special</b> will show all concepts that do not begin with a letter.<br>";
$string['explainalphabet'] = "Select the letter you want to look for.<p>";
$string['explainall'] = "<b>ALL</b> will show all entries in one page.";
+$string['exportedentry'] = "Exported entry";
$string['exporttomainglossary'] = "Export to main glossary";
$string['glossarytype'] = "Glossary Type";
$string['mainglossary'] = "Main glossary";
@@ -45,13 +46,14 @@
$string['noentry'] = "No entry found.";
$string['searchconcept'] = "Search:";
$string['searchindefinition'] = "Search in concept AND definitions?";
-$string['secundaryglossary'] = "Secondary glossary";
+$string['secondaryglossary'] = "Secondary glossary";
$string['showspecial'] = "Show 'Special' link";
$string['showalphabet'] = "Show alphabet";
$string['showall'] = "Show 'ALL' link";
$string['special'] = "Special";
$string['standardview'] = "Standard View";
$string['studentcanpost'] = "Students can add entries";
+$string['warningstudentcapost'] = "(This apply only if the glossary is not the main one)";
$string['writtenby'] = "By";
?>
@@ -2,4 +2,4 @@
<P>The system allows to export entries from any secondary glossary to the main one of the course.
<p>In order to do this, you should specify which glossary is the main one.
-<p>Note: You can have only one main glossary per course.
+<p>Note: You can have only one main glossary per course and its entries could be updated or deleted by teachers only.
@@ -1,4 +1,5 @@
<P ALIGN=CENTER><B>Students can post entries</B></P>
-<P>You can specify whether a user can or cannot add, edit or delete his/her own entries in this glossary.
-<p><b>Note:</b> A teacher can edit or delete any entry at any time.
+<P>You can specify whether a user can or cannot add, edit or delete his/her own entries.
+Entries exported to a main glossary can be updated or deleted by teachers only.
+<p><b>Note:</b> A teacher can edit or delete any entry at any time. This variable is not used if the glossary is the main one.
View
@@ -1,58 +1,58 @@
<?PHP // $Id$
// glossary.php - created with Moodle 1.1 (2003082800)
-
-
$string['addentry'] = "Agregar entrada";
-$string['allcategories'] = "Todas las categorías";
$string['allentries'] = "TODAS";
+$string['allcategories'] = "Todas las categorías";
$string['allowduplicatedentries'] = "Permitir entradas duplicadas";
-$string['alphabet'] = "A|B|C|CH|D|E|F|G|H|I|J|K|L|LL|M|N|Ñ|O|P|Q|R|S|T|U|V|W|X|Y|Z";
-$string['areyousuredelete'] = "¿Está seguro que desea borrar esta entrada?";
+$string['alphabet'] = "A|B|C|D|E|F|G|H|I|J|K|L|M|N|Ñ|O|P|Q|R|S|T|U|V|W|X|Y|Z";
+$string['areyousuredelete'] = "¿Está seguro que desea borrarla?";
$string['attachment'] = "Adjunto";
-$string['back'] = "Atrás";
+$string['back'] = "Volver";
$string['categories'] = "Categorías";
+$string['categoryview'] = "Vista por Categoría";
$string['category'] = "Categoría";
-$string['categorydeleted'] = "Categoría borrada";
-$string['categoryview'] = "Por categoría";
+$string['categorydeleted'] = "Categoría eliminada";
$string['concept'] = "Concepto";
$string['concepts'] = "Conceptos";
$string['definition'] = "Definición";
$string['definitions'] = "Definiciones";
$string['deleteentry'] = "Borrar entrada";
-$string['deletingnoneemptycategory'] = "Borrar una categoría no borrará las entradas. Si desea borrar las entradas tendrá que hacerlo manualmente.";
-$string['displayformat'] = "¿Formato de muestra?";
-$string['displayformat1'] = "Completo con autor.";
-$string['displayformat2'] = "Completo sin autor.";
+$string['deletingnoneemptycategory'] = "Si una categoría es eliminada por consiguiente su relación con las entradas también lo será. Si desea eliminar las entradas, tendrá que hacerlo manualmente.";
+$string['displayformat'] = "Formato de muestra de entradas";
$string['displayformatdefault'] = "Simple, estilo diccionario";
-$string['editcategories'] = "Editar categorías";
+$string['displayformat1'] = "Completo sin autor.";
+$string['displayformat2'] = "Completo con autor.";
$string['editentry'] = "Editar entrada";
+$string['editcategories'] = "Editar categorías";
$string['entries'] = "Entradas";
-$string['entrieswithoutcategory'] = "Entradas sin categorías";
+$string['entrieswithoutcategory'] = "Entradas sin categoría";
$string['entry'] = "Entrada";
$string['entryalreadyexist'] = "Esta entrada ya existe.";
$string['entrydeleted'] = "Entrada borrada.";
$string['entryexported'] = "Entrada exportada con éxito.";
-$string['explainall'] = "<b>Todas</b> mostrará todas las entradas en una página.";
-$string['explainalphabet'] = "Seleccione la letra inicial que usted desea buscar.<p> ";
-$string['explainspecial'] = "<b>Especial</b> mostrará todos los conceptos que no comienzan con una letra.<br>";
-$string['exporttomainglossary'] = "Exportar todo el glosario";
+$string['explainspecial'] = "<b>Especial</b> mostrará todos los conceptos que comiencen con símbolos.<br>";
+$string['explainalphabet'] = "Seleccione la letra que desea buscar.<p>";
+$string['explainall'] = "<b>TODAS</b> mostrará todas las entradas en una página.";
+$string['exporttomainglossary'] = "Exportar al glosario principal";
+$string['exportedentry'] = "Entrada exportada";
$string['glossarytype'] = "Tipo de glosario";
$string['mainglossary'] = "Glosario principal";
$string['modulename'] = "Glosario";
$string['modulenameplural'] = "Glosarios";
$string['newglossaryentries'] = "Nuevas entradas en el glosario:";
$string['nocategorized'] = "Sin categoría";
-$string['noentries'] = "No se encontraron entradas en esta sección";
+$string['noentries'] = "No se encontraro entradas en esta sección";
$string['noentry'] = "No se econtró ninguna entrada.";
$string['searchconcept'] = "Buscar:";
-$string['searchindefinition'] = "¿Buscar en conceptos Y definiciones?";
-$string['secundaryglossary'] = "Glosario secundario";
-$string['showall'] = "Mostrar el enlace 'Todas'";
-$string['showalphabet'] = "Mostrar el alfabeto";
-$string['showspecial'] = "Mostrar el enlace 'Especial'";
+$string['searchindefinition'] = "¿Buscar en conceptos y definiciones?";
+$string['secondaryglossary'] = "Glosario secundario";
+$string['showspecial'] = "Mostrar enlace 'Especial'";
+$string['showalphabet'] = "Mostrar alfabeto";
+$string['showall'] = "Mostrar enlace 'TODAS'";
$string['special'] = "Especial";
-$string['standardview'] = "Visualización estándar";
+$string['standardview'] = "Vista Normal";
$string['studentcanpost'] = "Los estudiantes pueden agregar entradas";
+$string['warningstudentcapost'] = "(Esto sólo aplica si el glosario no es principal)";
$string['writtenby'] = "Por";
?>
@@ -1,4 +1,5 @@
-<P ALIGN=CENTER><B>Es este el glosario principal del curso?</B></P>
-
-<P>El sistema permite exportar definiciones de los glosarios secundarios al glosario principal del sistema.
-<p>Para hacer esto, usted debe especificar cual de los glosarios es el principal. Note que sólo puede tener un glosario principal por curso.
+<P ALIGN=CENTER><B>Es este el glosario principal del curso?</B></P>
+
+<P>El sistema permite exportar definiciones de los glosarios secundarios al glosario principal del sistema.
+<p>Para hacer esto, usted debe especificar cual de los glosarios es el principal.
+<p>Note que sólo puede tener un glosario principal por curso y sus entradas sólo podrán ser editadas o borradas por un profesor.
@@ -1,5 +1,7 @@
-<P ALIGN=CENTER><B>Los estudiantes podrán agregar definiciones?</B></P>
-
-<P>Indique si desea que los estudiantes puedan o no agregar definiciones al glosario.
-
-<p>Si seleccionan que en efecto pueden hacerlo, el sistema le permitirá, además, modificar y eliminar sus propias definiciones.
+<P ALIGN=CENTER><B>Los estudiantes podrán agregar definiciones?</B></P>
+
+<P>Puede especificar si los estudiantes pueden o no agregar, modificar y eliminar sus propias definiciones al glosario.
+Las entradas exportadas a un glosario principal, sólo podrán ser editadas o borradas por un profesor.
+<p>Un profesor puede modificar o borrar cualquier entrada.
+<p>Esta variable no tiene efecto si el glosario es principal.
+
@@ -28,7 +28,7 @@ function glossary_backup_mods($bf,$preferences) {
$status = true;
//Iterate over glossary table
- $glossaries = get_records ("glossary","course",$preferences->backup_course,"id");
+ $glossaries = get_records ("glossary","course",$preferences->backup_course,"mainglossary");
if ($glossaries) {
foreach ($glossaries as $glossary) {
//Start mod
@@ -80,7 +80,7 @@ function backup_glossary_categories ($bf,$preferences,$glossary, $userinfo) {
fwrite ($bf,full_tag("GLOSSARYID",6,false,$glo_cat->glossaryid));
fwrite ($bf,full_tag("NAME",6,false,$glo_cat->name));
- $entries = get_records("glossary_entries_categories","categoryid",$glo_cat->id,"entryid");
+ $entries = get_records("glossary_entries_categories","categoryid",$glo_cat->id,"mainglossary");
if ($entries) {
$status =fwrite ($bf,start_tag("ENTRIES",6,true));
foreach ($entries as $entry) {
@@ -129,6 +129,7 @@ function backup_glossary_entries ($bf,$preferences,$glossary, $userinfo) {
fwrite ($bf,full_tag("DEFINITION",6,false,$glo_ent->definition));
fwrite ($bf,full_tag("FORMAT",6,false,$glo_ent->format));
fwrite ($bf,full_tag("ATTACHMENT",6,false,$glo_ent->attachment));
+ fwrite ($bf,full_tag("SOURCEGLOSSARYID",6,false,$glo_ent->sourceglossaryid));
fwrite ($bf,full_tag("TIMECREATED",6,false,$glo_ent->timecreated));
fwrite ($bf,full_tag("TIMEMODIFIED",6,false,$glo_ent->timemodified));
fwrite ($bf,full_tag("TEACHERENTRY",6,false,$glo_ent->teacherentry));
@@ -59,6 +59,12 @@ function glossary_upgrade($oldversion) {
execute_sql("ALTER TABLE `{$CFG->prefix}glossary_entries_categories` DROP PRIMARY KEY ");
execute_sql("ALTER TABLE `{$CFG->prefix}glossary_entries_categories` ADD `id` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST");
}
+
+ if ( $oldversion < 2003092400 ) {
+ execute_sql( "ALTER TABLE `{$CFG->prefix}glossary_entries` " .
+ "ADD `sourceglossaryid` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `attachment` " );
+
+ }
return true;
}
@@ -39,6 +39,7 @@ CREATE TABLE prefix_glossary_entries (
timecreated int(10) unsigned NOT NULL default '0',
timemodified int(10) unsigned NOT NULL default '0',
teacherentry tinyint(2) unsigned NOT NULL default '0',
+ sourceglossaryid int(10) unsigned NOT NULL '0',
PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='all glossary entries';
@@ -61,7 +61,8 @@ CREATE TABLE prefix_glossary_entries (
attachment varchar2(100) default '' not null,
timecreated number(10) default '0' not null,
timemodified number(10) default '0' not null,
- teacherentry number(2) default '0' not null
+ teacherentry number(2) default '0' not null,
+ sourceglossaryid number(10) default '0' not null
);
COMMENT on table prefix_glossary_entries is 'all glossary entries';
@@ -155,9 +156,15 @@ rem
INSERT INTO prefix_log_display VALUES ('glossary', 'add', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'update', 'glossary', 'name');
+INSERT INTO prefix_log_display VALUES ('glossary', 'delete', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'view', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'view all', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'add entry', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'update entry', 'glossary', 'name');
+INSERT INTO prefix_log_display VALUES ('glossary', 'delete entry', 'glossary', 'name');
+
+INSERT INTO prefix_log_display VALUES ('glossary', 'add category', 'glossary', 'name');
+INSERT INTO prefix_log_display VALUES ('glossary', 'update category', 'glossary', 'name');
+INSERT INTO prefix_log_display VALUES ('glossary', 'delete category', 'glossary', 'name');
@@ -39,6 +39,7 @@ CREATE TABLE prefix_glossary_entries (
timecreated int4 NOT NULL default '0',
timemodified int4 NOT NULL default '0',
teacherentry int2 NOT NULL default '0',
+ sourceglossaryid int4 NOT NULL default '0',
PRIMARY KEY(id)
);
@@ -6,7 +6,7 @@
require_variable($id); // course module ID
require_variable($mode); // edit or delete
optional_variable($go); // commit the operation?
- optional_variable($entry); // edit or delete
+ optional_variable($entry); // entry id
$strglossary = get_string("modulename", "glossary");
$strglossaries = get_string("modulenameplural", "glossary");
@@ -47,48 +47,58 @@
/// If data submitted, then process and store.
if ($mode == "edit" or $mode == "delete" ) {
- echo "<p>";
- if ( isteacher($cm->id) or $glossary->studentcanpost ) {
- if ($go) { // the operation was confirmed.
- if ( $mode == "delete") {
- glossary_delete_old_attachments($entry);
- delete_records("glossary_entries","id", $entry);
- print_simple_box_start("center","40%", "#FFBBBB");
- echo "<center>$entrydeleted"; //CAMBIAR
- echo "</center>";
- print_simple_box_end();
- }
- print_footer($course);
- add_to_log($course->id, "glossary", "delete entry", "view.php?id=$cm->id&currentview=$currentview&cat=$cat", $entry);
- redirect("view.php?id=$cm->id&currentview=$currentview&cat=$cat");
- } else { // the operation has not been confirmed yet so ask the user to do so
- if ( $mode == "delete") {
- print_simple_box_start("center","40%", "#FFBBBB");
- echo "<center><b>$entryfields->concept</b><br>$strareyousuredelete";
-
- ?>
- <form name="form" method="post" action="deleteentry.php">
-
- <input type="hidden" name=id value="<?php p($cm->id) ?>">
- <input type="hidden" name=mode value="delete">
- <input type="hidden" name=go value="1">
- <input type="hidden" name=entry value="<?php p($entry) ?>">
- <input type="hidden" name=currentview value=<? p($currentview) ?>>
- <input type="hidden" name=cat=<? p($cat) ?>>
-
- <input type="submit" value=" <?php print_string("yes")?> ">
- <input type=button value=" <?php print_string("no")?> " onclick="javascript:history.go(-1);">
-
- </form>
- </center>
- <?
- print_simple_box_end();
- }
- }
- } else {
- error("You are not allowed to edit or delete entries");
- }
- } else {
+ echo "<p>";
+ if ( isteacher($cm->id) or $glossary->studentcanpost ) {
+ if ($go) { // the operation was confirmed.
+ if ( $mode == "delete") {
+ // if it is an imported entry, just delete the relation
+ $entry = get_record("glossary_entries","id", $entry);
+ if ( $entry->sourceglossaryid ) {
+ $entry->glossaryid = $entry->sourceglossaryid;
+ $entry->sourceglossaryid = 0;
+ if (! update_record("glossary_entries", $entry)) {
+ error("Could not update your glossary");
+ }
+ } else {
+ glossary_delete_old_attachments($entry->id);
+ delete_records("glossary_entries","id", $entry->id);
+ }
+
+ print_simple_box_start("center","40%", "#FFBBBB");
+ echo "<center>$entrydeleted"; //CAMBIAR
+ echo "</center>";
+ print_simple_box_end();
+ }
+ print_footer($course);
+ add_to_log($course->id, "glossary", "delete entry", "view.php?id=$cm->id&currentview=$currentview&cat=$cat", $entry);
+ redirect("view.php?id=$cm->id&currentview=$currentview&cat=$cat");
+ } else { // the operation has not been confirmed yet so ask the user to do so
+ if ( $mode == "delete") {
+ print_simple_box_start("center","40%", "#FFBBBB");
+ echo "<center><b>$entryfields->concept</b><br>$strareyousuredelete";
+
+ ?>
+ <form name="form" method="post" action="deleteentry.php">
+
+ <input type="hidden" name=id value="<?php p($cm->id) ?>">
+ <input type="hidden" name=mode value="delete">
+ <input type="hidden" name=go value="1">
+ <input type="hidden" name=entry value="<?php p($entry) ?>">
+ <input type="hidden" name=currentview value=<?php p($currentview) ?>>
+ <input type="hidden" name=cat=<?php p($cat) ?>>
+
+ <input type="submit" value=" <?php print_string("yes")?> ">
+ <input type=button value=" <?php print_string("no")?> " onclick="javascript:history.go(-1);">
+
+ </form>
+ </center>
+ <?php
+ print_simple_box_end();
+ }
+ }
+ } else {
+ error("You are not allowed to edit or delete entries");
+ }
}
print_footer($course);
?>
Oops, something went wrong.

0 comments on commit ad58ada

Please sign in to comment.