Merge branch '1.10.x' of github.com:chamilo/chamilo-lms into 1.10.x

1.10.x
Yannick Warnier 11 years ago
commit 4d23299c5f
  1. 619
      composer.lock
  2. 2
      main/admin/class_list.php
  3. 2
      main/admin/configure_homepage.php
  4. 2
      main/admin/configure_inscription.php
  5. 2
      main/admin/course_request_accepted.php
  6. 2
      main/admin/course_request_rejected.php
  7. 2
      main/admin/course_request_review.php
  8. 2
      main/admin/group_list.php
  9. 2
      main/admin/special_exports.php
  10. 2
      main/admin/specific_fields.php
  11. 4
      main/admin/user_fields.php
  12. 2
      main/attendance/attendance_sheet.php
  13. 8
      main/calendar/agenda_js.php
  14. 2
      main/coursecopy/import_backup.php
  15. 2
      main/exercice/exercise_show.php
  16. 2
      main/exercice/feedback.php
  17. 236
      main/exercice/multiple_answer.class.php
  18. 2
      main/exercice/question.class.php
  19. 113
      main/exercice/unique_answer.class.php
  20. 2
      main/forum/forumfunction.inc.php
  21. 18
      main/forum/forumsearch.php
  22. 2
      main/gradebook/lib/fe/catform.class.php
  23. 2
      main/gradebook/lib/fe/dataform.class.php
  24. 4
      main/gradebook/lib/fe/evalform.class.php
  25. 2
      main/gradebook/lib/fe/linkform.class.php
  26. 2
      main/gradebook/lib/fe/userform.class.php
  27. 3
      main/group/group_creation.php
  28. 2
      main/inc/introductionSection.inc.php
  29. 32
      main/inc/lib/AnnouncementManager.php
  30. 1815
      main/inc/lib/add_course.lib.inc.php
  31. 9
      main/inc/lib/agenda.lib.php
  32. 8
      main/inc/lib/api.lib.php
  33. 28
      main/inc/lib/course.lib.php
  34. 7
      main/inc/lib/formvalidator/FormValidator.class.php
  35. 12
      main/inc/lib/message.lib.php
  36. 31
      main/inc/lib/pear/HTML/QuickForm/Renderer/Default.php
  37. 26
      main/inc/lib/pear/HTML/QuickForm/advmultiselect.php
  38. 2
      main/inc/lib/statistics.lib.php
  39. 104
      main/inc/lib/usermanager.lib.php
  40. 5
      main/install/configuration.dist.php
  41. 1245
      main/install/course.sql
  42. 2
      main/install/install.lib.php
  43. 2
      main/install/install_db.inc.php
  44. 4
      main/install/main.sql
  45. 6
      main/install/migrate-db-1.9.0-1.10.0-pre.sql
  46. 2
      main/install/update-db-1.8.8-1.9.0.inc.php
  47. 4
      main/newscorm/lp_view.php
  48. 32
      main/social/search.php
  49. 72
      main/survey/survey.lib.php
  50. 60
      main/survey/survey_invite.php
  51. 8
      main/survey/survey_question.php
  52. 2
      main/template/default/layout/main.tpl
  53. 2
      main/template/default/layout/show_footer.tpl
  54. 22
      main/template/default/social/search.tpl
  55. 2
      main/tracking/courseLog.php
  56. 2
      main/tracking/course_log_resources.php
  57. 2
      main/upload/upload_word.php
  58. 2
      main/user/subscribe_user.php
  59. 4
      plugin/before_login/index.php
  60. 2
      plugin/ticket/src/myticket.php

619
composer.lock generated

