// swad_degree_type.c: degree types /* SWAD (Shared Workspace At a Distance), is a web platform developed at the University of Granada (Spain), and used to support university teaching. This file is part of SWAD core. Copyright (C) 1999-2019 Antonio Caņas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ /*****************************************************************************/ /********************************* Headers ***********************************/ /*****************************************************************************/ #include // For isprint, isspace, etc. #include // For NULL #include // For boolean type #include // For fprintf, etc. #include // For exit, system, calloc, free, etc. #include // For string functions #include // To access MySQL databases #include "swad_box.h" #include "swad_config.h" #include "swad_database.h" #include "swad_degree.h" #include "swad_degree_type.h" #include "swad_form.h" #include "swad_global.h" #include "swad_HTML.h" #include "swad_parameter.h" /*****************************************************************************/ /************** External global variables from others modules ****************/ /*****************************************************************************/ extern struct Globals Gbl; /*****************************************************************************/ /**************************** Public constants *******************************/ /*****************************************************************************/ /*****************************************************************************/ /****************************** Private types ********************************/ /*****************************************************************************/ /*****************************************************************************/ /**************************** Private variables ******************************/ /*****************************************************************************/ static struct DegreeType *DT_EditingDegTyp = NULL; // Static variable to keep the degree type being edited /*****************************************************************************/ /*************************** Private prototypes ******************************/ /*****************************************************************************/ static void DT_SeeDegreeTypes (Act_Action_t NextAction,Hie_Level_t Scope, DT_Order_t DefaultOrder); static DT_Order_t DT_GetParamDegTypOrder (DT_Order_t DefaultOrder); static void DT_ListDegreeTypes (Act_Action_t NextAction,DT_Order_t SelectedOrder); static void DT_EditDegreeTypesInternal (void); static void DT_PutIconsEditingDegreeTypes (void); static void DT_ListDegreeTypesForSeeing (void); static void DT_PutIconsListingDegTypes (void); static void DT_PutIconToEditDegTypes (void); static void DT_ListDegreeTypesForEdition (void); static void DT_PutFormToCreateDegreeType (void); static void DT_PutHeadDegreeTypesForSeeing (Act_Action_t NextAction,DT_Order_t SelectedOrder); static void DT_PutHeadDegreeTypesForEdition (void); static void DT_CreateDegreeType (struct DegreeType *DegTyp); static void DT_PutParamOtherDegTypCod (long DegTypCod); static unsigned DT_CountNumDegsOfType (long DegTypCod); static void DT_RemoveDegreeTypeCompletely (long DegTypCod); static bool DT_CheckIfDegreeTypeNameExists (const char *DegTypName,long DegTypCod); static void DT_EditingDegreeTypeConstructor (void); static void DT_EditingDegreeTypeDestructor (void); /*****************************************************************************/ /************** Show selector of degree types for statistics *****************/ /*****************************************************************************/ void DT_WriteSelectorDegreeTypes (void) { extern const char *Txt_Any_type_of_degree; unsigned NumDegTyp; /***** Form to select degree types *****/ /* Get list of degree types */ DT_GetListDegreeTypes (Hie_SYS,DT_ORDER_BY_DEGREE_TYPE); /* List degree types */ fprintf (Gbl.F.Out,"