Commit Graph

57 Commits

Author SHA1 Message Date
Paolo d1fa93a2b6 DB_model bugfix:
- update method now is using _manageUDFs instead of directly UDFLib->manageUDFs
- _manageUDFs method now accept the id as third parameter
- if the third parameter of _manageUDFs is null the getUDFs is not
called
- If id parameter of method load is null now a correct parameter is given to
get_where
2017-08-23 10:47:12 +02:00
Paolo d8cd786079 - application/core/* -> CS compliant
- application/libraries/* -> CS compliant
- FHC_Model isEntitled method now return error() or success()
- Updated all code that uses isEntitled method from FHC_Model
- Removed Squiz.PHP.DisallowSizeFunctionsInLoops from CS ruleset
- Removed depracated method replace from DB_Model
- Removed unused method pgArrayPhp from DB_Model
- Renamed method arrayMergeIndex to _arrayCombine in DB_Model and set as private
- Added method _manageUDFs to DB_Model (a wrapper for UDFLib->manageUDFs)
2017-08-22 16:24:51 +02:00
Paolo b50aab2d33 - Moved all code related to UDF from DB_Model to UDFLib
- Changed method getUDFs in DB_Model
- Removed method getUDF
- Moved method _getUDFsDefinitions to UDF_model and renamed to getUDFsDefinitions
- Updated model UDF_model
- Updated controller system/UDF
- Updated DB_Model to be more CS compliant
2017-08-18 15:50:59 +02:00
Paolo 226eda73e5 - Added comments to DB_Model
- Method _manageUDFs using a temp variable to store result from _validateUDFs
2017-08-09 16:20:10 +02:00
Paolo 973b74ce7e $validate variable reset on every loop 2017-08-09 15:55:32 +02:00
Paolo 9ee1820ac3 - Not to check the required attribute for them all together, but only if the UDF is present in the given parameters.
Update of UDF should work in the same way as the update of regular columns.
- Required rules:
    - If required === false && value to be saved == (null || false) => validation avoided
    - If required == false && value to be saved != null => validation performed
    - If required == true => validation performed && value cannot be null
    - If required == true && value to be saved == (null || false) => raise error: required field
    - If raised error required field => validation is not performed
2017-08-09 15:21:19 +02:00
Paolo 68189bb7a5 - If required == false and a null value is given for a UDF, then no
validation is performed
- No validation is performed for checkboxes
- Better workaround in UDF_Model
2017-08-02 17:02:39 +02:00
Paolo 66de1e18f8 - Removed /core from URL
- If UDf are not set in DB UDF view will not display them
- Removed placeholder from multiple dropdown widget
- Dropdown widget has null value as placeholder
- Added permission system/udf to checksystem
2017-08-01 18:25:23 +02:00
Paolo 59045e1136 Added private method _fillMissingChkboxUDF to UDF_model.
It checks if UDF checkboxes are NOT posted and sets theirs values to
false
2017-07-28 18:36:08 +02:00
Paolo 994c4e1d36 If a UDF is of type checkbox, convert the string value to a boolean 2017-07-28 17:21:01 +02:00
Paolo 28be99c952 In case a table is updated and UDF are present in that table,
the method _manageUDFs will preserve the UDF values that
are NOT given as parameters.
Updates only the wanted UDF, without overwriting the others.
2017-07-28 17:00:42 +02:00
Paolo dab6515038 - Added widgets.css
- Better widgets HTML format
- Changed required attribute to udf-required
2017-07-21 15:02:04 +02:00
Paolo 3abfcbc429 - Better naming convention for variables
- Method toPhp has a more strict check about UDF
- Added constant UDF_FIELD_JSON_DESCRIPTION
- Added new code comments and improved the old ones
- Improved code formatting
- UDF validation now checks also the required fields
- UDF validation now checks also if the UDF value is an array or an
object and discard them
- Method _getUDFs renamed to _getUDFsDefinitions
2017-06-30 13:31:21 +02:00
Paolo d3a675bf52 Testing phase 2017-06-28 12:04:41 +02:00
Paolo be9fc8121e - Added exit codes for udf validation to constants.php
- Added messages for udf validation to fhc_model_lang
- Added MAX_LENGTH and MIN_LENGTH to UDFWidgetTpl in WidgetLib
- UDF validation second version in DB_Model
2017-06-23 18:54:34 +02:00
Stefan Puraner a7d3214dd6 fixed return value of method '_manageUDFs' 2017-06-22 11:32:56 +02:00
Paolo 950da84cf3 - Added constant EXIT_VALIDATION_UDF into constants.php
- Added message 'fhc_'.EXIT_VALIDATION_UDF into fhc_model_lang
- Added method _validateUDFs into DB_Model
- Renamed _manageUDF to _manageUDFs into DB_Model
- Renamed _getUDFParamters to _getUDFs into DB_Model
- Introduced first version of UDF validation
2017-06-21 11:05:20 +02:00
Paolo b73bf1dd32 - Added method listFields to DB_Model
- Added method fieldExists to DB_Model
2017-06-19 12:39:08 +02:00
Paolo 3ac8d7d604 - Added parameter decode to API /system/UDF/UDF to decode json
- UDF bugfix: now it checks if a table has the column udf_values before
performing an insert or update
2017-06-19 12:15:28 +02:00
Paolo e8d395f4f1 UDF update and insert bug fix 2017-06-14 16:18:43 +02:00
Paolo 86a1eb876e UDF update bug fix 2017-06-14 15:24:08 +02:00
Paolo 294c65a9bf Added controller UDF to read UDFs definitions
UDFs update&insert second version
2017-06-09 15:45:33 +02:00
Paolo 30c31211aa Added insert and update for UDFs, first version 2017-06-08 18:26:32 +02:00
Paolo e143aa8815 1st preview 2017-05-09 18:14:18 +02:00
Paolo a5aea17fa6 UDF fields are present in json output as other fields 2017-05-08 18:46:38 +02:00
Paolo a2d2296f33 - Added method addGroupBy to DB_Model
- Changed the query present in method getPrestudentMultiAssign of Prestudent_model
2017-04-05 16:58:23 +02:00
Paolo 4984b69366 - DB_Model: workaround for CI_DB_driver->_list_columns (if there are two
tables with the same name in two different schemas, it returns a list of
fields from the two tables)
- DB_Model: changed loadTree to use the new method _list_columns
- DB_Model: added the method getSchemaAndTable
- Updated Studiengang_model to specify the schema when using the
loadTree method
- Studiengang_model: removed the titel parameter from method getAppliedStudiengang
- Studiengang2 controller removed the titel parameter from method getAppliedStudiengang
2017-04-04 18:27:31 +02:00
Paolo 2c4595005b DB_Model->_isEntitled: now if the user is not entitled to perform an
operation the query is reset
2017-03-23 11:51:18 +01:00
Paolo 1615470a8f Third version of the VileSci interface that allows easily to add more prestudent
to a group or change their stufe
2017-03-21 18:29:25 +01:00
bison-paolo bf677f717e Added method addForm to DB_Model 2017-02-15 12:50:50 +01:00
bison-paolo 8d9a8b6478 Changed method loadTree of DB_Model to be compatible to older php versions than 5.5 2017-02-09 11:01:29 +01:00
bison-paolo 0a19cbfba4 - Changed the routes used to call the controllers, now accept also
capital names
- Now method getStudiengangBewerbung of controller Studiengang returns
also data relative to the table lehre.tbl_akadgrad
- Fixes and enhancements of method loadTree of DB_Model.
2016-11-25 15:09:19 +01:00
bison-paolo 5087826891 - phpC(d)I
- Renamed method chkRights to _isEntitled in model DB_Model
- Updated models where it was needed
2016-10-20 16:37:52 +02:00
bison-paolo f3b79cd731 - Added method chkRights to DB_Model
- Added method toPhp to DB_Model to convert array and boolean types from PostgresSQL to php
- Added method execQuery to DB_Model to execute a query (it calls toPhp)
- Added method pgsqlArrayToPhpArray to convert a pgsql array to php
- Updated DB_Model methods to using chkRights (and toPhp where it is needed)
- Removed methods escapeArray and _pgsqlArrayToPhpArray from controller APIv1_Controller
- Removed escapeArray from controllers Dokumentstudiengang and Dokument
- Updated models to use execQuery (and chkRights where it is needed)
2016-10-17 17:07:51 +02:00
bison-paolo 8e0ca12deb - All permission functionalities now are in the library PermissionLib
- All return messages functions are in the message helper and it is loaded by the core classes
- Added the missing constant FHC_NOPK
- Updated all the interested classes with the new permission method
- Updated all the interested classes with the new return message functions
2016-10-13 17:53:12 +02:00
bison 0b5644d6f1 - Added method getStudiengangBewerbung to controller Studiengang2
- Renamed method loadList to loadTree
- Improved method loadTree
- Added method getStudiengangBewerbung to model Studiengang_model
2016-09-06 15:52:34 +02:00
bison 7e71681d26 - Added method loadList to model DB_model
- Added method getStudienplan to model Studiengang_model
- Changes in method getStudiengangStudienplan of controller Studiengang2
2016-08-26 14:21:04 +02:00
paolo 2568d8f912 - Removed the parameter "sprache" from controller Message
- Added method escape to class DB_Model
- Changed method sendMessageVorlage of MessageLib to send messages trying
to use the same language of the receiver, and improved message errors
- Added OrganisationseinheitLib to handle a recursive search using in the
organisation tree
- Removed from PhrasesLib the method loadVorlagetext because is already
present in VorlageLib
- Changed method loadVorlagetext of VorlageLib, now it searches the template
using the organisation tree
- Added method getOneLevel to model Organisationseinheit_model to get one
level of the organisation tree
2016-07-15 13:38:09 +02:00
paolo 79230cd85d Added function getBerechtigungKurzbz to model FHC_Model.
Using this function will be avoided the notice "Undefined index".
All models have been adapted.
2016-07-07 16:42:04 +02:00
paolo 4902f41a3f Added addSelect to DB_Model 2016-07-01 12:17:08 +02:00
Paminger 74186cc5c6 Merge branch 'ci' of https://github.com/FH-Complete/FHC-Core into ci
Conflicts:
	application/core/DB_Model.php
2016-06-24 13:09:44 +02:00
Paminger 925d210bff Permission Problem workaround 2016-06-24 13:08:18 +02:00
paolo 58a6da42ae The method loadWhole has been removed from model DB_Model.
The same functionality has given by calling the load method without parameters
2016-06-24 10:39:52 +02:00
Paminger 4f14e7fa92 Messages Inbox Outbox 2016-06-23 10:28:26 +02:00
Paminger dbe19fafb5 Messages 2016-06-21 11:27:36 +02:00
Paminger eb712f4242 Merge branch 'ci' of https://github.com/FH-Complete/FHC-Core into ci
Conflicts:
	application/core/FHC_Model.php
2016-06-10 15:41:09 +02:00
paolo 70fba4d267 - Added property hasSequence to class DB_Model.
This property is used to indicate if the represented table has a primary
  key that uses a sequence (true, otherwise false. Default is true).
- Method insert of DB_Model now checks the property hasSequence.
  If it is true it uses the method insert_id() to return the primary key
  of the row just inserted.
  For any other values the method returns the primary key inserted coping
  it directly from the parameters.
- Set the property hasSequence to false in the constructor of model Prestudentstatus
2016-05-24 16:56:14 +02:00
paolo e76e1af15c - Remove parameters "new" after checked it in method postPrestudentstatus of controller Prestudentstatus
- Method insert of DB_Model doesn't use anymore insert_id() from CI because it forces to have a sequence
  and doesn't return the primary key when it's composed by more columns
2016-05-24 15:04:35 +02:00
paolo 6b1968ae5b Codesniffer compliant: if, for and while 2016-05-20 13:04:25 +02:00
paolo 63db2326ed - Added new permission to access to tbl_studiengang table using basis/studiengang
- Added method getStudiengang to class Studiengang2 to get a studiengang from pk
- Added method addDistinct to class DB_Model to add the distinct clause to a query
2016-05-12 10:05:29 +02:00