@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "0f2dd6e4c3c50061a455ff5b91160b38",
"hash": "9412d5125c2c1b803ab2ae7a9e587a4b",
"packages": [
{
"name": "aferrandini/phpqrcode",
@ -164,243 +164,6 @@
"homepage": "http://elfinder.org",
"time": "2015-02-11 11:10:51"
},
{
"name": "behat/behat",
"version": "v2.4.6",
"source": {
"type": "git",
"url": "https://github.com/Behat/Behat.git",
"reference": "f1d2964667cf4b21bb6c2c1564f26829a6954155"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Behat/Behat/zipball/f1d2964667cf4b21bb6c2c1564f26829a6954155",
"reference": "f1d2964667cf4b21bb6c2c1564f26829a6954155",
"shasum": ""
},
"require": {
"behat/gherkin": "~2.2.9",
"php": ">=5.3.1",
"symfony/config": "~2.0",
"symfony/console": "~2.0",
"symfony/dependency-injection": "~2.0",
"symfony/event-dispatcher": "~2.0",
"symfony/finder": "~2.0",
"symfony/translation": "~2.0",
"symfony/yaml": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "~3.7.19"
},
"suggest": {
"behat/mink-extension": "for integration with Mink testing framework",
"behat/symfony2-extension": "for integration with Symfony2 web framework",
"behat/yii-extension": "for integration with Yii web framework"
},
"bin": [
"bin/behat"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "2.4-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\Behat": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"description": "Scenario-oriented BDD framework for PHP 5.3",
"homepage": "http://behat.org/",
"keywords": [
"BDD",
"Behat",
"Symfony2"
],
"time": "2013-06-06 10:46:48"
},
{
"name": "behat/gherkin",
"version": "v2.2.9",
"source": {
"type": "git",
"url": "https://github.com/Behat/Gherkin.git",
"reference": "cca2c477921ca38578d6e9759ea5e450f29c2d8f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Behat/Gherkin/zipball/cca2c477921ca38578d6e9759ea5e450f29c2d8f",
"reference": "cca2c477921ca38578d6e9759ea5e450f29c2d8f",
"shasum": ""
},
"require": {
"php": ">=5.3.1",
"symfony/finder": ">=2.0,<2.4-dev"
},
"require-dev": {
"symfony/config": ">=2.0,<2.4-dev",
"symfony/translation": ">=2.0,<2.4-dev",
"symfony/yaml": ">=2.0,<2.4-dev"
},
"suggest": {
"symfony/config": "If you want to use Config component to manage resources",
"symfony/translation": "If you want to use Symfony2 translations adapter",
"symfony/yaml": "If you want to parse features, represented in YAML files"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "2.2-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\Gherkin": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"description": "Gherkin DSL parser for PHP 5.3",
"homepage": "http://behat.org/",
"keywords": [
"BDD",
"Behat",
"DSL",
"Symfony2",
"parser"
],
"time": "2013-03-02 10:38:40"
},
{
"name": "behat/mink",
"version": "v1.5.0",
"source": {
"type": "git",
"url": "https://github.com/minkphp/Mink.git",
"reference": "0769e6d9726c140a54dbf827a438c0f9912749fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/minkphp/Mink/zipball/0769e6d9726c140a54dbf827a438c0f9912749fe",
"reference": "0769e6d9726c140a54dbf827a438c0f9912749fe",
"shasum": ""
},
"require": {
"php": ">=5.3.1",
"symfony/css-selector": "~2.0"
},
"suggest": {
"behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)",
"behat/mink-goutte-driver": "fast headless driver for any app without JS emulation",
"behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)",
"behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "1.5.x-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\Mink": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"description": "Web acceptance testing framework for PHP 5.3",
"homepage": "http://mink.behat.org/",
"keywords": [
"browser",
"testing",
"web"
],
"time": "2013-04-13 23:39:27"
},
{
"name": "behat/mink-extension",
"version": "v1.1.4",
"source": {
"type": "git",
"url": "https://github.com/Behat/MinkExtension.git",
"reference": "b4522f19fe96d423883f2e3650615e19d3a48c05"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Behat/MinkExtension/zipball/b4522f19fe96d423883f2e3650615e19d3a48c05",
"reference": "b4522f19fe96d423883f2e3650615e19d3a48c05",
"shasum": ""
},
"require": {
"behat/behat": "~2.4.5",
"behat/mink": ">=1.4.3,<1.6-dev",
"php": ">=5.3.2"
},
"require-dev": {
"behat/mink-goutte-driver": "~1.0"
},
"type": "behat-extension",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\MinkExtension": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"description": "Mink extension for Behat",
"homepage": "http://mink.behat.org",
"keywords": [
"browser",
"gui",
"test",
"web"
],
"time": "2013-06-04 12:18:22"
},
{
"name": "behat/transliterator",
"version": "v1.0.1",
@ -852,16 +615,16 @@
},
{
"name": "cocur/slugify",
"version": "v1.0",
"version": "v1.1",
"source": {
"type": "git",
"url": "https://github.com/cocur/slugify.git",
"reference": "2c929c56997e663747be9bb635e58db918a0134f"
"reference": "2b67d4e2b75dbaed2ebefa9eb5683e8940513847"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/cocur/slugify/zipball/2c929c56997e663747be9bb635e58db918a0134f",
"reference": "2c929c56997e663747be9bb635e58db918a0134f",
"url": "https://api.github.com/repos/cocur/slugify/zipball/2b67d4e2b75dbaed2ebefa9eb5683e8940513847",
"reference": "2b67d4e2b75dbaed2ebefa9eb5683e8940513847",
"shasum": ""
},
"require": {
@ -870,7 +633,9 @@
"require-dev": {
"codeclimate/php-test-reporter": "dev-master",
"laravel/framework": "~4.1",
"latte/latte": "~2.2",
"mockery/mockery": "~0.9",
"nette/di": "~2.2",
"phpunit/phpunit": "~3.7",
"sami/sami": "~1.3",
"satooshi/php-coveralls": "0.6.*",
@ -908,7 +673,7 @@
"slug",
"slugify"
],
"time": "2014-11-26 22:45:14"
"time": "2015-03-18 08:21:30"
},
{
"name": "doctrine/annotations",
@ -3254,80 +3019,26 @@
"time": "2015-03-13 17:37:22"
},
{
"name": "symfony/css-selector",
"name": "symfony/debug",
"version": "v2.6.5",
"target-dir": "Symfony/Component/CssSelector",
"target-dir": "Symfony/Component/Debug",
"source": {
"type": "git",
"url": "https://github.com/symfony/CssSelector.git",
"reference": "86cf0aa16065ffc4545374e9479dd7878bf1d90f"
"url": "https://github.com/symfony/Debug.git",
"reference": "5c1570dea188ade0c6c5e874c2f0a6570587aa1c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/CssSelector/zipball/86cf0aa16065ffc4545374e9479dd7878bf1d90f",
"reference": "86cf0aa16065ffc4545374e9479dd7878bf1d90f",
"url": "https://api.github.com/repos/symfony/Debug/zipball/5c1570dea188ade0c6c5e874c2f0a6570587aa1c",
"reference": "5c1570dea188ade0c6c5e874c2f0a6570587aa1c",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=5.3.3",
"psr/log": "~1.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\CssSelector\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Jean-François Simon",
"email": "jeanfrancois.simon@sensiolabs.com"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Symfony CssSelector Component",
"homepage": "http://symfony.com",
"time": "2015-02-24 11:52:21"
},
{
"name": "symfony/debug",
"version": "v2.6.5",
"target-dir": "Symfony/Component/Debug",
"source": {
"type": "git",
"url": "https://github.com/symfony/Debug.git",
"reference": "5c1570dea188ade0c6c5e874c2f0a6570587aa1c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Debug/zipball/5c1570dea188ade0c6c5e874c2f0a6570587aa1c",
"reference": "5c1570dea188ade0c6c5e874c2f0a6570587aa1c",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"psr/log": "~1.0"
},
"conflict": {
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
"conflict": {
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
},
"require-dev": {
"symfony/class-loader": "~2.2",
@ -5333,7 +5044,299 @@
"time": "2014-09-16 22:58:11"
}
],
"packages-dev": [],
"packages-dev": [
{
"name": "behat/behat",
"version": "v2.4.6",
"source": {
"type": "git",
"url": "https://github.com/Behat/Behat.git",
"reference": "f1d2964667cf4b21bb6c2c1564f26829a6954155"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Behat/Behat/zipball/f1d2964667cf4b21bb6c2c1564f26829a6954155",
"reference": "f1d2964667cf4b21bb6c2c1564f26829a6954155",
"shasum": ""
},
"require": {
"behat/gherkin": "~2.2.9",
"php": ">=5.3.1",
"symfony/config": "~2.0",
"symfony/console": "~2.0",
"symfony/dependency-injection": "~2.0",
"symfony/event-dispatcher": "~2.0",
"symfony/finder": "~2.0",
"symfony/translation": "~2.0",
"symfony/yaml": "~2.0"
},
"require-dev": {
"phpunit/phpunit": "~3.7.19"
},
"suggest": {
"behat/mink-extension": "for integration with Mink testing framework",
"behat/symfony2-extension": "for integration with Symfony2 web framework",
"behat/yii-extension": "for integration with Yii web framework"
},
"bin": [
"bin/behat"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "2.4-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\Behat": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"description": "Scenario-oriented BDD framework for PHP 5.3",
"homepage": "http://behat.org/",
"keywords": [
"BDD",
"Behat",
"Symfony2"
],
"time": "2013-06-06 10:46:48"
},
{
"name": "behat/gherkin",
"version": "v2.2.9",
"source": {
"type": "git",
"url": "https://github.com/Behat/Gherkin.git",
"reference": "cca2c477921ca38578d6e9759ea5e450f29c2d8f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Behat/Gherkin/zipball/cca2c477921ca38578d6e9759ea5e450f29c2d8f",
"reference": "cca2c477921ca38578d6e9759ea5e450f29c2d8f",
"shasum": ""
},
"require": {
"php": ">=5.3.1",
"symfony/finder": ">=2.0,<2.4-dev"
},
"require-dev": {
"symfony/config": ">=2.0,<2.4-dev",
"symfony/translation": ">=2.0,<2.4-dev",
"symfony/yaml": ">=2.0,<2.4-dev"
},
"suggest": {
"symfony/config": "If you want to use Config component to manage resources",
"symfony/translation": "If you want to use Symfony2 translations adapter",
"symfony/yaml": "If you want to parse features, represented in YAML files"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "2.2-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\Gherkin": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"description": "Gherkin DSL parser for PHP 5.3",
"homepage": "http://behat.org/",
"keywords": [
"BDD",
"Behat",
"DSL",
"Symfony2",
"parser"
],
"time": "2013-03-02 10:38:40"
},
{
"name": "behat/mink",
"version": "v1.5.0",
"source": {
"type": "git",
"url": "https://github.com/minkphp/Mink.git",
"reference": "0769e6d9726c140a54dbf827a438c0f9912749fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/minkphp/Mink/zipball/0769e6d9726c140a54dbf827a438c0f9912749fe",
"reference": "0769e6d9726c140a54dbf827a438c0f9912749fe",
"shasum": ""
},
"require": {
"php": ">=5.3.1",
"symfony/css-selector": "~2.0"
},
"suggest": {
"behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)",
"behat/mink-goutte-driver": "fast headless driver for any app without JS emulation",
"behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)",
"behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-develop": "1.5.x-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\Mink": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"description": "Web acceptance testing framework for PHP 5.3",
"homepage": "http://mink.behat.org/",
"keywords": [
"browser",
"testing",
"web"
],
"time": "2013-04-13 23:39:27"
},
{
"name": "behat/mink-extension",
"version": "v1.1.4",
"source": {
"type": "git",
"url": "https://github.com/Behat/MinkExtension.git",
"reference": "b4522f19fe96d423883f2e3650615e19d3a48c05"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Behat/MinkExtension/zipball/b4522f19fe96d423883f2e3650615e19d3a48c05",
"reference": "b4522f19fe96d423883f2e3650615e19d3a48c05",
"shasum": ""
},
"require": {
"behat/behat": "~2.4.5",
"behat/mink": ">=1.4.3,<1.6-dev",
"php": ">=5.3.2"
},
"require-dev": {
"behat/mink-goutte-driver": "~1.0"
},
"type": "behat-extension",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-0": {
"Behat\\MinkExtension": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"description": "Mink extension for Behat",
"homepage": "http://mink.behat.org",
"keywords": [
"browser",
"gui",
"test",
"web"
],
"time": "2013-06-04 12:18:22"
},
{
"name": "symfony/css-selector",
"version": "v2.6.5",
"target-dir": "Symfony/Component/CssSelector",
"source": {
"type": "git",
"url": "https://github.com/symfony/CssSelector.git",
"reference": "86cf0aa16065ffc4545374e9479dd7878bf1d90f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/CssSelector/zipball/86cf0aa16065ffc4545374e9479dd7878bf1d90f",
"reference": "86cf0aa16065ffc4545374e9479dd7878bf1d90f",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.6-dev"
}
},
"autoload": {
"psr-0": {
"Symfony\\Component\\CssSelector\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Jean-François Simon",
"email": "jeanfrancois.simon@sensiolabs.com"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Symfony CssSelector Component",
"homepage": "http://symfony.com",
"time": "2015-02-24 11:52:21"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {

@ -102,7 +102,7 @@ if (isset($_GET['action'])) {
// Create a search-box
$form = new FormValidator('search_simple', 'get', '', '', null, false);
$renderer =& $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$form->addElement('text', 'keyword', get_lang('keyword'));
$form->addElement('button', 'submit', get_lang('Search'));
$content .= $form->return_form();

@ -923,7 +923,7 @@ switch ($action) {
$renderer =& $form->defaultRenderer();
$renderer->setHeaderTemplate('');
$renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>');
$renderer->setElementTemplate('<tr><td>{element}</td></tr>');
$renderer->setCustomElementTemplate('<tr><td>{element}</td></tr>');
$renderer->setRequiredNoteTemplate('');
$form->addElement('hidden', 'formSent', '1');

@ -353,7 +353,7 @@ switch ($action){
$renderer =& $form->defaultRenderer();
$renderer->setHeaderTemplate('');
$renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>');
$renderer->setElementTemplate('<tr><td>{element}</td></tr>');
$renderer->setCustomElementTemplate('<tr><td>{element}</td></tr>');
$renderer->setRequiredNoteTemplate('');
$form->addElement('hidden', 'formSent', '1');
$default[$name] = str_replace('{rel_path}', api_get_path(REL_PATH), $open);

@ -146,7 +146,7 @@ if (!$course_validation_feature) {
// Create a simple search-box.
$form = new FormValidator('search_simple', 'get', '', '', 'width=200px', false);
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$form->addElement('text', 'keyword', get_lang('keyword'));
$form->addButtonSearch(get_lang('Search'));

@ -179,7 +179,7 @@ if (!$course_validation_feature) {
// Create a simple search-box.
$form = new FormValidator('search_simple', 'get', '', '', 'width=200px', false);
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$form->addElement('text', 'keyword', get_lang('keyword'));
$form->addButtonSearch(get_lang('Search'));

@ -227,7 +227,7 @@ if (!$course_validation_feature) {
// Create a simple search-box.
$form = new FormValidator('search_simple', 'get', '', '', 'width=200px', false);
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$form->addElement('text', 'keyword', get_lang('keyword'));
$form->addButtonSearch(get_lang('Search'));

@ -377,7 +377,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
// Create a search-box
$form = new FormValidator('search_simple', 'get', '', '', null, false);
$renderer = & $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$form->addElement('text', 'keyword', get_lang('keyword'));
$form->addButtonSearch(get_lang('Search'));
echo '<div class="actions" style="width:100%;">';

@ -151,7 +151,7 @@ Display::display_footer();
function form_special_export() {
$form = new FormValidator('special_exports','post');
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<div>{element}</div> ');
$renderer->setCustomElementTemplate('<div>{element}</div> ');
$form->addElement('radio', 'backup_option', '', get_lang('SpecialCreateFullBackup'), 'full_backup');
$form->addElement('radio', 'backup_option', '', get_lang('SpecialLetMeSelectItems'), 'select_items');
$form->addElement('html','<br />');

@ -27,7 +27,7 @@ include_once $libpath.'specific_fields_manager.lib.php';
// Create an add-field box
$form = new FormValidator('add_field','post','','',null,false);
$renderer =& $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$form->addElement('static','search_advanced_link',null,'<a href="specific_fields_add.php">'.Display::return_icon('fieldadd.gif').get_lang('AddSpecificSearchField').'</a>');
// Create a sortable table with specific fields data

@ -127,7 +127,7 @@ if(1)
// Create an add-field box
$form = new FormValidator('add_field','post','','',null,false);
$renderer =& $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
//$form->addElement('text','label',get_lang('FieldLabel'));
//$form->addElement('text','type',get_lang('FieldType'));
//$form->addElement('text','title',get_lang('FieldTitle'));
@ -384,4 +384,4 @@ function delete_user_fields($field_id)
// the field was not deleted so we return false
return false;
}
}
}

@ -96,7 +96,7 @@ if (api_is_allowed_to_edit(null, true) ||
}
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('{label} {element} ');
$renderer->setCustomElementTemplate('{label} {element} ');
$form->setDefaults(
array(

@ -201,7 +201,13 @@ if (!empty($userId)) {
$tpl->assign('web_agenda_ajax_url', $agenda_ajax_url);
$course_code = api_get_course_id();
$form = new FormValidator('form', 'get', null, null, array('id' => 'add_event_form'));
$form = new FormValidator(
'form',
'get',
null,
null,
array('id' => 'add_event_form')
);
$form->addElement('html', '<div id="visible_to_input">');
$sendTo = $agenda->parseAgendaFilter($userId);

@ -161,7 +161,7 @@ if (Security::check_token('post') && (
);
$form->addElement('header', get_lang('SelectBackupFile'));
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<div>{element}</div> ');
$renderer->setCustomElementTemplate('<div>{element}</div> ');
$form->addElement('hidden', 'action', 'restore_backup');

@ -542,7 +542,7 @@ foreach ($questionList as $questionId) {
$feedback_form->addElement('html','<br>');
$renderer =& $feedback_form->defaultRenderer();
$renderer->setFormTemplate('<form{attributes}><div align="left">{content}</div></form>');
$renderer->setElementTemplate('<div align="left">{element}</div>');
$renderer->setCustomElementTemplate('<div align="left">{element}</div>');
$comnt = Event::get_comments($id, $questionId);
$default = array('comments_'.$questionId => $comnt);

@ -52,7 +52,7 @@ Display::display_header($nameTools,"Exercise");
$form = new FormValidator('feedbackform','post',api_get_self()."?".api_get_cidreq()."&modifyQuestion=".$modifyQuestion."&newQuestion=".$newQuestion);
$obj_registration_form = new HTML_QuickForm('frmRegistration', 'POST');
$renderer =& $obj_registration_form->defaultRenderer();
$renderer->setElementTemplate(
$renderer->setCustomElementTemplate(
'<tr>
<td align="left" style="" valign="top" width=30%>{label}
<!-- BEGIN required --><span style="color: #ff0000">*</span><!-- END required -->

@ -26,126 +26,144 @@ class MultipleAnswer extends Question
}
/**
* function which redifines Question::createAnswersForm
* @param the formvalidator instance
* @param the answers number to display
*/
function createAnswersForm ($form)
* function which redifines Question::createAnswersForm
* @param the formvalidator instance
* @param the answers number to display
*/
function createAnswersForm($form)
{
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4; // The previous default value was 2. See task #1759.
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
$obj_ex = $_SESSION['objExercise'];
$html='<table class="data_table">
<tr>
<th width="10px">
'.get_lang('Number').'
</th>
<th width="10px">
'.get_lang('True').'
</th>
<th width="50%">
'.get_lang('Answer').'
</th>';
// show column comment when feedback is enable
$html .='<th>
'.get_lang('Comment').'
</th>';
$html .= '<th width="50px">
'.get_lang('Weighting').'
</th>
</tr>';
$form -> addElement ('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
$defaults = array();
$correct = 0;
$editorConfig = array(
'ToolbarSet' => 'TestProposedAnswer',
'Width' => '100%',
'Height' => '125'
);
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4; // The previous default value was 2. See task #1759.
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
$obj_ex = $_SESSION['objExercise'];
$form->addHeader(get_lang('Answers'));
$html = '<table class="table table-striped table-hover">
<thead>
<tr>
<th width="10">' . get_lang('Number') . '</th>
<th width="10">' . get_lang('True') . '</th>
<th width="50%">' . get_lang('Answer') . '</th>
<th width="50%">' . get_lang('Comment') . '</th>
<th width="10">' . get_lang('Weighting') . '</th>
</tr>
</thead>
<tbody>';
$form->addHtml($html);
$defaults = array();
$correct = 0;
$answer = false;
if(!empty($this -> id)) {
$answer = new Answer($this -> id);
$answer -> read();
if(count($answer->nbrAnswers)>0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers;
}
}
$form -> addElement('hidden', 'nb_answers');
$boxes_names = array();
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
for ($i = 1 ; $i <= $nb_answers ; ++$i) {
if(is_object($answer)) {
$defaults['answer['.$i.']'] = $answer -> answer[$i];
$defaults['comment['.$i.']'] = $answer -> comment[$i];
$defaults['weighting['.$i.']'] = float_format($answer -> weighting[$i], 1);
$defaults['correct['.$i.']'] = $answer -> correct[$i];
} else {
$defaults['answer[1]'] = get_lang('DefaultMultipleAnswer2');
$defaults['comment[1]'] = get_lang('DefaultMultipleComment2');
$defaults['correct[1]'] = true;
$defaults['weighting[1]'] = 10;
$defaults['answer[2]'] = get_lang('DefaultMultipleAnswer1');
$defaults['comment[2]'] = get_lang('DefaultMultipleComment1');
$defaults['correct[2]'] = false;
$defaults['weighting[2]'] = -5;
}
$renderer = & $form->defaultRenderer();
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
$answer_number=$form->addElement('text', 'counter['.$i.']', null, 'value="'.$i.'"');
$answer_number->freeze();
if (!empty($this->id)) {
$answer = new Answer($this->id);
$answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers;
}
}
$form->addElement('checkbox', 'correct['.$i.']', null, null, 'class="checkbox" style="margin-left: 0em;"');
$boxes_names[] = 'correct['.$i.']';
$form->addElement('hidden', 'nb_answers');
$boxes_names = array();
$form->addElement('html_editor', 'answer['.$i.']',null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
$form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
$form->addElement('html_editor', 'comment['.$i.']',null, array(), array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
for ($i = 1; $i <= $nb_answers; ++$i) {
$form->addHtml('<tr>');
if (is_object($answer)) {
$defaults['answer[' . $i . ']'] = $answer->answer[$i];
$defaults['comment[' . $i . ']'] = $answer->comment[$i];
$defaults['weighting[' . $i . ']'] = float_format($answer->weighting[$i], 1);
$defaults['correct[' . $i . ']'] = $answer->correct[$i];
} else {
$defaults['answer[1]'] = get_lang('DefaultMultipleAnswer2');
$defaults['comment[1]'] = get_lang('DefaultMultipleComment2');
$defaults['correct[1]'] = true;
$defaults['weighting[1]'] = 10;
$defaults['answer[2]'] = get_lang('DefaultMultipleAnswer1');
$defaults['comment[2]'] = get_lang('DefaultMultipleComment1');
$defaults['correct[2]'] = false;
$defaults['weighting[2]'] = -5;
}
$renderer = & $form->defaultRenderer();
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
'correct[' . $i . ']'
);
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
'counter[' . $i . ']'
);
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
'answer[' . $i . ']'
);
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
'comment[' . $i . ']'
);
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
'weighting[' . $i . ']'
);
$answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"');
$answer_number->freeze();
$form->addElement('checkbox', 'correct[' . $i . ']', null, null,
'class="checkbox" style="margin-left: 0em;"');
$boxes_names[] = 'correct[' . $i . ']';
$form->addHtmlEditor("answer[$i]", null, null, true, $editorConfig);
$form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
$form->addHtmlEditor("comment[$i]", null, null, true, $editorConfig);
$form->addElement('text', 'weighting[' . $i . ']', null, array('class' => "span1", 'value' => '0'));
$form->addHtml('</tr>');
}
$form->addElement('text', 'weighting['.$i.']',null, array('class' => "span1", 'value' => '0'));
$form -> addElement ('html', '</tr>');
}
$form -> addElement ('html', '</table>');
$form -> addElement ('html', '<br />');
$form->addHtml('</tbody>');
$form->addHtml('</table>');
$form -> add_multiple_required_rule ($boxes_names , get_lang('ChooseAtLeastOneCheckbox') , 'multiple_required');
$form->add_multiple_required_rule($boxes_names, get_lang('ChooseAtLeastOneCheckbox'), 'multiple_required');
global $text, $class;
if ($obj_ex->edit_exercise_in_lp == true) {
// setting the save button here and not in the question class.php
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'),'class="btn minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'),'class="btn plus"');
$form->addElement('style_submit_button','submitQuestion',$text, 'class="'.$class.'"');
}
global $text, $class;
if ($obj_ex->edit_exercise_in_lp == true) {
// setting the save button here and not in the question class.php
$form->addButtonDelete(get_lang('LessAnswer'), 'lessAnswers');
$form->addButtonCreate(get_lang('PlusAnswer'), 'moreAnswers');
$form->addButtonSave($text, 'submitQuestion');
}
$renderer->setElementTemplate('{element}&nbsp;','lessAnswers');
$renderer->setElementTemplate('{element}&nbsp;','submitQuestion');
$renderer->setElementTemplate('{element}&nbsp;','moreAnswers');
$form -> addElement ('html', '</div></div>');
$renderer->setElementTemplate('<div class="form-group"><div class="col-sm-offset-2">{element}', 'lessAnswers');
$renderer->setElementTemplate('{element}', 'moreAnswers');
$renderer->setElementTemplate('{element}</div></div>', 'submitQuestion');
$defaults['correct'] = $correct;
$defaults['correct'] = $correct;
if (!empty($this -> id)) {
$form -> setDefaults($defaults);
} else {
if ($this -> isContent == 1) {
$form -> setDefaults($defaults);
}
}
$form->setConstants(array('nb_answers' => $nb_answers));
}
if (!empty($this->id)) {
$form->setDefaults($defaults);
} else {
if ($this->isContent == 1) {
$form->setDefaults($defaults);
}
}
$form->setConstants(array('nb_answers' => $nb_answers));
}
/**

@ -1254,7 +1254,7 @@ abstract class Question
<a href="javascript://" onclick=" return show_media()"><span id="media_icon"><img style="vertical-align: middle;" src="../img/looknfeel.png" alt="" />&nbsp;'.get_lang('EnrichQuestion').'</span></a>
');
$form->addElement ('html','<div class="HideFCKEditor" id="HiddenFCKquestionDescription" >');
$form->addElement ('html','<div class="HideFCKEditor" id="HiddenFCKquestionDescription" style="display: none;" >');
$form->addHtmlEditor('questionDescription', get_lang('QuestionDescription'), false, false, $editor_config);
$form->addElement ('html','</div>');

@ -45,14 +45,14 @@ class UniqueAnswer extends Question
//this line defines how many questions by default appear when creating a choice question
// The previous default value was 2. See task #1759.
$nb_answers = isset($_POST['nb_answers']) ? (int)$_POST['nb_answers'] : 4;
$nb_answers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 4;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
/*
Types of Feedback
$feedback_option[0]=get_lang('Feedback');
$feedback_option[1]=get_lang('DirectFeedback');
$feedback_option[2]=get_lang('NoFeedback');
Types of Feedback
$feedback_option[0]=get_lang('Feedback');
$feedback_option[1]=get_lang('DirectFeedback');
$feedback_option[2]=get_lang('NoFeedback');
*/
$feedback_title = '';
@ -61,34 +61,27 @@ class UniqueAnswer extends Question
//Scenario
$editor_config['Width'] = '250';
$editor_config['Height'] = '110';
$comment_title = '<th width="500px" >' . get_lang('Comment') . '</th>';
$feedback_title = '<th width="350px" >' . get_lang('Scenario') . '</th>';
$comment_title = '<th width="50%" >' . get_lang('Comment') . '</th>';
$feedback_title = '<th width="50%" >' . get_lang('Scenario') . '</th>';
} else {
$comment_title = '<th>' . get_lang('Comment') . '</th>';
$comment_title = '<th width="50%">' . get_lang('Comment') . '</th>';
}
$html = '<table class="data_table">
$html = '<table class="table table-striped table-hover">
<thead>
<tr style="text-align: center;">
<th width="10px">
' . get_lang('Number') . '
</th>
<th width="10px" >
' . get_lang('True') . '
</th>
<th width="50%">
' . get_lang('Answer') . '
</th>
<th width="10">' . get_lang('Number') . '</th>
<th width="10" >' . get_lang('True') . '</th>
<th width="50%">' . get_lang('Answer') . '</th>
' . $comment_title . '
' . $feedback_title . '
<th width="50px">
' . get_lang('Weighting') . '
</th>
</tr>';
$form->addLabel(
get_lang('Answers') . '<br /> <img src="../img/fill_field.png">',
$html
);
<th width="10">' . get_lang('Weighting') . '</th>
</tr>
</thead>
<tbody>';
$form->addHeader(get_lang('Answers'));
$form->addHtml($html);
$defaults = array();
$correct = 0;
@ -113,8 +106,7 @@ class UniqueAnswer extends Question
}
$question = Question::read($questionid);
$select_question[$questionid] = 'Q' . $key . ' :' . cut(
$question->selectTitle(),
20
$question->selectTitle(), 20
);
}
}
@ -139,7 +131,7 @@ class UniqueAnswer extends Question
}
for ($i = 1; $i <= $nb_answers; ++$i) {
$form->addElement('html', '<tr>');
$form->addHtml('<tr>');
if (isset($answer) && is_object($answer)) {
if ($answer->correct[$i]) {
$correct = $i;
@ -208,33 +200,22 @@ class UniqueAnswer extends Question
);
$answer_number = $form->addElement(
'text',
'counter[' . $i . ']',
null,
' value = "' . $i . '"'
'text', 'counter[' . $i . ']', null, ' value = "' . $i . '"'
);
$answer_number->freeze();
$form->addElement(
'radio',
'correct',
null,
null,
$i,
'class="checkbox"'
'radio', 'correct', null, null, $i, 'class="checkbox"'
);
$form->addHtmlEditor('answer[' . $i . ']',null,null,true, $editor_config);
$form->addHtmlEditor('answer[' . $i . ']', null, null, true, $editor_config);
$form->addRule(
'answer[' . $i . ']',
get_lang('ThisFieldIsRequired'),
'required'
'answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required'
);
if ($obj_ex->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {
$form->addHtmlEditor('comment[' . $i . ']',null,null,false,$editor_config);
$form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editor_config);
// Direct feedback
//Adding extra feedback fields
$group = array();
$group['try' . $i] = $form->createElement(
@ -270,16 +251,15 @@ class UniqueAnswer extends Question
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}',
'scenario'
);
} else {
$form->addHtmlEditor('comment[' . $i . ']',null,null,false,$editor_config);
$form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editor_config);
}
$form->addText('weighting[' . $i . ']', null,null, array('class' => "col-md-1", 'value' => '0'));
$form->addElement('html', '</tr>');
$form->addText('weighting[' . $i . ']', null, null, array('class' => "col-md-1", 'value' => '0'));
$form->addHtml('</tr>');
}
$form->addElement('html', '</table>');
$form->addElement('html', '<br />');
$form->addHtml('</tbody>');
$form->addHtml('</table>');
$navigator_info = api_get_navigator();
@ -308,31 +288,15 @@ class UniqueAnswer extends Question
);
} else {
//setting the save button here and not in the question class.php
$form->addElement(
'style_submit_button',
'lessAnswers',
get_lang('LessAnswer'),
'class="btn btn-primary"'
);
$form->addElement(
'style_submit_button',
'moreAnswers',
get_lang('PlusAnswer'),
'class="btn btn-primary"'
);
$form->addElement(
'style_submit_button',
'submitQuestion',
$text,
'class="' . $class . '"'
);
$form->addButtonDelete(get_lang('LessAnswer'), 'lessAnswers');
$form->addButtonCreate(get_lang('PlusAnswer'), 'moreAnswers');
$form->addButtonSave($text, 'submitQuestion');
}
}
$renderer->setElementTemplate('{element}&nbsp;', 'submitQuestion');
$renderer->setElementTemplate('{element}&nbsp;', 'lessAnswers');
$renderer->setElementTemplate('{element}&nbsp;', 'moreAnswers');
$form->addHtml('</div></div>');
$renderer->setElementTemplate('<div class="form-group"><div class="col-sm-offset-2">{element}', 'lessAnswers');
$renderer->setElementTemplate('{element}', 'moreAnswers');
$renderer->setElementTemplate('{element}</div></div>', 'submitQuestion');
// We check the first radio button to be sure a radio button will be check
if ($correct == 0) {
@ -350,7 +314,6 @@ class UniqueAnswer extends Question
} else {
$form->setDefaults(array('correct' => 1));
}
}
$form->setConstants(array('nb_answers' => $nb_answers));
}

@ -3772,7 +3772,7 @@ function forum_search()
// Setting the form elements.
$form->addElement('header', '', get_lang('ForumSearch'));
$form->addElement('text', 'search_term', get_lang('SearchTerm'), 'class="input_titles" id="search_title"');
$form->addElement('text', 'search_term', get_lang('SearchTerm'), array('id' =>'search_title'));
$form->applyFilter('search_term', 'html_filter');
$form->addElement('static', 'search_information', '', get_lang('ForumSearchInformation'));
$form->addButtonSearch(get_lang('Search'));

@ -62,20 +62,16 @@ if (!empty($gradebook) && $gradebook == 'view') {
);
}
if (!empty ($_GET['gidReq'])) {
$toolgroup = Database::escape_string($_GET['gidReq']);
Session::write('toolgroup',$toolgroup);
}
$groupId = api_get_group_id();
if ($origin == 'group') {
$_clean['toolgroup']=(int)$_SESSION['toolgroup'];
$group_properties = GroupManager :: get_group_properties($_clean['toolgroup']);
$interbreadcrumb[] = array('url' => '../group/group.php', 'name' => get_lang('Groups'));
$interbreadcrumb[] = array('url' => '../group/group_space.php?gidReq='.$_SESSION['toolgroup'], 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')');
$interbreadcrumb[] = array('url' => 'viewforum.php?origin='.$origin.'&amp;gidReq='.$_SESSION['toolgroup'].'&amp;forum='.Security::remove_XSS($_GET['forum']), 'name' => prepare4display($current_forum['forum_title']));
$interbreadcrumb[] = array('url' => 'forumsearch.php','name' => get_lang('ForumSearch'));
$group_properties = GroupManager :: get_group_properties($groupId);
$interbreadcrumb[] = array('url' => '../group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
$interbreadcrumb[] = array('url' => '../group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')');
$interbreadcrumb[] = array('url' => 'viewforum.php?origin='.$origin.'&forum='.Security::remove_XSS($_GET['forum']).'&'.api_get_cidreq(), 'name' => prepare4display($current_forum['forum_title']));
$interbreadcrumb[] = array('url' => 'forumsearch.php?'.api_get_cidreq(),'name' => get_lang('ForumSearch'));
} else {
$interbreadcrumb[] = array('url' => 'index.php?gradebook='.$gradebook.'', 'name' => $nameTools);
$interbreadcrumb[] = array('url' => 'index.php?'.api_get_cidreq(), 'name' => $nameTools);
//$interbreadcrumb[] = array('url' => 'forumsearch.php', 'name' => );
$nameTools = get_lang('ForumSearch');
}

@ -53,7 +53,7 @@ class CatForm extends FormValidator
protected function build_move_form()
{
$renderer =& $this->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$this->addElement(
'static',
null,

@ -42,7 +42,7 @@ class DataForm extends FormValidator
protected function build_pdf_export_form()
{
$renderer =& $this->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span>');
$renderer->setCustomElementTemplate('<span>{element}</span>');
$this->addElement('header', get_lang('ChooseOrientation'));
$this->addElement('radio', 'orientation', null, get_lang('Portrait'), 'portrait');
$this->addElement('radio', 'orientation', null, get_lang('Landscape'), 'landscape');

@ -214,7 +214,7 @@ class EvalForm extends FormValidator
protected function build_move_form()
{
$renderer = & $this->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$this->addElement('static', null, null, '"' . $this->evaluation_object->get_name() . '" ');
$this->addElement('static', null, null, get_lang('MoveTo') . ' : ');
$select = $this->addElement('select', 'move_cat', null, null);
@ -332,7 +332,7 @@ class EvalForm extends FormValidator
));
$userinfo = api_get_user_info($this->result_object->get_user_id());
$renderer = & $this->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$this->addElement('label', get_lang('User'), $userinfo['complete_name']);
$this->addText('score', array(get_lang('Score'), null, '/ ' . $this->evaluation_object->get_max()), false, array(

@ -57,7 +57,7 @@ class LinkForm extends FormValidator
protected function build_move()
{
$renderer =& $this->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$this->addElement('static',null,null,'"'.$this->link_object->get_name().'" ');
$this->addElement('static',null,null,get_lang('MoveTo').' : ');
$select = $this->addElement('select','move_cat',null,null);

@ -46,7 +46,7 @@ class UserForm extends FormValidator
));
}
$renderer =& $this->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$this->addElement('text','keyword','');
$this->addElement('style_submit_button','submit',get_lang('Search'),'class="search"');
}

@ -155,7 +155,7 @@ elseif (isset($_POST['number_of_groups'])) {
</tr>
EOT;
$renderer->setElementTemplate($element_template);
$renderer->setCustomElementTemplate($element_template);
$form->addElement('header', $nameTools);
$form->addElement('hidden', 'action');
$form->addElement('hidden', 'number_of_groups');
@ -163,6 +163,7 @@ EOT;
// Table heading
$group_el = array ();
$group_el[] = $form->createElement('static', null, null, '<b>'.get_lang('GroupName').'</b>');
if (api_get_setting('allow_group_categories') == 'true') {
$group_el[] = $form->createElement('static', null, null, '<b>'.get_lang('GroupCategory').'</b>');
}

@ -50,7 +50,7 @@ if (!empty($courseId)) {
}
$renderer =& $form->defaultRenderer();
$renderer->setElementTemplate('<div style="width: 80%; margin: 0px auto; padding-bottom: 10px; ">{element}</div>');
$renderer->setCustomElementTemplate('<div style="width: 80%; margin: 0px auto; padding-bottom: 10px; ">{element}</div>');
$toolbar_set = 'IntroductionTool';
$width = '100%';

@ -374,7 +374,7 @@ class AnnouncementManager
'0'
);
} else {
$send_to = self::separate_users_groups($sentTo);
$send_to = CourseManager::separateUsersGroups($sentTo);
// Storing the selected groups
if (is_array($send_to['groups']) && !empty($send_to['groups'])) {
@ -460,7 +460,7 @@ class AnnouncementManager
// store in item_property (first the groups, then the users
if (!isset($to_users)) { // !isset($to): when no user is selected we send it to everyone
$send_to = self::separate_users_groups($to);
$send_to = CourseManager::separateUsersGroups($to);
// storing the selected groups
if (is_array($send_to['groups'])) {
foreach ($send_to['groups'] as $group) {
@ -541,7 +541,7 @@ class AnnouncementManager
if (!is_null($to)) {
// !is_null($to): when no user is selected we send it to everyone
$send_to = self::separate_users_groups($to);
$send_to = CourseManager::separateUsersGroups($to);
// storing the selected groups
if (is_array($send_to['groups'])) {
@ -1088,33 +1088,7 @@ class AnnouncementManager
}
}
/**
* This function separates the users from the groups
* users have a value USER:XXX (with XXX the groups id have a value
* GROUP:YYY (with YYY the group id)
* @param array Array of strings that define the type and id of each destination
* @return array Array of groups and users (each an array of IDs)
*/
public static function separate_users_groups($to)
{
$grouplist = array();
$userlist = array();
foreach ($to as $to_item) {
list($type, $id) = explode(':', $to_item);
switch ($type) {
case 'GROUP':
$grouplist[] = intval($id);
break;
case 'USER':
$userlist[] = intval($id);
break;
}
}
$send_to['groups'] = $grouplist;
$send_to['users'] = $userlist;
return $send_to;
}
/**
* Returns all the users and all the groups a specific announcement item

File diff suppressed because it is too large Load Diff

@ -2232,7 +2232,14 @@ class Agenda
if ($this->type == 'course') {
$form = null;
if (!isset($_GET['action'])) {
$form = new FormValidator('form-search');
$form = new FormValidator(
'form-search',
'post',
'',
'',
array(),
FormValidator::LAYOUT_INLINE);
$attributes = array(
'multiple' => false,
'id' => 'select_form_id_search'

@ -3326,10 +3326,10 @@ function api_not_allowed($print_headers = false, $message = null)
// If the user has no user ID, then his session has expired
$action = api_get_self().'?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
$action = str_replace('&amp;', '&', $action);
$form = new FormValidator('formLogin', 'post', $action, null, array('class'=>'form-stacked'));
$form->addElement('text', 'login', null, array('placeholder' => get_lang('UserName'), 'class' => 'span3 autocapitalize_off')); //new
$form->addElement('password', 'password', null, array('placeholder' => get_lang('Password'), 'class' => 'span3')); //new
$form->addElement('style_submit_button', 'submitAuth', get_lang('LoginEnter'), array('class' => 'btn span3'));
$form = new FormValidator('formLogin', 'post', $action, null, array(), FormValidator::LAYOUT_BOX_NO_LABEL);
$form->addElement('text', 'login', null, array('placeholder' => get_lang('UserName'), 'class' => 'autocapitalize_off'));
$form->addElement('password', 'password', null, array('placeholder' => get_lang('Password')));
$form->addButton('submitAuth', get_lang('LoginEnter'), '', 'primary');
// see same text in auth/gotocourse.php and main_api.lib.php function api_not_allowed (above)
$content = Display::return_message(get_lang('NotAllowed'), 'error', false);

@ -5330,6 +5330,34 @@ class CourseManager
);
}
/**
* This function separates the users from the groups
* users have a value USER:XXX (with XXX the groups id have a value
* GROUP:YYY (with YYY the group id)
* @param array Array of strings that define the type and id of each destination
* @return array Array of groups and users (each an array of IDs)
*/
public static function separateUsersGroups($to)
{
$grouplist = array();
$userlist = array();
foreach ($to as $to_item) {
list($type, $id) = explode(':', $to_item);
switch ($type) {
case 'GROUP':
$grouplist[] = intval($id);
break;
case 'USER':
$userlist[] = intval($id);
break;
}
}
$send_to['groups'] = $grouplist;
$send_to['users'] = $userlist;
return $send_to;
}
/**
* this function shows the form for sending a message to a specific group or user.
*/

@ -118,8 +118,7 @@ class FormValidator extends HTML_QuickForm
$this->setRequiredNote('<span class="form_required">*</span> <small>' . get_lang('ThisFieldIsRequired') . '</small>');
$noteTemplate = <<<EOT
<div class="form-group">
<div class="col-sm-2"></div>
<div class="col-sm-10">{requiredNote}</div>
<div class="col-sm-offset-2 col-sm-10">{requiredNote}</div>
</div>
EOT;
$renderer->setRequiredNoteTemplate($noteTemplate);
@ -578,12 +577,12 @@ EOT;
/**
* @param string $name
* @param string $label
* @param string $options
* @param array $options
* @param array $attributes
*
* @return HTML_QuickForm_select
*/
public function addSelect($name, $label, $options = '', $attributes = array())
public function addSelect($name, $label, $options = array(), $attributes = array())
{
return $this->addElement('select', $name, $label, $options, $attributes);
}

@ -1329,8 +1329,8 @@ class MessageManager
/**
* Get array of links (download) for message attachment files
* @param int message id
* @param string type message list (inbox/outbox)
* @param int $message_id
* @param string $type message list (inbox/outbox)
* @return array
*/
public static function get_links_message_attachment_files($message_id, $type = '')
@ -1342,7 +1342,8 @@ class MessageManager
$links_attach_file = array();
if (!empty($message_id)) {
$sql = "SELECT * FROM $tbl_message_attach WHERE message_id = '$message_id'";
$sql = "SELECT * FROM $tbl_message_attach
WHERE message_id = '$message_id'";
$rs_file = Database::query($sql);
if (Database::num_rows($rs_file) > 0) {
@ -1363,14 +1364,15 @@ class MessageManager
/**
* Get message list by id
* @param int message id
* @param int $message_id
* @return array
*/
public static function get_message_by_id($message_id)
{
$tbl_message = Database::get_main_table(TABLE_MESSAGE);
$message_id = intval($message_id);
$sql = "SELECT * FROM $tbl_message WHERE id = '$message_id' AND msg_status <> '".MESSAGE_STATUS_DELETED."' ";
$sql = "SELECT * FROM $tbl_message
WHERE id = '$message_id' AND msg_status <> '".MESSAGE_STATUS_DELETED."' ";
$res = Database::query($sql);
$item = array();
if (Database::num_rows($res) > 0) {

@ -37,6 +37,24 @@
class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
{
private $form;
private $customElementTemplate;
/**
* @return mixed
*/
public function getCustomElementTemplate()
{
return $this->customElementTemplate;
}
/**
* This template will be taken instead of the default templates by element
* @param string $customElementTemplate
*/
public function setCustomElementTemplate($customElementTemplate)
{
$this->customElementTemplate = $customElementTemplate;
}
/**
* The HTML of the form
@ -277,10 +295,17 @@ class HTML_QuickForm_Renderer_Default extends HTML_QuickForm_Renderer
// Custom template
$html = str_replace('{label}', $nameLabel, $this->_templates[$name]);
} else {
if (method_exists($element, 'getTemplate')) {
$template = $element->getTemplate($this->getForm()->getLayout());
$customElementTemplate = $this->getCustomElementTemplate();
if (empty($customElementTemplate)) {
if (method_exists($element, 'getTemplate')) {
$template = $element->getTemplate(
$this->getForm()->getLayout()
);
} else {
$template = $this->getForm()->getDefaultElementTemplate();
}
} else {
$template = $this->getForm()->getDefaultElementTemplate();
$template = $customElementTemplate;
}
$html = str_replace('{label}', $nameLabel, $template);
}

@ -308,6 +308,7 @@ class HTML_QuickForm_advmultiselect extends HTML_QuickForm_select
$attr = array('class' => $this->_tableAttributes);
$this->_removeAttr('class', $this->_attributes);
}
$this->_tableAttributes = $this->_getAttrString($attr);
// set default add button attributes
@ -409,7 +410,8 @@ class HTML_QuickForm_advmultiselect extends HTML_QuickForm_select
$this->_addButtonAttributes = array(
'name' => 'add',
'value' => ' ',
'type' => 'button'
'type' => 'button',
'class'=> 'btn btn-primary'
);
} else {
$this->_updateAttrArray(
@ -420,10 +422,12 @@ class HTML_QuickForm_advmultiselect extends HTML_QuickForm_select
break;
case 'remove':
if (is_null($attributes)) {
$this->_removeButtonAttributes
= array('name' => 'remove',
$this->_removeButtonAttributes = array(
'name' => 'remove',
'value' => ' ',
'type' => 'button');
'type' => 'button',
'class'=> 'btn btn-primary'
);
} else {
$this->_updateAttrArray($this->_removeButtonAttributes,
$this->_parseAttributes($attributes));
@ -431,10 +435,11 @@ class HTML_QuickForm_advmultiselect extends HTML_QuickForm_select
break;
case 'all':
if (is_null($attributes)) {
$this->_allButtonAttributes
= array('name' => 'all',
$this->_allButtonAttributes = array(
'name' => 'all',
'value' => ' Select All ',
'type' => 'button');
'type' => 'button'
);
} else {
$this->_updateAttrArray($this->_allButtonAttributes,
$this->_parseAttributes($attributes));
@ -533,10 +538,11 @@ class HTML_QuickForm_advmultiselect extends HTML_QuickForm_select
} else {
$this->_elementTemplate = '
{javascript}
<div class="col-sm-3"><!-- BEGIN label_2 -->{label_2}<!-- END label_2 --> {unselected}</div>
<div class="row">
<div class="col-sm-5"><!-- BEGIN label_2 -->{label_2}<!-- END label_2 --> {unselected}</div>
<div class="col-sm-2"><div class="text-center">{add}{remove}</div></div>
<div class="col-sm-3"><!-- BEGIN label_3 -->{label_3}<!-- END label_3 -->{selected}</div>
<div class="col-sm-5"><!-- BEGIN label_3 -->{label_3}<!-- END label_3 -->{selected}</div>
</div>
';
}
if ($js == false) {

@ -566,7 +566,7 @@ class Statistics
// Create a search-box
$form = new FormValidator('search_simple','get',api_get_path(WEB_CODE_PATH).'admin/statistics/index.php','','width=200px',false);
$renderer =& $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$form->addElement('hidden','report','activities');
$form->addElement('hidden','activities_direction','DESC');
$form->addElement('hidden','activities_column','4');

@ -1770,7 +1770,16 @@ class UserManager
$fields = array();
$t_uf = Database :: get_main_table(TABLE_MAIN_USER_FIELD);
$t_ufo = Database :: get_main_table(TABLE_MAIN_USER_FIELD_OPTIONS);
$columns = array('id', 'field_variable', 'field_type', 'field_display_text', 'field_default_value', 'field_order', 'field_filter', 'tms');
$columns = array(
'id',
'field_variable',
'field_type',
'field_display_text',
'field_default_value',
'field_order',
'field_filter',
'tms'
);
$column = intval($column);
$sort_direction = '';
if (in_array(strtoupper($direction), array('ASC', 'DESC'))) {
@ -1809,7 +1818,9 @@ class UserManager
10 => '<a name="'.$rowf['id'].'"></a>',
);
$sqlo = "SELECT * FROM $t_ufo WHERE field_id = ".$rowf['id']." ORDER BY option_order ASC";
$sqlo = "SELECT * FROM $t_ufo
WHERE field_id = ".$rowf['id']."
ORDER BY option_order ASC";
$reso = Database::query($sqlo);
if (Database::num_rows($reso) > 0) {
while ($rowo = Database::fetch_array($reso)) {
@ -3771,16 +3782,17 @@ class UserManager
}
/**
* Get extra filtrable user fields (type select)
* Get extra filtrable user fields (only type select)
* @return array
*/
public static function get_extra_filtrable_fields()
{
$extraFieldList = UserManager::get_extra_fields();
$extraFiltrableFields = array();
if (is_array($extraFieldList)) {
foreach ($extraFieldList as $extraField) {
//if is enabled to filter and is a "<select>" field type
// If is enabled to filter and is a "<select>" field type
if ($extraField[8] == 1 && $extraField[2] == 4) {
$extraFiltrableFields[] = array(
'name' => $extraField[3],
@ -3791,7 +3803,7 @@ class UserManager
}
}
if (is_array($extraFiltrableFields) && count($extraFiltrableFields) > 0 ) {
if (is_array($extraFiltrableFields) && count($extraFiltrableFields) > 0) {
return $extraFiltrableFields;
}
}
@ -3811,7 +3823,10 @@ class UserManager
if (UserManager::is_extra_field_available($extraField['variable'])) {
if (isset($_GET[$varName]) && $_GET[$varName]!='0') {
$useExtraFields = true;
$extraFieldResult[]= UserManager::get_extra_user_data_by_value($extraField['variable'], $_GET[$varName]);
$extraFieldResult[]= UserManager::get_extra_user_data_by_value(
$extraField['variable'],
$_GET[$varName]
);
}
}
}
@ -3847,35 +3862,74 @@ class UserManager
*/
public static function get_search_form($query)
{
$extraFiltrableFields = UserManager::get_extra_filtrable_fields();
$extraFields = null;
if (is_array($extraFiltrableFields) && count($extraFiltrableFields)>0 ) {
foreach ($extraFiltrableFields as $extraField) {
$extraFields .= '<label class="extra_field">'.$extraField['name'].'</label>';
$searchType = isset($_GET['search_type']) ? $_GET['search_type'] : null;
$form = new FormValidator(
'search_user',
'get',
api_get_path(WEB_PATH).'main/social/search.php',
'',
array(),
FormValidator::LAYOUT_INLINE
);
$form->addText('q', get_lang('UsersGroups'));
$options = array(
0 => get_lang('Select'),
1 => get_lang('User'),
2 => get_lang('Group'),
);
$form->addSelect(
'search_type',
get_lang('Type'),
$options,
array('onchange' => 'javascript: extra_field_toogle();')
);
// Extra fields
$extraFields = UserManager::get_extra_filtrable_fields();
$defaults = [];
if (is_array($extraFields) && count($extraFields) > 0) {
foreach ($extraFields as $extraField) {
$varName = 'field_'.$extraField['variable'];
$extraFields .= '&nbsp;<select name="'.$varName.'" class="extra_field">';
$extraFields .= '<option value="0">--'.get_lang('Select').'--</option>';
$options = [
0 => get_lang('Select')
];
foreach ($extraField['data'] as $option) {
$checked='';
$checked = '';
if (isset($_GET[$varName])) {
if ($_GET[$varName]==$option[1]) {
$checked = 'selected="true"';
if ($_GET[$varName] == $option[1]) {
$defaults[$option[1]] = true;
}
}
$extraFields .= '<option value="'.$option[1].'" '.$checked.'>'.$option[1].'</option>';
$options[$option[1]] = $option[1];
}
$extraFields .= '</select>';
$extraFields .= '&nbsp;&nbsp;';
$form->addSelect($varName, $extraField['name'], $options);
}
}
$searchType = isset($_GET['search_type']) ? $_GET['search_type'] : null;
$defaults['search_type'] = intval($searchType);
$defaults['q'] = api_htmlentities(Security::remove_XSS($query));
$form->setDefaults($defaults);
$form->addButtonSearch(get_lang('Search'));
$js = '<script>
extra_field_toogle();
function extra_field_toogle() {
if (jQuery("select[name=search_type]").val() != "1") { jQuery(".extra_field").hide(); } else { jQuery(".extra_field").show(); }
}
</script>';
return $js.$form->returnForm();
return '
<form method="GET" class="form-search" action="'.api_get_path(WEB_PATH).'main/social/search.php">
<input placeholder="'.get_lang('UsersGroups').'" type="text" value="'.api_htmlentities(Security::remove_XSS($query)).'" name="q"/> &nbsp;
' . get_lang('Type') .'
<select name="search_type" onchange="javascript: extra_field_toogle();">
<option value="0">--'.get_lang('Select').'--</option>
<option value="1"' . (($searchType=='1')?'selected="selected"':"") . '>--' . get_lang('User') .'--</option>
<option value="2"' . (($searchType=='2')?'selected="selected"':"") . '>--' . get_lang('Group') . '--</option>
@ -3883,13 +3937,7 @@ class UserManager
'.$extraFields.'
<button class="btn" type="submit" value="search">'.get_lang('Search').'</button>
</form>
<script>
extra_field_toogle();
function extra_field_toogle()
{
if (jQuery("select[name=search_type]").val() != "1") { jQuery(".extra_field").hide(); } else { jQuery(".extra_field").show(); }
}
</script>
';
}

@ -314,4 +314,7 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE;
//$_configuration['registration.soap.php.decode_utf8'] = false;
// Show delete option in attendance
//$_configuration['allow_delete_attendance'] = false;
// Enable Gravatar profile image if no local image has been given
//$_configuration['gravatar_enabled'] = true;
// If Gravatar is enabled, tells which type of picture we want (default is "mm"). Options: mm | identicon | monsterid | wavatar
//$_configuration['gravatar_type'] = 'mm';

File diff suppressed because it is too large Load Diff

@ -12,7 +12,7 @@
/* CONSTANTS */
define('SYSTEM_MAIN_DATABASE_FILE', 'db_main.sql');
define('SYSTEM_MAIN_DATABASE_FILE', 'main.sql');
define('COUNTRY_DATA_FILENAME', 'country_data.csv');
define('COURSES_HTACCESS_FILENAME', 'htaccess.dist');
define('SYSTEM_CONFIG_FILENAME', 'configuration.dist.php');

@ -118,7 +118,7 @@ load_main_database($installation_settings);
AddCourse::drop_course_tables();
AddCourse::create_course_tables();
load_database_script('course.sql');
$track_countries_table = "track_c_countries";
fill_track_countries_table($track_countries_table);

@ -3320,7 +3320,7 @@ CREATE TABLE track_e_links (
links_link_id int NOT NULL default 0,
links_session_id INT NOT NULL DEFAULT 0,
PRIMARY KEY (links_id),
KEY idx_tel_c_id (links_cours_id),
KEY idx_tel_c_id (c_id),
KEY idx_tel_user_id (links_user_id)
);
@ -3483,5 +3483,5 @@ CREATE TABLE c_attendance_calendar_rel_group (
-- Version
LOCK TABLES settings_current WRITE;
UPDATE settings_current SET selected_value = '1.10.0.21' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.22' WHERE variable = 'chamilo_database_version';
UNLOCK TABLES;

@ -91,7 +91,9 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('documents_
-- xxCOURSExx
ALTER TABLE c_survey ADD visible_results INT UNSIGNED DEFAULT 0;
ALTER TABLE c_survey ADD COLUMN visible_results INT UNSIGNED DEFAULT 0;
ALTER TABLE c_survey_invitation ADD COLUMN group_id INT NOT NULL;
,
ALTER TABLE c_lp_item ADD COLUMN prerequisite_min_score float;
ALTER TABLE c_lp_item ADD COLUMN prerequisite_max_score float;
ALTER TABLE c_student_publication ADD COLUMN document_id int DEFAULT 0;
@ -103,4 +105,4 @@ CREATE TABLE IF NOT EXISTS c_student_publication_comment (id INT PRIMARY KEY NOT
CREATE TABLE IF NOT EXISTS c_attendance_calendar_rel_group (id int NOT NULL auto_increment PRIMARY KEY, c_id INT NOT NULL, group_id INT NOT NULL, calendar_id INT NOT NULL);
-- Do not move this query
UPDATE settings_current SET selected_value = '1.10.0.21' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.22' WHERE variable = 'chamilo_database_version';

@ -297,7 +297,7 @@ if (defined('SYSTEM_INSTALLATION')) {
global $_configuration;
AddCourse::drop_course_tables();
AddCourse::create_course_tables();
load_database_script('course.sql');
$prefix = '';
if ($singleDbForm) {

@ -532,8 +532,8 @@ if ($is_allowed_to_edit) {
{
load: [
{ type:"script", id:"_fr1", src:"<?php echo api_get_jquery_web_path(); ?>"},
{ type:"script", id:"_fr4", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery-ui/smoothness/jquery-ui-1.8.21.custom.min.js"},
{ type:"stylesheet", id:"_fr5", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery-ui/smoothness/jquery-ui-1.8.21.custom.css"},
{ type:"script", id:"_fr4", src:"<?php echo api_get_jquery_ui_js_web_path(); ?>"},
{ type:"stylesheet", id:"_fr5", src:"<?php echo api_get_jquery_ui_css_web_path(); ?>"},
{ type:"script", id:"_fr2", src:"<?php echo api_get_path(WEB_LIBRARY_PATH); ?>javascript/jquery.highlight.js"}
]}
);

@ -34,15 +34,18 @@ if (!empty($extra_fields)) {
}
}
}
$user_info = UserManager::get_user_info_by_id($user_id);
$user_info = UserManager::get_user_info_by_id($user_id);
//Block Social Avatar
$social_avatar_block = SocialManager::getSocialUserBlock($user_id, 'search');
//Block Social Menu
$social_menu_block = SocialManager::show_social_menu('search');
$social_right_content = '<div class="span9">'.UserManager::get_search_form($query).'</div>';
$social_right_content = '';
$searchForm = UserManager::get_search_form($query);
$groups = array();
$totalGroups = array();
$users = array();
$totalUsers = array();
// I'm searching something
if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) ) {
@ -54,7 +57,7 @@ if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) )
$from = intval(($page - 1) * $itemPerPage);
// Get users from tags
$users = UserManager::get_all_user_tags($_GET['q'], 0, $from, $itemPerPage);
$users = UserManager::get_all_user_tags($_GET['q'], 0, $from, $itemPerPage);
}
if ($_GET['search_type']=='0' || $_GET['search_type']=='2') {
@ -89,7 +92,7 @@ if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) )
<button class="btn btn-mini"><i class="fa fa-envelope"></i> '.get_lang('SendMessage').'</button></a>';
if (empty($user['picture_uri'])) {
$picture['file'] = api_get_path(WEB_CODE_PATH).'img/unknown.jpg';
$img = '<img src="'.$picture['file'].'">';
$img = '<img src="'.$picture['file'].'">';
} else {
$picture = UserManager::get_picture_user(
$user['user_id'],
@ -110,10 +113,9 @@ if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) )
$user_info['complete_name'] = Display::url($status_icon.$user_info['complete_name'], $url);
$invitations = $user['tag'].$send_inv.$send_msg;
$results .= '<li class="span3">
<div class="">
<div class="row-fluid">
<div class="span12">
$results .= '<li class="col-md-3">
<div class="row">
<div class="col-md-12">
'.$user_info['complete_name'].'
</div>
<div class="col-md-4">
@ -126,7 +128,6 @@ if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) )
'.$invitations.'
</div>
</div>
</div>
</div>
</li>';
}
@ -148,10 +149,9 @@ if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) )
$totalUsers
);
$grid_groups = array();
if (is_array($groups) && count($groups) > 0) {
$social_right_content .= '<div class="span9">';
$social_right_content .= '<div class="col-md-9">';
$social_right_content .= Display::page_subheader(get_lang('Groups'));
$social_right_content .= '<ul class="thumbnails">';
@ -178,14 +178,14 @@ if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) )
$item_1 = Display::tag('h3', $url_open.$name.$url_close).$members;
$social_right_content .= '
<li class="span8">
<div class="row-fluid">
<div class="span1">
<li class="col-md-8">
<div class="row">
<div class="col-md-1">
<div class="media">
'.$item_0.'
</div>
</div>
<div class="span6">
<div class="col-md-6">
'.$item_1.'
<p>'.$group['description'].'</p>
<p>'.$tags.'</p>
@ -213,11 +213,11 @@ if ($query != '' || ($query_vars['search_type']=='1' && count($query_vars)>2) )
);
}
$tpl = new Template($tool_name);
$tpl->assign('social_avatar_block', $social_avatar_block);
$tpl->assign('social_menu_block', $social_menu_block);
$tpl->assign('social_right_content', $social_right_content);
$tpl->assign('search_form', $searchForm);
$formModalTpl = new Template();
$formModalTpl->assign('messageForm', MessageManager::generate_message_form('send_message'));

@ -3368,9 +3368,19 @@ class SurveyUtil
* @version January 2007
*
*/
static function save_invitations($users_array, $invitation_title, $invitation_text, $reminder = 0, $sendmail = 0, $remindUnAnswered = 0)
{
if (!is_array($users_array)) return 0; // Should not happen
public static function save_invitations(
$users_array,
$invitation_title,
$invitation_text,
$reminder = 0,
$sendmail = 0,
$remindUnAnswered = 0
) {
if (!is_array($users_array)) {
// Should not happen
return 0;
}
// Getting the survey information
$survey_data = survey_manager::get_survey($_GET['survey_id']);
@ -3386,13 +3396,38 @@ class SurveyUtil
$counter = 0; // Nr of invitations "sent" (if sendmail option)
$course_id = api_get_course_int_id();
$session_id = api_get_session_id();
foreach ($users_array as $key=>$value) {
if (!isset($value) || $value == '') continue;
$result = CourseManager::separateUsersGroups($users_array);
$groupList = $result['groups'];
$users_array = $result['users'];
foreach ($groupList as $groupId) {
$userGroupList = GroupManager::getStudents($groupId);
$userGroupIdList = array_column($userGroupList, 'user_id');
$users_array = array_merge($users_array, $userGroupIdList);
$params = array(
'c_id' => $course_id,
'session_id' => $session_id,
'group_id' => $groupId,
'survey_code' => $survey_data['code']
);
self::save_invitation($params);
}
$users_array = array_unique($users_array);
foreach ($users_array as $key => $value) {
if (!isset($value) || $value == '') {
continue;
}
// Skip user if reminding only unanswered people
if (in_array($value, $exclude_users)) continue;
if (in_array($value, $exclude_users)) {
continue;
}
// Get the unique invitation code if we already have it
if ($reminder == 1 && array_key_exists($value, $survey_invitations)) {
$invitation_code = $survey_invitations[$value]['invitation_code'];
@ -3403,8 +3438,10 @@ class SurveyUtil
// Store the invitation if user_id not in $already_invited['course_users'] OR email is not in $already_invited['additional_users']
$addit_users_array = isset($already_invited['additional_users']) && !empty($already_invited['additional_users']) ? explode(';', $already_invited['additional_users']) : array();
$my_alredy_invited = ($already_invited['course_users'] == null) ? array() : $already_invited['course_users'];
if ((is_numeric($value) && !in_array($value, $my_alredy_invited)) || (!is_numeric($value) && !in_array($value, $addit_users_array))) {
$my_alredy_invited = $already_invited['course_users'] == null ? array() : $already_invited['course_users'];
if ((is_numeric($value) && !in_array($value, $my_alredy_invited)) ||
(!is_numeric($value) && !in_array($value, $addit_users_array))
) {
$new_user = true;
if (!array_key_exists($value, $survey_invitations)) {
$params = array(
@ -3418,6 +3455,7 @@ class SurveyUtil
self::save_invitation($params);
}
}
// Send the email if checkboxed
if (($new_user || $reminder == 1) && $sendmail != 0) {
// Make a change for absolute url
@ -3430,14 +3468,19 @@ class SurveyUtil
$counter++;
}
}
return $counter; // Number of invitations sent
}
/**
* @param $params
* @return bool|int
*/
static function save_invitation($params)
{
// Database table to store the invitations data
$table_survey_invitation = Database::get_course_table(TABLE_SURVEY_INVITATION);
if (!empty($params['c_id']) && !empty($params['user']) && !empty($params['survey_code'])) {
if (!empty($params['c_id']) && (!empty($params['user']) || !empty($params['group_id'])) && !empty($params['survey_code'])) {
return Database::insert($table_survey_invitation, $params);
}
return false;
@ -3580,7 +3623,7 @@ class SurveyUtil
// Selecting all the invitations of this survey AND the additional emailaddresses (the left join)
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
$sql = "SELECT user
$sql = "SELECT user, group_id
FROM $table_survey_invitation as table_invitation
WHERE
table_invitation.c_id = $course_id AND
@ -3590,17 +3633,22 @@ class SurveyUtil
$defaults = array();
$defaults['course_users'] = array();
$defaults['additional_users'] = array();
$defaults['additional_users'] = array(); // Textarea
$defaults['users'] = array(); // user and groups
$result = Database::query($sql);
while ($row = Database::fetch_array($result)) {
if (is_numeric($row['user'])) {
$defaults['course_users'][] = $row['user'];
$defaults['users'][] = 'USER:'.$row['user'];
} else {
if (!empty($row['user'])) {
$defaults['additional_users'][] = $row['user'];
}
}
if (isset($row['group_id'])) {
$defaults['users'][] = 'GROUP:'.$row['group_id'];
}
}
if (!empty($defaults['course_users'])) {

@ -67,7 +67,7 @@ Display::display_header($tool_name,'Survey');
echo '<script>
$(function() {
$("#check_mail").change(function() {
$("#mail_text").toggle();
$("#mail_text_wrapper").toggle();
});
});
</script>';
@ -91,7 +91,11 @@ if ($survey_data['invited'] > 0 && !isset($_POST['submit'])) {
}
// Building the form for publishing the survey
$form = new FormValidator('publish_form', 'post', api_get_self().'?survey_id='.$survey_id.'&'.api_get_cidReq());
$form = new FormValidator(
'publish_form',
'post',
api_get_self().'?survey_id='.$survey_id.'&'.api_get_cidReq()
);
$form->addElement('header', '', $tool_name);
// Course users
@ -105,21 +109,41 @@ $possible_users = array();
foreach ($complete_user_list as & $user) {
$possible_users[$user['user_id']] = api_get_person_name($user['firstname'], $user['lastname']);
}
$users = $form->addElement('advmultiselect', 'course_users', get_lang('CourseUsers'), $possible_users, 'style="width: 250px; height: 200px;"');
CourseManager::addUserGroupMultiSelect($form, array());
/*$form->addElement(
'advmultiselect',
'course_users',
get_lang('CourseUsers'),
$possible_users,
'style="width: 250px; height: 200px;"'
);*/
// Additional users
$form->addElement('textarea', 'additional_users', array(get_lang('AdditonalUsers'), get_lang('AdditonalUsersComment')), array('class' => 'span6', 'rows' => 5));
$form->addElement(
'textarea',
'additional_users',
array(get_lang('AdditonalUsers'), get_lang('AdditonalUsersComment')),
array('rows' => 5)
);
$form->addElement('html', '<div id="check_mail">');
$form->addElement('checkbox', 'send_mail','', get_lang('SendMail'));
$form->addElement('html', '</div>');
$form->addElement('html', '<div id="mail_text">');
$form->addElement('html', '<div id="mail_text_wrapper">');
// The title of the mail
$form->addElement('text', 'mail_title', get_lang('MailTitle'), array('class' => 'span6'));
$form->addText('mail_title', get_lang('MailTitle'), false);
// The text of the mail
$form->addElement('html_editor', 'mail_text', array(get_lang('MailText'), get_lang('UseLinkSyntax')), null, array('ToolbarSet' => 'Survey', 'Width' => '100%', 'Height' => '150'));
$form->addHtmlEditor(
'mail_text',
array(get_lang('MailText'), get_lang('UseLinkSyntax')),
false,
array('ToolbarSet' => 'Survey', 'Height' => '150')
);
$form->addElement('html', '</div>');
// You cab send a reminder to unanswered people if the survey is not anonymous
if ($survey_data['anonymous'] != 1) {
@ -129,7 +153,7 @@ if ($survey_data['anonymous'] != 1) {
$form->addElement('checkbox', 'resend_to_all', '', get_lang('ReminderResendToAllUsers'));
// Submit button
$form->addElement('style_submit_button', 'submit', get_lang('PublishSurvey'), 'class="save"');
$form->addButtonSave(get_lang('PublishSurvey'));
// The rules (required fields)
/*if ($survey_data['send_mail'] == 0) {
$form->addRule('mail_title', get_lang('ThisFieldIsRequired'), 'required');
@ -152,7 +176,7 @@ $form->addElement('label', null, $auto_survey_link);
if ($form->validate()) {
$values = $form->exportValues();
if ($values['send_mail'] == 1) {
if (isset($values['send_mail']) && $values['send_mail'] == 1) {
if (empty($values['mail_title']) || empty($values['mail_text'])) {
Display :: display_error_message(get_lang('FormHasErrorsPleaseComplete'));
// Getting the invited users
@ -172,10 +196,22 @@ if ($form->validate()) {
}
}
// Save the invitation mail
SurveyUtil::save_invite_mail($values['mail_text'], $values['mail_title'], !empty($survey_data['invite_mail']));
SurveyUtil::save_invite_mail(
$values['mail_text'],
$values['mail_title'],
!empty($survey_data['invite_mail'])
);
// Saving the invitations for the course users
$count_course_users = SurveyUtil::save_invitations($values['course_users'], $values['mail_title'],
$values['mail_text'], $values['resend_to_all'], $values['send_mail'], $values['remindUnAnswered']);
$count_course_users = SurveyUtil::save_invitations(
$values['users'],
$values['mail_title'],
$values['mail_text'],
$values['resend_to_all'],
$values['send_mail'],
$values['remindUnAnswered']
);
// Saving the invitations for the additional users
$values['additional_users'] = $values['additional_users'].';'; // This is for the case when you enter only one email
$temp = str_replace(',', ';', $values['additional_users']); // This is to allow , and ; as email separators

@ -116,15 +116,11 @@ class survey_question
public function renderForm()
{
if (isset($_GET['question_id']) and !empty($_GET['question_id'])) {
$icon = 'pencil';
$text = get_lang('ModifyQuestionSurvey');
$this->buttonList[] = $this->getForm()->addButtonUpdate(get_lang('ModifyQuestionSurvey'), 'save', true);
} else {
$icon = 'check';
$text = get_lang('CreateQuestionSurvey');
$this->buttonList[] = $this->getForm()->addButtonSave(get_lang('CreateQuestionSurvey'), 'save', true);
}
$this->buttonList[] = $this->getForm()->createElement('button', 'save', $text, $icon);
$this->getForm()->addGroup($this->buttonList, 'buttons');
}

@ -13,8 +13,6 @@
{% if show_footer == true %}
</div> <!-- end of #row" -->
</div> <!-- end of #main" -->
</div> <!-- end of #page section -->
</div> <!-- end of #wrapper section -->
{% endif %}
{% include template ~ "/layout/main_footer.tpl" %}
{% endblock %}

@ -19,8 +19,6 @@
{% if show_footer == true %}
</div> <!-- end of #row" -->
</div> <!-- end of #main" -->
</div> <!-- end of #page section -->
</div> <!-- end of #wrapper section -->
{% endif %}

@ -8,26 +8,22 @@
{{ social_menu_block }}
</div>
</div>
<div id="wallMessages" class="col-md-5" style="min-height:1px">
<div class="col-md-9" style="min-height:1px">
<div class="row">
<div class="col-md-12">
<div id="message_ajax_reponse" class=""></div>
</div>
</div>
<div class="row">
{{ social_right_content}}
</div>
<div id="display_response_id" class="col-md-12"></div>
{{ socialAutoExtendLink }}
</div>
<div class="col-md-4">
<div class="row">
{{ socialRightInformation}}
<div class="col-md-12">
{{ search_form }}
</div>
{{ social_right_content }}
</div>
</div>
</div>
{% if formModals is defined %}
{{ formModals }}
{% endif %}
{% endblock %}
{% if formModals is defined %}
{{ formModals }}
{% endif %}
{% endblock %}

@ -263,7 +263,7 @@ $form_search = new FormValidator(
FormValidator::LAYOUT_INLINE
);
$renderer = $form_search->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span>');
$renderer->setCustomElementTemplate('<span>{element}</span>');
$form_search->addElement('hidden', 'from', Security::remove_XSS($from));
$form_search->addElement('hidden', 'session_id', $sessionId);
$form_search->addElement('hidden', 'id_session', $sessionId);

@ -106,7 +106,7 @@ $form = new FormValidator(
false
);
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span>');
$renderer->setCustomElementTemplate('<span>{element}</span>');
$form->addElement('text', 'keyword', get_lang('keyword'));
$form->addElement('hidden', 'cidReq', api_get_course_id());
$form->addElement('hidden', 'id_session', $session_id);

@ -153,7 +153,7 @@ $user_file_template =
<!-- BEGIN error --><br /><span class="form_error">{error}</span><!-- END error -->
</div>
EOT;
$renderer->setElementTemplate($user_file_template);
$renderer->setCustomElementTemplate($user_file_template);
$form -> addElement ('file', 'user_file','<img src="../img/word_big.gif" align="absbottom" />');
if (api_get_setting('search_enabled')=='true') {

@ -61,7 +61,7 @@ if (api_get_setting('ProfilingFilterAddingUsers') == 'true') {
// Build search-form
$form = new FormValidator('search_user', 'get', '', '', null, false);
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$form->addText('keyword', '', false);
$form->addElement('hidden', 'type', $type);
$form->addButtonSearch(get_lang('Search'));

@ -36,7 +36,7 @@ if (api_is_anonymous()) {
$renderer =& $form->defaultRenderer();
$renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>');
$renderer->setElementTemplate('<tr><td>{element}</td></tr>');
$renderersetCustomElementTemplate->setCustomElementTemplate('<tr><td>{element}</td></tr>');
$form->addElement('html', $option1);
$form->addElement('checkbox', 'left', null, get_lang('Yes'));
@ -57,7 +57,7 @@ if (api_is_anonymous()) {
$renderer =& $form2->defaultRenderer();
$renderer->setHeaderTemplate('');
$renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>');
$renderer->setElementTemplate('<tr><td>{element}</td></tr>');
$renderer->setCustomElementTemplate('<tr><td>{element}</td></tr>');
$form2->addElement('html', $option2);
$form2->addElement('checkbox', 'right', null, get_lang('Yes'));

@ -252,7 +252,7 @@ if ($isAdmin) {
// Create a search-box
$form = new FormValidator('search_simple', 'get', '', '', null, false);
$renderer = & $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$renderer->setCustomElementTemplate('<span>{element}</span> ');
$form->addElement('text', 'keyword', get_lang('keyword'), 'size="25"');
$form->addElement('style_submit_button', 'submit_simple', get_lang('Search'), 'class="search"');
$form->addElement('static', 'search_advanced_link', null,

Loading…
Cancel
Save