Commit 5197dc96ea589218bff6f886cc8de645c340c36f
1 parent
a3751795
Exists in
master
and in
3 other branches
Le nom des matériel s'affiche en rouge sur la liste des matériels et dates sur l…
…eur fiche détaillée lorsque la date de garantie est passée. Début de modification d'envoi des mails de façon plus propre. Divers bugfix.
Showing
49 changed files
with
992 additions
and
516 deletions
Show diff stats
composer.json
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | "require-dev": { | 15 | "require-dev": { |
16 | "psy/psysh": "@stable", | 16 | "psy/psysh": "@stable", |
17 | "cakephp/bake": "~1.1", | 17 | "cakephp/bake": "~1.1", |
18 | - "phpunit/phpunit": "^4.8" | 18 | + "phpunit/phpunit": "^5.7" |
19 | }, | 19 | }, |
20 | "suggest": { | 20 | "suggest": { |
21 | "phpunit/phpunit": "Allows automated tests to be run without system-wide install.", | 21 | "phpunit/phpunit": "Allows automated tests to be run without system-wide install.", |
composer.lock
@@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", | 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", |
5 | "This file is @generated automatically" | 5 | "This file is @generated automatically" |
6 | ], | 6 | ], |
7 | - "hash": "f3c40c441166c950fe8099531a9d5970", | ||
8 | - "content-hash": "5701970d465c36d8bd0d3846ff00efec", | 7 | + "hash": "89645e7a585f3dc620817a0408eb0ede", |
8 | + "content-hash": "ab13ce1b88067ed3a8ee3bb1578dac09", | ||
9 | "packages": [ | 9 | "packages": [ |
10 | { | 10 | { |
11 | "name": "aura/installer-default", | 11 | "name": "aura/installer-default", |
@@ -825,16 +825,16 @@ | @@ -825,16 +825,16 @@ | ||
825 | }, | 825 | }, |
826 | { | 826 | { |
827 | "name": "symfony/yaml", | 827 | "name": "symfony/yaml", |
828 | - "version": "v3.2.7", | 828 | + "version": "v3.2.8", |
829 | "source": { | 829 | "source": { |
830 | "type": "git", | 830 | "type": "git", |
831 | "url": "https://github.com/symfony/yaml.git", | 831 | "url": "https://github.com/symfony/yaml.git", |
832 | - "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621" | 832 | + "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6" |
833 | }, | 833 | }, |
834 | "dist": { | 834 | "dist": { |
835 | "type": "zip", | 835 | "type": "zip", |
836 | - "url": "https://api.github.com/repos/symfony/yaml/zipball/62b4cdb99d52cb1ff253c465eb1532a80cebb621", | ||
837 | - "reference": "62b4cdb99d52cb1ff253c465eb1532a80cebb621", | 836 | + "url": "https://api.github.com/repos/symfony/yaml/zipball/acec26fcf7f3031e094e910b94b002fa53d4e4d6", |
837 | + "reference": "acec26fcf7f3031e094e910b94b002fa53d4e4d6", | ||
838 | "shasum": "" | 838 | "shasum": "" |
839 | }, | 839 | }, |
840 | "require": { | 840 | "require": { |
@@ -876,7 +876,7 @@ | @@ -876,7 +876,7 @@ | ||
876 | ], | 876 | ], |
877 | "description": "Symfony Yaml Component", | 877 | "description": "Symfony Yaml Component", |
878 | "homepage": "https://symfony.com", | 878 | "homepage": "https://symfony.com", |
879 | - "time": "2017-03-20 09:45:15" | 879 | + "time": "2017-05-01 14:55:58" |
880 | } | 880 | } |
881 | ], | 881 | ], |
882 | "packages-dev": [ | 882 | "packages-dev": [ |
@@ -1101,6 +1101,48 @@ | @@ -1101,6 +1101,48 @@ | ||
1101 | "time": "2015-04-20 18:58:01" | 1101 | "time": "2015-04-20 18:58:01" |
1102 | }, | 1102 | }, |
1103 | { | 1103 | { |
1104 | + "name": "myclabs/deep-copy", | ||
1105 | + "version": "1.6.1", | ||
1106 | + "source": { | ||
1107 | + "type": "git", | ||
1108 | + "url": "https://github.com/myclabs/DeepCopy.git", | ||
1109 | + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" | ||
1110 | + }, | ||
1111 | + "dist": { | ||
1112 | + "type": "zip", | ||
1113 | + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", | ||
1114 | + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", | ||
1115 | + "shasum": "" | ||
1116 | + }, | ||
1117 | + "require": { | ||
1118 | + "php": ">=5.4.0" | ||
1119 | + }, | ||
1120 | + "require-dev": { | ||
1121 | + "doctrine/collections": "1.*", | ||
1122 | + "phpunit/phpunit": "~4.1" | ||
1123 | + }, | ||
1124 | + "type": "library", | ||
1125 | + "autoload": { | ||
1126 | + "psr-4": { | ||
1127 | + "DeepCopy\\": "src/DeepCopy/" | ||
1128 | + } | ||
1129 | + }, | ||
1130 | + "notification-url": "https://packagist.org/downloads/", | ||
1131 | + "license": [ | ||
1132 | + "MIT" | ||
1133 | + ], | ||
1134 | + "description": "Create deep copies (clones) of your objects", | ||
1135 | + "homepage": "https://github.com/myclabs/DeepCopy", | ||
1136 | + "keywords": [ | ||
1137 | + "clone", | ||
1138 | + "copy", | ||
1139 | + "duplicate", | ||
1140 | + "object", | ||
1141 | + "object graph" | ||
1142 | + ], | ||
1143 | + "time": "2017-04-12 18:52:22" | ||
1144 | + }, | ||
1145 | + { | ||
1104 | "name": "nikic/php-parser", | 1146 | "name": "nikic/php-parser", |
1105 | "version": "v2.1.0", | 1147 | "version": "v2.1.0", |
1106 | "source": { | 1148 | "source": { |
@@ -1362,39 +1404,40 @@ | @@ -1362,39 +1404,40 @@ | ||
1362 | }, | 1404 | }, |
1363 | { | 1405 | { |
1364 | "name": "phpunit/php-code-coverage", | 1406 | "name": "phpunit/php-code-coverage", |
1365 | - "version": "2.2.4", | 1407 | + "version": "4.0.8", |
1366 | "source": { | 1408 | "source": { |
1367 | "type": "git", | 1409 | "type": "git", |
1368 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", | 1410 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", |
1369 | - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" | 1411 | + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" |
1370 | }, | 1412 | }, |
1371 | "dist": { | 1413 | "dist": { |
1372 | "type": "zip", | 1414 | "type": "zip", |
1373 | - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", | ||
1374 | - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", | 1415 | + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", |
1416 | + "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", | ||
1375 | "shasum": "" | 1417 | "shasum": "" |
1376 | }, | 1418 | }, |
1377 | "require": { | 1419 | "require": { |
1378 | - "php": ">=5.3.3", | ||
1379 | - "phpunit/php-file-iterator": "~1.3", | ||
1380 | - "phpunit/php-text-template": "~1.2", | ||
1381 | - "phpunit/php-token-stream": "~1.3", | ||
1382 | - "sebastian/environment": "^1.3.2", | ||
1383 | - "sebastian/version": "~1.0" | 1420 | + "ext-dom": "*", |
1421 | + "ext-xmlwriter": "*", | ||
1422 | + "php": "^5.6 || ^7.0", | ||
1423 | + "phpunit/php-file-iterator": "^1.3", | ||
1424 | + "phpunit/php-text-template": "^1.2", | ||
1425 | + "phpunit/php-token-stream": "^1.4.2 || ^2.0", | ||
1426 | + "sebastian/code-unit-reverse-lookup": "^1.0", | ||
1427 | + "sebastian/environment": "^1.3.2 || ^2.0", | ||
1428 | + "sebastian/version": "^1.0 || ^2.0" | ||
1384 | }, | 1429 | }, |
1385 | "require-dev": { | 1430 | "require-dev": { |
1386 | - "ext-xdebug": ">=2.1.4", | ||
1387 | - "phpunit/phpunit": "~4" | 1431 | + "ext-xdebug": "^2.1.4", |
1432 | + "phpunit/phpunit": "^5.7" | ||
1388 | }, | 1433 | }, |
1389 | "suggest": { | 1434 | "suggest": { |
1390 | - "ext-dom": "*", | ||
1391 | - "ext-xdebug": ">=2.2.1", | ||
1392 | - "ext-xmlwriter": "*" | 1435 | + "ext-xdebug": "^2.5.1" |
1393 | }, | 1436 | }, |
1394 | "type": "library", | 1437 | "type": "library", |
1395 | "extra": { | 1438 | "extra": { |
1396 | "branch-alias": { | 1439 | "branch-alias": { |
1397 | - "dev-master": "2.2.x-dev" | 1440 | + "dev-master": "4.0.x-dev" |
1398 | } | 1441 | } |
1399 | }, | 1442 | }, |
1400 | "autoload": { | 1443 | "autoload": { |
@@ -1420,7 +1463,7 @@ | @@ -1420,7 +1463,7 @@ | ||
1420 | "testing", | 1463 | "testing", |
1421 | "xunit" | 1464 | "xunit" |
1422 | ], | 1465 | ], |
1423 | - "time": "2015-10-06 15:47:00" | 1466 | + "time": "2017-04-02 07:44:40" |
1424 | }, | 1467 | }, |
1425 | { | 1468 | { |
1426 | "name": "phpunit/php-file-iterator", | 1469 | "name": "phpunit/php-file-iterator", |
@@ -1610,40 +1653,50 @@ | @@ -1610,40 +1653,50 @@ | ||
1610 | }, | 1653 | }, |
1611 | { | 1654 | { |
1612 | "name": "phpunit/phpunit", | 1655 | "name": "phpunit/phpunit", |
1613 | - "version": "4.8.35", | 1656 | + "version": "5.7.19", |
1614 | "source": { | 1657 | "source": { |
1615 | "type": "git", | 1658 | "type": "git", |
1616 | "url": "https://github.com/sebastianbergmann/phpunit.git", | 1659 | "url": "https://github.com/sebastianbergmann/phpunit.git", |
1617 | - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87" | 1660 | + "reference": "69c4f49ff376af2692bad9cebd883d17ebaa98a1" |
1618 | }, | 1661 | }, |
1619 | "dist": { | 1662 | "dist": { |
1620 | "type": "zip", | 1663 | "type": "zip", |
1621 | - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/791b1a67c25af50e230f841ee7a9c6eba507dc87", | ||
1622 | - "reference": "791b1a67c25af50e230f841ee7a9c6eba507dc87", | 1664 | + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/69c4f49ff376af2692bad9cebd883d17ebaa98a1", |
1665 | + "reference": "69c4f49ff376af2692bad9cebd883d17ebaa98a1", | ||
1623 | "shasum": "" | 1666 | "shasum": "" |
1624 | }, | 1667 | }, |
1625 | "require": { | 1668 | "require": { |
1626 | "ext-dom": "*", | 1669 | "ext-dom": "*", |
1627 | "ext-json": "*", | 1670 | "ext-json": "*", |
1628 | - "ext-pcre": "*", | ||
1629 | - "ext-reflection": "*", | ||
1630 | - "ext-spl": "*", | ||
1631 | - "php": ">=5.3.3", | ||
1632 | - "phpspec/prophecy": "^1.3.1", | ||
1633 | - "phpunit/php-code-coverage": "~2.1", | 1671 | + "ext-libxml": "*", |
1672 | + "ext-mbstring": "*", | ||
1673 | + "ext-xml": "*", | ||
1674 | + "myclabs/deep-copy": "~1.3", | ||
1675 | + "php": "^5.6 || ^7.0", | ||
1676 | + "phpspec/prophecy": "^1.6.2", | ||
1677 | + "phpunit/php-code-coverage": "^4.0.4", | ||
1634 | "phpunit/php-file-iterator": "~1.4", | 1678 | "phpunit/php-file-iterator": "~1.4", |
1635 | "phpunit/php-text-template": "~1.2", | 1679 | "phpunit/php-text-template": "~1.2", |
1636 | "phpunit/php-timer": "^1.0.6", | 1680 | "phpunit/php-timer": "^1.0.6", |
1637 | - "phpunit/phpunit-mock-objects": "~2.3", | ||
1638 | - "sebastian/comparator": "~1.2.2", | 1681 | + "phpunit/phpunit-mock-objects": "^3.2", |
1682 | + "sebastian/comparator": "^1.2.4", | ||
1639 | "sebastian/diff": "~1.2", | 1683 | "sebastian/diff": "~1.2", |
1640 | - "sebastian/environment": "~1.3", | ||
1641 | - "sebastian/exporter": "~1.2", | ||
1642 | - "sebastian/global-state": "~1.0", | ||
1643 | - "sebastian/version": "~1.0", | 1684 | + "sebastian/environment": "^1.3.4 || ^2.0", |
1685 | + "sebastian/exporter": "~2.0", | ||
1686 | + "sebastian/global-state": "^1.1", | ||
1687 | + "sebastian/object-enumerator": "~2.0", | ||
1688 | + "sebastian/resource-operations": "~1.0", | ||
1689 | + "sebastian/version": "~1.0.3|~2.0", | ||
1644 | "symfony/yaml": "~2.1|~3.0" | 1690 | "symfony/yaml": "~2.1|~3.0" |
1645 | }, | 1691 | }, |
1692 | + "conflict": { | ||
1693 | + "phpdocumentor/reflection-docblock": "3.0.2" | ||
1694 | + }, | ||
1695 | + "require-dev": { | ||
1696 | + "ext-pdo": "*" | ||
1697 | + }, | ||
1646 | "suggest": { | 1698 | "suggest": { |
1699 | + "ext-xdebug": "*", | ||
1647 | "phpunit/php-invoker": "~1.1" | 1700 | "phpunit/php-invoker": "~1.1" |
1648 | }, | 1701 | }, |
1649 | "bin": [ | 1702 | "bin": [ |
@@ -1652,7 +1705,7 @@ | @@ -1652,7 +1705,7 @@ | ||
1652 | "type": "library", | 1705 | "type": "library", |
1653 | "extra": { | 1706 | "extra": { |
1654 | "branch-alias": { | 1707 | "branch-alias": { |
1655 | - "dev-master": "4.8.x-dev" | 1708 | + "dev-master": "5.7.x-dev" |
1656 | } | 1709 | } |
1657 | }, | 1710 | }, |
1658 | "autoload": { | 1711 | "autoload": { |
@@ -1678,30 +1731,33 @@ | @@ -1678,30 +1731,33 @@ | ||
1678 | "testing", | 1731 | "testing", |
1679 | "xunit" | 1732 | "xunit" |
1680 | ], | 1733 | ], |
1681 | - "time": "2017-02-06 05:18:07" | 1734 | + "time": "2017-04-03 02:22:27" |
1682 | }, | 1735 | }, |
1683 | { | 1736 | { |
1684 | "name": "phpunit/phpunit-mock-objects", | 1737 | "name": "phpunit/phpunit-mock-objects", |
1685 | - "version": "2.3.8", | 1738 | + "version": "3.4.3", |
1686 | "source": { | 1739 | "source": { |
1687 | "type": "git", | 1740 | "type": "git", |
1688 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", | 1741 | "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", |
1689 | - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" | 1742 | + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24" |
1690 | }, | 1743 | }, |
1691 | "dist": { | 1744 | "dist": { |
1692 | "type": "zip", | 1745 | "type": "zip", |
1693 | - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", | ||
1694 | - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", | 1746 | + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", |
1747 | + "reference": "3ab72b65b39b491e0c011e2e09bb2206c2aa8e24", | ||
1695 | "shasum": "" | 1748 | "shasum": "" |
1696 | }, | 1749 | }, |
1697 | "require": { | 1750 | "require": { |
1698 | "doctrine/instantiator": "^1.0.2", | 1751 | "doctrine/instantiator": "^1.0.2", |
1699 | - "php": ">=5.3.3", | ||
1700 | - "phpunit/php-text-template": "~1.2", | ||
1701 | - "sebastian/exporter": "~1.2" | 1752 | + "php": "^5.6 || ^7.0", |
1753 | + "phpunit/php-text-template": "^1.2", | ||
1754 | + "sebastian/exporter": "^1.2 || ^2.0" | ||
1755 | + }, | ||
1756 | + "conflict": { | ||
1757 | + "phpunit/phpunit": "<5.4.0" | ||
1702 | }, | 1758 | }, |
1703 | "require-dev": { | 1759 | "require-dev": { |
1704 | - "phpunit/phpunit": "~4.4" | 1760 | + "phpunit/phpunit": "^5.4" |
1705 | }, | 1761 | }, |
1706 | "suggest": { | 1762 | "suggest": { |
1707 | "ext-soap": "*" | 1763 | "ext-soap": "*" |
@@ -1709,7 +1765,7 @@ | @@ -1709,7 +1765,7 @@ | ||
1709 | "type": "library", | 1765 | "type": "library", |
1710 | "extra": { | 1766 | "extra": { |
1711 | "branch-alias": { | 1767 | "branch-alias": { |
1712 | - "dev-master": "2.3.x-dev" | 1768 | + "dev-master": "3.2.x-dev" |
1713 | } | 1769 | } |
1714 | }, | 1770 | }, |
1715 | "autoload": { | 1771 | "autoload": { |
@@ -1734,7 +1790,7 @@ | @@ -1734,7 +1790,7 @@ | ||
1734 | "mock", | 1790 | "mock", |
1735 | "xunit" | 1791 | "xunit" |
1736 | ], | 1792 | ], |
1737 | - "time": "2015-10-02 06:51:40" | 1793 | + "time": "2016-12-08 20:27:08" |
1738 | }, | 1794 | }, |
1739 | { | 1795 | { |
1740 | "name": "psy/psysh", | 1796 | "name": "psy/psysh", |
@@ -1809,6 +1865,51 @@ | @@ -1809,6 +1865,51 @@ | ||
1809 | "time": "2016-03-09 05:03:14" | 1865 | "time": "2016-03-09 05:03:14" |
1810 | }, | 1866 | }, |
1811 | { | 1867 | { |
1868 | + "name": "sebastian/code-unit-reverse-lookup", | ||
1869 | + "version": "1.0.1", | ||
1870 | + "source": { | ||
1871 | + "type": "git", | ||
1872 | + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", | ||
1873 | + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" | ||
1874 | + }, | ||
1875 | + "dist": { | ||
1876 | + "type": "zip", | ||
1877 | + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", | ||
1878 | + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", | ||
1879 | + "shasum": "" | ||
1880 | + }, | ||
1881 | + "require": { | ||
1882 | + "php": "^5.6 || ^7.0" | ||
1883 | + }, | ||
1884 | + "require-dev": { | ||
1885 | + "phpunit/phpunit": "^5.7 || ^6.0" | ||
1886 | + }, | ||
1887 | + "type": "library", | ||
1888 | + "extra": { | ||
1889 | + "branch-alias": { | ||
1890 | + "dev-master": "1.0.x-dev" | ||
1891 | + } | ||
1892 | + }, | ||
1893 | + "autoload": { | ||
1894 | + "classmap": [ | ||
1895 | + "src/" | ||
1896 | + ] | ||
1897 | + }, | ||
1898 | + "notification-url": "https://packagist.org/downloads/", | ||
1899 | + "license": [ | ||
1900 | + "BSD-3-Clause" | ||
1901 | + ], | ||
1902 | + "authors": [ | ||
1903 | + { | ||
1904 | + "name": "Sebastian Bergmann", | ||
1905 | + "email": "sebastian@phpunit.de" | ||
1906 | + } | ||
1907 | + ], | ||
1908 | + "description": "Looks up which function or method a line of code belongs to", | ||
1909 | + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", | ||
1910 | + "time": "2017-03-04 06:30:41" | ||
1911 | + }, | ||
1912 | + { | ||
1812 | "name": "sebastian/comparator", | 1913 | "name": "sebastian/comparator", |
1813 | "version": "1.2.4", | 1914 | "version": "1.2.4", |
1814 | "source": { | 1915 | "source": { |
@@ -1926,28 +2027,28 @@ | @@ -1926,28 +2027,28 @@ | ||
1926 | }, | 2027 | }, |
1927 | { | 2028 | { |
1928 | "name": "sebastian/environment", | 2029 | "name": "sebastian/environment", |
1929 | - "version": "1.3.8", | 2030 | + "version": "2.0.0", |
1930 | "source": { | 2031 | "source": { |
1931 | "type": "git", | 2032 | "type": "git", |
1932 | "url": "https://github.com/sebastianbergmann/environment.git", | 2033 | "url": "https://github.com/sebastianbergmann/environment.git", |
1933 | - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" | 2034 | + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" |
1934 | }, | 2035 | }, |
1935 | "dist": { | 2036 | "dist": { |
1936 | "type": "zip", | 2037 | "type": "zip", |
1937 | - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", | ||
1938 | - "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", | 2038 | + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", |
2039 | + "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", | ||
1939 | "shasum": "" | 2040 | "shasum": "" |
1940 | }, | 2041 | }, |
1941 | "require": { | 2042 | "require": { |
1942 | - "php": "^5.3.3 || ^7.0" | 2043 | + "php": "^5.6 || ^7.0" |
1943 | }, | 2044 | }, |
1944 | "require-dev": { | 2045 | "require-dev": { |
1945 | - "phpunit/phpunit": "^4.8 || ^5.0" | 2046 | + "phpunit/phpunit": "^5.0" |
1946 | }, | 2047 | }, |
1947 | "type": "library", | 2048 | "type": "library", |
1948 | "extra": { | 2049 | "extra": { |
1949 | "branch-alias": { | 2050 | "branch-alias": { |
1950 | - "dev-master": "1.3.x-dev" | 2051 | + "dev-master": "2.0.x-dev" |
1951 | } | 2052 | } |
1952 | }, | 2053 | }, |
1953 | "autoload": { | 2054 | "autoload": { |
@@ -1972,25 +2073,25 @@ | @@ -1972,25 +2073,25 @@ | ||
1972 | "environment", | 2073 | "environment", |
1973 | "hhvm" | 2074 | "hhvm" |
1974 | ], | 2075 | ], |
1975 | - "time": "2016-08-18 05:49:44" | 2076 | + "time": "2016-11-26 07:53:53" |
1976 | }, | 2077 | }, |
1977 | { | 2078 | { |
1978 | "name": "sebastian/exporter", | 2079 | "name": "sebastian/exporter", |
1979 | - "version": "1.2.2", | 2080 | + "version": "2.0.0", |
1980 | "source": { | 2081 | "source": { |
1981 | "type": "git", | 2082 | "type": "git", |
1982 | "url": "https://github.com/sebastianbergmann/exporter.git", | 2083 | "url": "https://github.com/sebastianbergmann/exporter.git", |
1983 | - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" | 2084 | + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" |
1984 | }, | 2085 | }, |
1985 | "dist": { | 2086 | "dist": { |
1986 | "type": "zip", | 2087 | "type": "zip", |
1987 | - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", | ||
1988 | - "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", | 2088 | + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", |
2089 | + "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", | ||
1989 | "shasum": "" | 2090 | "shasum": "" |
1990 | }, | 2091 | }, |
1991 | "require": { | 2092 | "require": { |
1992 | "php": ">=5.3.3", | 2093 | "php": ">=5.3.3", |
1993 | - "sebastian/recursion-context": "~1.0" | 2094 | + "sebastian/recursion-context": "~2.0" |
1994 | }, | 2095 | }, |
1995 | "require-dev": { | 2096 | "require-dev": { |
1996 | "ext-mbstring": "*", | 2097 | "ext-mbstring": "*", |
@@ -1999,7 +2100,7 @@ | @@ -1999,7 +2100,7 @@ | ||
1999 | "type": "library", | 2100 | "type": "library", |
2000 | "extra": { | 2101 | "extra": { |
2001 | "branch-alias": { | 2102 | "branch-alias": { |
2002 | - "dev-master": "1.3.x-dev" | 2103 | + "dev-master": "2.0.x-dev" |
2003 | } | 2104 | } |
2004 | }, | 2105 | }, |
2005 | "autoload": { | 2106 | "autoload": { |
@@ -2039,7 +2140,7 @@ | @@ -2039,7 +2140,7 @@ | ||
2039 | "export", | 2140 | "export", |
2040 | "exporter" | 2141 | "exporter" |
2041 | ], | 2142 | ], |
2042 | - "time": "2016-06-17 09:04:28" | 2143 | + "time": "2016-11-19 08:54:04" |
2043 | }, | 2144 | }, |
2044 | { | 2145 | { |
2045 | "name": "sebastian/global-state", | 2146 | "name": "sebastian/global-state", |
@@ -2093,17 +2194,63 @@ | @@ -2093,17 +2194,63 @@ | ||
2093 | "time": "2015-10-12 03:26:01" | 2194 | "time": "2015-10-12 03:26:01" |
2094 | }, | 2195 | }, |
2095 | { | 2196 | { |
2197 | + "name": "sebastian/object-enumerator", | ||
2198 | + "version": "2.0.1", | ||
2199 | + "source": { | ||
2200 | + "type": "git", | ||
2201 | + "url": "https://github.com/sebastianbergmann/object-enumerator.git", | ||
2202 | + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" | ||
2203 | + }, | ||
2204 | + "dist": { | ||
2205 | + "type": "zip", | ||
2206 | + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", | ||
2207 | + "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", | ||
2208 | + "shasum": "" | ||
2209 | + }, | ||
2210 | + "require": { | ||
2211 | + "php": ">=5.6", | ||
2212 | + "sebastian/recursion-context": "~2.0" | ||
2213 | + }, | ||
2214 | + "require-dev": { | ||
2215 | + "phpunit/phpunit": "~5" | ||
2216 | + }, | ||
2217 | + "type": "library", | ||
2218 | + "extra": { | ||
2219 | + "branch-alias": { | ||
2220 | + "dev-master": "2.0.x-dev" | ||
2221 | + } | ||
2222 | + }, | ||
2223 | + "autoload": { | ||
2224 | + "classmap": [ | ||
2225 | + "src/" | ||
2226 | + ] | ||
2227 | + }, | ||
2228 | + "notification-url": "https://packagist.org/downloads/", | ||
2229 | + "license": [ | ||
2230 | + "BSD-3-Clause" | ||
2231 | + ], | ||
2232 | + "authors": [ | ||
2233 | + { | ||
2234 | + "name": "Sebastian Bergmann", | ||
2235 | + "email": "sebastian@phpunit.de" | ||
2236 | + } | ||
2237 | + ], | ||
2238 | + "description": "Traverses array structures and object graphs to enumerate all referenced objects", | ||
2239 | + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", | ||
2240 | + "time": "2017-02-18 15:18:39" | ||
2241 | + }, | ||
2242 | + { | ||
2096 | "name": "sebastian/recursion-context", | 2243 | "name": "sebastian/recursion-context", |
2097 | - "version": "1.0.5", | 2244 | + "version": "2.0.0", |
2098 | "source": { | 2245 | "source": { |
2099 | "type": "git", | 2246 | "type": "git", |
2100 | "url": "https://github.com/sebastianbergmann/recursion-context.git", | 2247 | "url": "https://github.com/sebastianbergmann/recursion-context.git", |
2101 | - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" | 2248 | + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" |
2102 | }, | 2249 | }, |
2103 | "dist": { | 2250 | "dist": { |
2104 | "type": "zip", | 2251 | "type": "zip", |
2105 | - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", | ||
2106 | - "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", | 2252 | + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", |
2253 | + "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", | ||
2107 | "shasum": "" | 2254 | "shasum": "" |
2108 | }, | 2255 | }, |
2109 | "require": { | 2256 | "require": { |
@@ -2115,7 +2262,7 @@ | @@ -2115,7 +2262,7 @@ | ||
2115 | "type": "library", | 2262 | "type": "library", |
2116 | "extra": { | 2263 | "extra": { |
2117 | "branch-alias": { | 2264 | "branch-alias": { |
2118 | - "dev-master": "1.0.x-dev" | 2265 | + "dev-master": "2.0.x-dev" |
2119 | } | 2266 | } |
2120 | }, | 2267 | }, |
2121 | "autoload": { | 2268 | "autoload": { |
@@ -2143,23 +2290,73 @@ | @@ -2143,23 +2290,73 @@ | ||
2143 | ], | 2290 | ], |
2144 | "description": "Provides functionality to recursively process PHP variables", | 2291 | "description": "Provides functionality to recursively process PHP variables", |
2145 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", | 2292 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", |
2146 | - "time": "2016-10-03 07:41:43" | 2293 | + "time": "2016-11-19 07:33:16" |
2294 | + }, | ||
2295 | + { | ||
2296 | + "name": "sebastian/resource-operations", | ||
2297 | + "version": "1.0.0", | ||
2298 | + "source": { | ||
2299 | + "type": "git", | ||
2300 | + "url": "https://github.com/sebastianbergmann/resource-operations.git", | ||
2301 | + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" | ||
2302 | + }, | ||
2303 | + "dist": { | ||
2304 | + "type": "zip", | ||
2305 | + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", | ||
2306 | + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", | ||
2307 | + "shasum": "" | ||
2308 | + }, | ||
2309 | + "require": { | ||
2310 | + "php": ">=5.6.0" | ||
2311 | + }, | ||
2312 | + "type": "library", | ||
2313 | + "extra": { | ||
2314 | + "branch-alias": { | ||
2315 | + "dev-master": "1.0.x-dev" | ||
2316 | + } | ||
2317 | + }, | ||
2318 | + "autoload": { | ||
2319 | + "classmap": [ | ||
2320 | + "src/" | ||
2321 | + ] | ||
2322 | + }, | ||
2323 | + "notification-url": "https://packagist.org/downloads/", | ||
2324 | + "license": [ | ||
2325 | + "BSD-3-Clause" | ||
2326 | + ], | ||
2327 | + "authors": [ | ||
2328 | + { | ||
2329 | + "name": "Sebastian Bergmann", | ||
2330 | + "email": "sebastian@phpunit.de" | ||
2331 | + } | ||
2332 | + ], | ||
2333 | + "description": "Provides a list of PHP built-in functions that operate on resources", | ||
2334 | + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", | ||
2335 | + "time": "2015-07-28 20:34:47" | ||
2147 | }, | 2336 | }, |
2148 | { | 2337 | { |
2149 | "name": "sebastian/version", | 2338 | "name": "sebastian/version", |
2150 | - "version": "1.0.6", | 2339 | + "version": "2.0.1", |
2151 | "source": { | 2340 | "source": { |
2152 | "type": "git", | 2341 | "type": "git", |
2153 | "url": "https://github.com/sebastianbergmann/version.git", | 2342 | "url": "https://github.com/sebastianbergmann/version.git", |
2154 | - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" | 2343 | + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" |
2155 | }, | 2344 | }, |
2156 | "dist": { | 2345 | "dist": { |
2157 | "type": "zip", | 2346 | "type": "zip", |
2158 | - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", | ||
2159 | - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", | 2347 | + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", |
2348 | + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", | ||
2160 | "shasum": "" | 2349 | "shasum": "" |
2161 | }, | 2350 | }, |
2351 | + "require": { | ||
2352 | + "php": ">=5.6" | ||
2353 | + }, | ||
2162 | "type": "library", | 2354 | "type": "library", |
2355 | + "extra": { | ||
2356 | + "branch-alias": { | ||
2357 | + "dev-master": "2.0.x-dev" | ||
2358 | + } | ||
2359 | + }, | ||
2163 | "autoload": { | 2360 | "autoload": { |
2164 | "classmap": [ | 2361 | "classmap": [ |
2165 | "src/" | 2362 | "src/" |
@@ -2178,7 +2375,7 @@ | @@ -2178,7 +2375,7 @@ | ||
2178 | ], | 2375 | ], |
2179 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", | 2376 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", |
2180 | "homepage": "https://github.com/sebastianbergmann/version", | 2377 | "homepage": "https://github.com/sebastianbergmann/version", |
2181 | - "time": "2015-06-21 13:59:46" | 2378 | + "time": "2016-10-03 07:35:21" |
2182 | }, | 2379 | }, |
2183 | { | 2380 | { |
2184 | "name": "symfony/var-dumper", | 2381 | "name": "symfony/var-dumper", |
database/labinvent_2.1_12-05-16.sql
@@ -345,7 +345,7 @@ CREATE TABLE IF NOT EXISTS `configurations` ( | @@ -345,7 +345,7 @@ CREATE TABLE IF NOT EXISTS `configurations` ( | ||
345 | `hasPrinter` tinyint(1) DEFAULT NULL, | 345 | `hasPrinter` tinyint(1) DEFAULT NULL, |
346 | `nom_groupe_thematique` varchar(50) DEFAULT 'Groupe thematique', | 346 | `nom_groupe_thematique` varchar(50) DEFAULT 'Groupe thematique', |
347 | `nom_groupe_metier` varchar(50) DEFAULT 'Groupe metier', | 347 | `nom_groupe_metier` varchar(50) DEFAULT 'Groupe metier', |
348 | - `envoi_mail_management_dev` tinyint(1) DEFAULT NULL, | 348 | + `envoi_mail_management_dev` tinyint(1) NOT NULL DEFAULT 1, |
349 | `sender_mail` varchar(500) DEFAULT 'labinvent@irap.omp.eu', | 349 | `sender_mail` varchar(500) DEFAULT 'labinvent@irap.omp.eu', |
350 | `emailGuest1` varchar(45) DEFAULT NULL, | 350 | `emailGuest1` varchar(45) DEFAULT NULL, |
351 | `emailGuest2` varchar(45) DEFAULT NULL, | 351 | `emailGuest2` varchar(45) DEFAULT NULL, |
@@ -362,6 +362,7 @@ CREATE TABLE IF NOT EXISTS `configurations` ( | @@ -362,6 +362,7 @@ CREATE TABLE IF NOT EXISTS `configurations` ( | ||
362 | `numero_labo_sans_annee` tinyint(1) DEFAULT NULL, | 362 | `numero_labo_sans_annee` tinyint(1) DEFAULT NULL, |
363 | `date_commande_facultative` tinyint(1) DEFAULT NULL, | 363 | `date_commande_facultative` tinyint(1) DEFAULT NULL, |
364 | `taille_max_doc` int (15) DEFAULT '8000000', | 364 | `taille_max_doc` int (15) DEFAULT '8000000', |
365 | + `aff_par_defaut` smallint(6) NOT NULL DEFAULT 20, | ||
365 | PRIMARY KEY (`id`), | 366 | PRIMARY KEY (`id`), |
366 | UNIQUE KEY `nom_UNIQUE` (`nom`) | 367 | UNIQUE KEY `nom_UNIQUE` (`nom`) |
367 | ); | 368 | ); |
@@ -446,7 +447,42 @@ Insert into type_documents(nom) values ('Certificat de conformité'); | @@ -446,7 +447,42 @@ Insert into type_documents(nom) values ('Certificat de conformité'); | ||
446 | Insert into type_documents(nom) values ('Manuel d\'utilisation'); | 447 | Insert into type_documents(nom) values ('Manuel d\'utilisation'); |
447 | 448 | ||
448 | -- Insertion par défaut pour la table configuration | 449 | -- Insertion par défaut pour la table configuration |
449 | -Insert into `configurations`(`nom`, `mode_install`, `mode_debug`, `use_ldap`, `host_ldap`, `port_ldap`, `authentificationType_ldap`, `baseDn_ldap`, `filter_ldap`, `labName`, `labNameShort`, `labPresent`, `labUmr`, `hasPrinter`, `emailGuest1`, `emailGuest2`, `emailGuest3`) values ('default', '1', '0', '0', '', '', 'xxx', '', '', 'LABONAME', 'LABO', 'du ', '', '0', '', '', ''); | 450 | +Insert into `configurations`( |
451 | +`nom`, | ||
452 | +`mode_install`, | ||
453 | +`mode_debug`, | ||
454 | +`use_ldap`, | ||
455 | +`host_ldap`, | ||
456 | +`port_ldap`, | ||
457 | +`authentificationType_ldap`, | ||
458 | +`baseDn_ldap`, | ||
459 | +`filter_ldap`, | ||
460 | +`labName`, | ||
461 | +`labNameShort`, | ||
462 | +`labPresent`, | ||
463 | +`labUmr`, | ||
464 | +`hasPrinter`, | ||
465 | +`emailGuest1`, | ||
466 | +`emailGuest2`, | ||
467 | +`emailGuest3`) | ||
468 | +values ( | ||
469 | +'default', | ||
470 | +'1', | ||
471 | +'0', | ||
472 | +'0', | ||
473 | +'', | ||
474 | +'', | ||
475 | +'xxx', | ||
476 | +'', | ||
477 | +'', | ||
478 | +'LABONAME', | ||
479 | +'LABO', | ||
480 | +'du ', | ||
481 | +'', | ||
482 | +'0', | ||
483 | +'', | ||
484 | +'', | ||
485 | +''); | ||
450 | 486 | ||
451 | 487 | ||
452 | 488 |
database/update/script_sql/db-update-2017-04-25.sql
src/Controller/AppController.php
@@ -180,9 +180,11 @@ class AppController extends Controller | @@ -180,9 +180,11 @@ class AppController extends Controller | ||
180 | $this->set('idGmNa', TableRegistry::get('GroupesMetiers')->find()->where(['nom =' => 'N/A'])->first()['id']); | 180 | $this->set('idGmNa', TableRegistry::get('GroupesMetiers')->find()->where(['nom =' => 'N/A'])->first()['id']); |
181 | $this->set('idGtNa', TableRegistry::get('GroupesThematiques')->find()->where(['nom =' => 'N/A'])->first()['id']); | 181 | $this->set('idGtNa', TableRegistry::get('GroupesThematiques')->find()->where(['nom =' => 'N/A'])->first()['id']); |
182 | 182 | ||
183 | - $displayElement = function ($nom, $valeur) { | 183 | + $displayElement = function ($nom, $valeur, $params="") { |
184 | + $balise = ($params != "") ? '<td '.$params.'>' : '<td>'; | ||
185 | + // Ca c'est parce que sinon y'a au moins deux tests qui passent pas, a cause de l'espace dans la balise ... | ||
184 | if ($valeur != "") | 186 | if ($valeur != "") |
185 | - echo '<tr><td><strong>'.$nom.' </strong></td><td>'.$valeur.'</td></tr>'; | 187 | + echo '<tr><td><strong>'.$nom.' </strong></td>'.$balise.$valeur.'</td></tr>'; |
186 | }; | 188 | }; |
187 | $this->set('displayElement', $displayElement); | 189 | $this->set('displayElement', $displayElement); |
188 | 190 | ||
@@ -198,39 +200,39 @@ class AppController extends Controller | @@ -198,39 +200,39 @@ class AppController extends Controller | ||
198 | * @param string $message | 200 | * @param string $message |
199 | * @param string[] $to | 201 | * @param string[] $to |
200 | */ | 202 | */ |
201 | - public function sendEmailTo($subject, $message, $to = null) { | 203 | +// public function sendEmailTo($subject, $message, $to = null) { |
202 | 204 | ||
203 | - $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); | 205 | +// $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); |
204 | 206 | ||
205 | - if ($to != null && !$configuration->test) { | 207 | +// if ($to != null && !$configuration->test) { |
206 | 208 | ||
207 | - for($i = 0; $i < sizeof($to); $i++) { | 209 | +// for($i = 0; $i < sizeof($to); $i++) { |
208 | 210 | ||
209 | 211 | ||
210 | - if (filter_var($to[$i], FILTER_VALIDATE_EMAIL)) { | ||
211 | - $email = new Email(); | 212 | +// if (filter_var($to[$i], FILTER_VALIDATE_EMAIL)) { |
213 | +// $email = new Email(); | ||
212 | 214 | ||
213 | - $etiquetteFrom = explode("@", $configuration->sender_mail); | 215 | +// $etiquetteFrom = explode("@", $configuration->sender_mail); |
214 | 216 | ||
215 | - if($configuration->envoi_mail_management_dev) { | ||
216 | - $email->transport('dev') | ||
217 | - ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
218 | - ->to($to[$i]) | ||
219 | - ->subject("[LabInvent] ".$subject) | ||
220 | - ->send($message); | ||
221 | - } else { | ||
222 | - $email->transport('default') | ||
223 | - ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
224 | - ->to($to[$i]) | ||
225 | - ->subject("[LabInvent] ".$subject) | ||
226 | - ->send($message); | ||
227 | - } | ||
228 | - } | 217 | +// if($configuration->envoi_mail_management_dev) { |
218 | +// $email->transport('dev') | ||
219 | +// ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
220 | +// ->to($to[$i]) | ||
221 | +// ->subject("[LabInvent] ".$subject) | ||
222 | +// ->send($message); | ||
223 | +// } else { | ||
224 | +// $email->transport('default') | ||
225 | +// ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
226 | +// ->to($to[$i]) | ||
227 | +// ->subject("[LabInvent] ".$subject) | ||
228 | +// ->send($message); | ||
229 | +// } | ||
230 | +// } | ||
229 | 231 | ||
230 | - } | ||
231 | - } | 232 | +// } |
233 | +// } | ||
232 | 234 | ||
233 | - } | 235 | +// } |
234 | 236 | ||
235 | /** | 237 | /** |
236 | * Envoi d'un email à la gestion (et aux devs) pour prévenir qu'un matériel a été créé ou modifié | 238 | * Envoi d'un email à la gestion (et aux devs) pour prévenir qu'un matériel a été créé ou modifié |
@@ -238,163 +240,319 @@ class AppController extends Controller | @@ -238,163 +240,319 @@ class AppController extends Controller | ||
238 | * @param string $subject | 240 | * @param string $subject |
239 | * @param string $message | 241 | * @param string $message |
240 | */ | 242 | */ |
241 | - public function sendEmailToManagementWith($subject, $message) { | 243 | +// public function sendEmailToManagementWith($subject, $message) { |
242 | 244 | ||
243 | - $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); | 245 | +// $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); |
244 | 246 | ||
245 | - for($i = 1; $i < 11; $i++) { | ||
246 | - $t = 'emailGuest'.$i; | ||
247 | - $to = $configuration->$t; | 247 | +// for($i = 1; $i < 11; $i++) { |
248 | +// $t = 'emailGuest'.$i; | ||
249 | +// $to = $configuration->$t; | ||
248 | 250 | ||
249 | - if ($to != null && !$configuration->test) { | ||
250 | - if (filter_var($to, FILTER_VALIDATE_EMAIL)) { | ||
251 | - $email = new Email(); | 251 | +// if ($to != null && !$configuration->test) { |
252 | +// if (filter_var($to, FILTER_VALIDATE_EMAIL)) { | ||
253 | +// $email = new Email(); | ||
252 | 254 | ||
253 | - $etiquetteFrom = explode("@", $configuration->sender_mail); | 255 | +// $etiquetteFrom = explode("@", $configuration->sender_mail); |
254 | 256 | ||
255 | - if($configuration->envoi_mail_management_dev) { | ||
256 | - $email->transport('dev') | ||
257 | - ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
258 | - ->to($to) | ||
259 | - ->subject("[LabInvent] ".$subject) | ||
260 | - ->send($message); | ||
261 | - } else { | ||
262 | - $email->transport('default') | ||
263 | - ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
264 | - ->to($to) | ||
265 | - ->subject("[LabInvent] ".$subject) | ||
266 | - ->send($message); | ||
267 | - } | ||
268 | - } | 257 | +// if($configuration->envoi_mail_management_dev) { |
258 | +// $email->transport('dev') | ||
259 | +// ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
260 | +// ->to($to) | ||
261 | +// ->subject("[LabInvent] ".$subject) | ||
262 | +// ->send($message); | ||
263 | +// } else { | ||
264 | +// $email->transport('default') | ||
265 | +// ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
266 | +// ->to($to) | ||
267 | +// ->subject("[LabInvent] ".$subject) | ||
268 | +// ->send($message); | ||
269 | +// } | ||
270 | +// } | ||
269 | 271 | ||
270 | - } | ||
271 | - } | 272 | +// } |
273 | +// } | ||
272 | 274 | ||
273 | - } | ||
274 | - public function sendEmailToManagement($idObj = null) { | 275 | +// } |
275 | 276 | ||
276 | - $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); | 277 | +// public function sendEmailToManagement($idObj = null) { |
278 | + | ||
279 | +// $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); | ||
277 | 280 | ||
278 | - $userAuth = $this->LdapAuth->user($configuration->authentificationType_ldap)[0]; | ||
279 | - $controller = substr($this->request->params['controller'], 0, -1); // materiel | ||
280 | - $action = $this->request->params['action']; // add or edit or delete or ... | ||
281 | - $userName = $this->LdapAuth->user('sn')[0].' '.$this->LdapAuth->user('givenname')[0]; | ||
282 | - $userEmail = $this->LdapAuth->user('mail')[0]; | ||
283 | - $role = TableRegistry::get('Users')->find()->where(['username' => $this->LdapAuth->user($configuration->authentificationType_ldap)[0]])->first()['role']; | ||
284 | - if($role == null) $role = 'Utilisateur'; | 281 | +// $userAuth = $this->LdapAuth->user($configuration->authentificationType_ldap)[0]; |
282 | +// $controller = substr($this->request->params['controller'], 0, -1); // materiel | ||
283 | +// $action = $this->request->params['action']; // add or edit or delete or ... | ||
284 | +// $userName = $this->LdapAuth->user('sn')[0].' '.$this->LdapAuth->user('givenname')[0]; | ||
285 | +// $userEmail = $this->LdapAuth->user('mail')[0]; | ||
286 | +// $role = TableRegistry::get('Users')->find()->where(['username' => $this->LdapAuth->user($configuration->authentificationType_ldap)[0]])->first()['role']; | ||
287 | +// if($role == null) $role = 'Utilisateur'; | ||
285 | 288 | ||
286 | - $modelName = $this->modelClass; // 'Materiels' | ||
287 | - $id = $idObj; | 289 | +// $modelName = $this->modelClass; // 'Materiels' |
290 | +// $id = $idObj; | ||
288 | 291 | ||
289 | - switch ($action) { | ||
290 | - case 'add': | ||
291 | - $actionFrench = ['Création d\'un ', 'été créé']; | ||
292 | - break; | ||
293 | - case 'edit': | ||
294 | - $actionFrench = ['Modification d\'un ', 'été modifié']; | ||
295 | - break; | ||
296 | - case 'delete': | ||
297 | - $actionFrench = ['Suppression d\'un ', 'été supprimé']; | ||
298 | - break; | ||
299 | - case 'statusValidated': | ||
300 | - $actionFrench = ['Validation d\'un ', 'été validé']; | ||
301 | - break; | ||
302 | - case 'statusToBeArchived': | ||
303 | - $actionFrench = ['Demande Archivage d\'un ', 'été demandé pour archivage']; | ||
304 | - break; | ||
305 | - case 'statusArchived': | ||
306 | - $actionFrench = ['Archivage d\'un ', 'été archivé']; | ||
307 | - break; | ||
308 | - case 'setLabelIsPlaced': | ||
309 | - $actionFrench = ['Etiquette posé sur un ', 'reçu une étiquette']; | ||
310 | - break; | ||
311 | - default: | ||
312 | - $actionFrench = [$action.' d\'un ', 'été '.$action]; | ||
313 | - break; | ||
314 | - } | ||
315 | - $doneBy = $userName." (".$userEmail.", login=".$userAuth.", profil=".$role.")."; | 292 | +// switch ($action) { |
293 | +// case 'add': | ||
294 | +// $actionFrench = ['Création d\'un ', 'été créé']; | ||
295 | +// break; | ||
296 | +// case 'edit': | ||
297 | +// $actionFrench = ['Modification d\'un ', 'été modifié']; | ||
298 | +// break; | ||
299 | +// case 'delete': | ||
300 | +// $actionFrench = ['Suppression d\'un ', 'été supprimé']; | ||
301 | +// break; | ||
302 | +// case 'statusValidated': | ||
303 | +// $actionFrench = ['Validation d\'un ', 'été validé']; | ||
304 | +// break; | ||
305 | +// case 'statusToBeArchived': | ||
306 | +// $actionFrench = ['Demande Archivage d\'un ', 'été demandé pour archivage']; | ||
307 | +// break; | ||
308 | +// case 'statusArchived': | ||
309 | +// $actionFrench = ['Archivage d\'un ', 'été archivé']; | ||
310 | +// break; | ||
311 | +// case 'setLabelIsPlaced': | ||
312 | +// $actionFrench = ['Etiquette posé sur un ', 'reçu une étiquette']; | ||
313 | +// break; | ||
314 | +// default: | ||
315 | +// $actionFrench = [$action.' d\'un ', 'été '.$action]; | ||
316 | +// break; | ||
317 | +// } | ||
318 | +// $doneBy = $userName." (".$userEmail.", login=".$userAuth.", profil=".$role.")."; | ||
316 | 319 | ||
317 | - $subject = $actionFrench[0].$controller; | 320 | +// $subject = $actionFrench[0].$controller; |
318 | 321 | ||
319 | - if($id != null) { | ||
320 | - $entityName = TableRegistry::get($modelName)->find('all')->where(['id =' => $id])->first(); | 322 | +// if($id != null) { |
323 | +// $entityName = TableRegistry::get($modelName)->find('all')->where(['id =' => $id])->first(); | ||
321 | 324 | ||
322 | - if($modelName == 'Materiels') { | ||
323 | - $entityName = $entityName['designation']; | ||
324 | - } | ||
325 | - else if ($modelName == 'Suivis' || $modelName == 'Emprunts') { | ||
326 | - $entityName = $entityName['id']; | ||
327 | - } | ||
328 | - else { | ||
329 | - $entityName = $entityName['nom']; | ||
330 | - } | ||
331 | - } | ||
332 | - else { | ||
333 | - $entityName = NULL; | ||
334 | - } | 325 | +// if($modelName == 'Materiels') { |
326 | +// $entityName = $entityName['designation']; | ||
327 | +// } | ||
328 | +// else if ($modelName == 'Suivis' || $modelName == 'Emprunts') { | ||
329 | +// $entityName = $entityName['id']; | ||
330 | +// } | ||
331 | +// else { | ||
332 | +// $entityName = $entityName['nom']; | ||
333 | +// } | ||
334 | +// } | ||
335 | +// else { | ||
336 | +// $entityName = NULL; | ||
337 | +// } | ||
335 | 338 | ||
336 | - $message = $this->getArticle().$controller." ".$entityName." (id=".$id.") a ".$actionFrench[1]." par ".$doneBy; | 339 | +// $message = $this->getArticle().$controller." ".$entityName." (id=".$id.") a ".$actionFrench[1]." par ".$doneBy; |
337 | 340 | ||
338 | - $this->sendEmailToManagementWith($subject, $message); | 341 | +// $this->sendEmailToManagementWith($subject, $message); |
339 | 342 | ||
340 | - } | 343 | +// } |
341 | 344 | ||
342 | /** | 345 | /** |
343 | * Envoi d'un email au propriétaire pour prévenir qu'un matériel a été créé | 346 | * Envoi d'un email au propriétaire pour prévenir qu'un matériel a été créé |
344 | * @param string $subject | 347 | * @param string $subject |
345 | * @param string $message | 348 | * @param string $message |
346 | */ | 349 | */ |
347 | - public function sendEmailToCreate($idObj = null) { | 350 | +// public function sendEmailToCreate($idObj = null) { |
348 | 351 | ||
349 | - $id = $idObj; | 352 | +// $id = $idObj; |
353 | + | ||
354 | +// $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); | ||
355 | +// $materiel = TableRegistry::get('Materiels')->find()->where(['id =' => $id])->first(); | ||
356 | + | ||
357 | +// $createurName = $this->LdapAuth->user('sn')[0].' '.$this->LdapAuth->user('givenname')[0]; | ||
358 | +// $createurEmail = $this->LdapAuth->user('mail')[0]; | ||
359 | +// $toEmail = $materiel->email_responsable; | ||
360 | + | ||
361 | +// $role = TableRegistry::get('Users')->find()->where(['username' => $this->LdapAuth->user($configuration->authentificationType_ldap)[0]])->first()['role']; | ||
362 | +// if($role == null) $role = 'Utilisateur'; | ||
363 | + | ||
364 | +// $subject = 'Ajout d\'un matériel'; | ||
365 | +// $message = $createurName.' (email = '.$createurEmail.', role = '.$role.') a ajouté le matériel "'.$materiel->designation.'" ('.$materiel->numero_laboratoire.') et vous a nommé propriétaire de ce matériel.'; | ||
366 | + | ||
367 | +// if ($toEmail != null && !$configuration->test) { | ||
368 | +// if (filter_var($toEmail, FILTER_VALIDATE_EMAIL)) { | ||
369 | +// $email = new Email(); | ||
370 | + | ||
371 | +// $etiquetteFrom = explode("@", $configuration->sender_mail); | ||
372 | + | ||
373 | +// if($configuration->envoi_mail_management_dev) { | ||
374 | +// $email->transport('dev') | ||
375 | +// ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
376 | +// ->to($toEmail) | ||
377 | +// ->subject("[LabInvent] ".$subject) | ||
378 | +// ->send($message); | ||
379 | +// } else { | ||
380 | +// $email->transport('default') | ||
381 | +// ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
382 | +// ->to($toEmail) | ||
383 | +// ->subject("[LabInvent] ".$subject) | ||
384 | +// ->send($message); | ||
385 | +// } | ||
386 | +// } | ||
387 | + | ||
388 | +// } | ||
389 | + | ||
390 | +// } | ||
391 | + | ||
392 | + | ||
393 | + static function isLabinventDebugMode() { | ||
394 | + return TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first()->mode_debug; | ||
395 | + } | ||
396 | + function myDebug($arg, $stop=false) { | ||
397 | + if ($this->isLabinventDebugMode()) { | ||
398 | + Configure::write('debug', true); | ||
399 | + debug($arg); | ||
400 | + if ($stop) exit; | ||
401 | + } | ||
402 | + } | ||
403 | + | ||
404 | + /** | ||
405 | + * Envoie un mail avec un sujet, contenant un message à destination d'une liste de mails, selon l'action effectuée. | ||
406 | + * @param string $subject -> Sujet du mail | ||
407 | + * @param string $msg -> Message à envoyer | ||
408 | + * @param array $listMails -> Liste des mails des destinataires | ||
409 | + * @param id $idObj -> ID du matériel créé, modifié, supprimé ... | ||
410 | + */ | ||
411 | + public function sendEmail($subject, $msg, $listMails, $idObj = null) { | ||
350 | 412 | ||
351 | $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); | 413 | $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); |
352 | - $materiel = TableRegistry::get('Materiels')->find()->where(['id =' => $id])->first(); | ||
353 | 414 | ||
354 | - $createurName = $this->LdapAuth->user('sn')[0].' '.$this->LdapAuth->user('givenname')[0]; | ||
355 | - $createurEmail = $this->LdapAuth->user('mail')[0]; | ||
356 | - $toEmail = $materiel->email_responsable; | 415 | + //if(!$configuration['envoi_mail_management_dev']) { |
416 | + foreach($listMails as $mail){ | ||
417 | + $mailInTable = TableRegistry::get('Users')->find()->select('email')->where(['email =' => $mail])->first(); | ||
418 | + if ($mailInTable!= null) { // Tous les utilisateurs privilégiés, si le mode LDAP est activé, sinon tout le monde | ||
419 | + $roleInTable = TableRegistry::get('Users')->find()->select('role')->where(['email =' => $mail])->first(); | ||
420 | + Switch ($roleInTable){ | ||
421 | + case 'Super Administrateur': | ||
422 | + $this->sendEmailToSuperAdmin($subject, $msg, $mail, $idObj, $configuration); | ||
423 | + break; | ||
424 | + case 'Administration Plus': | ||
425 | + // Role useless, mais il existe dans BD ... | ||
426 | + break; | ||
427 | + case 'Administration': | ||
428 | + $this->sendEmailToManagement($subject, $msg, $mail, $idObj, $configuration); | ||
429 | + break; | ||
430 | + case 'Responsable': | ||
431 | + $this->sendEmailToResponsable($subject, $msg, $mail, $idObj, $configuration); | ||
432 | + break; | ||
433 | + case 'Utilisateur': | ||
434 | + $this->sendEmailToUser($subject, $msg, $mail, $idObj, $configuration); | ||
435 | + break; | ||
436 | + default : | ||
437 | + break; | ||
438 | + } | ||
439 | + } else { // Si on utilise le LDAP, les seuls utilisateurs qui ne sont pas dans la BD du site sont les utilisateurs normaux | ||
440 | + $this->sendEmailToUser($subject, $msg, $mail, $idObj, $configuration); // <-- | ||
441 | + } | ||
442 | + } | ||
443 | + //} | ||
357 | 444 | ||
358 | - $role = TableRegistry::get('Users')->find()->where(['username' => $this->LdapAuth->user($configuration->authentificationType_ldap)[0]])->first()['role']; | ||
359 | - if($role == null) $role = 'Utilisateur'; | 445 | + } |
446 | + | ||
447 | + private function sendEmailToResponsable($subject, $msg, $mail, $idObj = null, $config) { | ||
360 | 448 | ||
361 | - $subject = 'Ajout d\'un matériel'; | ||
362 | - $message = $createurName.' (email = '.$createurEmail.', role = '.$role.') a ajouté le matériel "'.$materiel->designation.'" ('.$materiel->numero_laboratoire.') et vous a nommé propriétaire de ce matériel.'; | 449 | + // Rajouter la vérif sur la colone adéquate de la bd |
363 | 450 | ||
364 | - if ($toEmail != null && !$configuration->test) { | ||
365 | - if (filter_var($toEmail, FILTER_VALIDATE_EMAIL)) { | 451 | + if ($mail != null && !$config->test && false) { // flase à remplacer |
452 | + if (filter_var($mail, FILTER_VALIDATE_EMAIL)) { | ||
366 | $email = new Email(); | 453 | $email = new Email(); |
367 | 454 | ||
368 | - $etiquetteFrom = explode("@", $configuration->sender_mail); | 455 | + $etiquetteFrom = explode("@", $config->sender_mail); |
369 | 456 | ||
370 | - if($configuration->envoi_mail_management_dev) { | 457 | + if($config->envoi_mail_management_dev) { // <-- Si la case est cochée |
371 | $email->transport('dev') | 458 | $email->transport('dev') |
372 | - ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
373 | - ->to($toEmail) | 459 | + ->from([$config->sender_mail => $etiquetteFrom[0]]) |
460 | + ->to($mail) | ||
374 | ->subject("[LabInvent] ".$subject) | 461 | ->subject("[LabInvent] ".$subject) |
375 | - ->send($message); | ||
376 | - } else { | 462 | + ->send($msg); |
463 | + } else { // <-- Si la case n'est pas cochée | ||
377 | $email->transport('default') | 464 | $email->transport('default') |
378 | - ->from([$configuration->sender_mail => $etiquetteFrom[0]]) | ||
379 | - ->to($toEmail) | 465 | + ->from([$config->sender_mail => $etiquetteFrom[0]]) |
466 | + ->to($mail) | ||
380 | ->subject("[LabInvent] ".$subject) | 467 | ->subject("[LabInvent] ".$subject) |
381 | - ->send($message); | 468 | + ->send($msg); |
382 | } | 469 | } |
383 | } | 470 | } |
384 | - | 471 | + |
385 | } | 472 | } |
386 | - | ||
387 | } | 473 | } |
388 | 474 | ||
475 | + private function sendEmailToUser($subject, $msg, $mail, $idObj = null, $config) { | ||
476 | + | ||
477 | + // Rajouter la vérif sur la colone adéquate de la bd | ||
478 | + var_dump($mail); | ||
479 | + if ($mail != null && !$config->test && true) { // flase à remplacer | ||
480 | + if (filter_var($mail, FILTER_VALIDATE_EMAIL)) { | ||
481 | + $email = new Email(); | ||
482 | + | ||
483 | + $etiquetteFrom = explode("@", $config->sender_mail); | ||
484 | + | ||
485 | + if($config->envoi_mail_management_dev) { | ||
486 | + $email->transport('dev') | ||
487 | + ->from([$config->sender_mail => $etiquetteFrom[0]]) | ||
488 | + ->to($mail) | ||
489 | + ->subject("[LabInvent] ".$subject) | ||
490 | + ->send($msg); | ||
491 | + } else { | ||
492 | + $email->transport('default') | ||
493 | + ->from([$config->sender_mail => $etiquetteFrom[0]]) | ||
494 | + ->to($mail) | ||
495 | + ->subject("[LabInvent] ".$subject) | ||
496 | + ->send($msg); | ||
497 | + } | ||
498 | + } | ||
499 | + | ||
500 | + } | ||
501 | + } | ||
389 | 502 | ||
390 | - static function isLabinventDebugMode() { | ||
391 | - return TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first()->mode_debug; | 503 | + private function sendEmailToSuperAdmin($subject, $msg, $mail, $idObj = null, $config) { |
504 | + | ||
505 | + // Rajouter la vérif sur la colone adéquate de la bd | ||
506 | + | ||
507 | + if ($mail != null && !$config->test && false) { // flase à remplacer | ||
508 | + if (filter_var($mail, FILTER_VALIDATE_EMAIL)) { | ||
509 | + $email = new Email(); | ||
510 | + | ||
511 | + $etiquetteFrom = explode("@", $config->sender_mail); | ||
512 | + | ||
513 | + if($config->envoi_mail_management_dev) { | ||
514 | + $email->transport('dev') | ||
515 | + ->from([$config->sender_mail => $etiquetteFrom[0]]) | ||
516 | + ->to($mail) | ||
517 | + ->subject("[LabInvent] ".$subject) | ||
518 | + ->send($msg); | ||
519 | + } else { | ||
520 | + $email->transport('default') | ||
521 | + ->from([$config->sender_mail => $etiquetteFrom[0]]) | ||
522 | + ->to($mail) | ||
523 | + ->subject("[LabInvent] ".$subject) | ||
524 | + ->send($msg); | ||
525 | + } | ||
526 | + } | ||
527 | + | ||
528 | + } | ||
392 | } | 529 | } |
393 | - function myDebug($arg, $stop=false) { | ||
394 | - if ($this->isLabinventDebugMode()) { | ||
395 | - Configure::write('debug', true); | ||
396 | - debug($arg); | ||
397 | - if ($stop) exit; | 530 | + |
531 | + private function sendEmailToManagement($subject, $msg, $mail, $idObj = null, $config) { | ||
532 | + | ||
533 | + // Rajouter la vérif sur la colone adéquate de la bd | ||
534 | + | ||
535 | + if ($mail != null && !$config->test && false) { // flase à remplacer | ||
536 | + if (filter_var($mail, FILTER_VALIDATE_EMAIL)) { | ||
537 | + $email = new Email(); | ||
538 | + | ||
539 | + $etiquetteFrom = explode("@", $config->sender_mail); | ||
540 | + | ||
541 | + if($config->envoi_mail_management_dev) { | ||
542 | + $email->transport('dev') | ||
543 | + ->from([$config->sender_mail => $etiquetteFrom[0]]) | ||
544 | + ->to($mail) | ||
545 | + ->subject("[LabInvent] ".$subject) | ||
546 | + ->send($msg); | ||
547 | + } else { | ||
548 | + $email->transport('default') | ||
549 | + ->from([$config->sender_mail => $etiquetteFrom[0]]) | ||
550 | + ->to($mail) | ||
551 | + ->subject("[LabInvent] ".$subject) | ||
552 | + ->send($msg); | ||
553 | + } | ||
554 | + } | ||
555 | + | ||
398 | } | 556 | } |
399 | } | 557 | } |
400 | 558 |
src/Controller/MaterielsController.php
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | namespace App\Controller; | 2 | namespace App\Controller; |
3 | 3 | ||
4 | use App\Controller\AppController; | 4 | use App\Controller\AppController; |
5 | +use Cake\Core\Configure; | ||
5 | use Cake\ORM\TableRegistry; | 6 | use Cake\ORM\TableRegistry; |
6 | use Cake\Mailer\Email; | 7 | use Cake\Mailer\Email; |
7 | 8 | ||
@@ -171,10 +172,12 @@ class MaterielsController extends AppController | @@ -171,10 +172,12 @@ class MaterielsController extends AppController | ||
171 | */ | 172 | */ |
172 | public function index() | 173 | public function index() |
173 | { | 174 | { |
175 | + // Remplacement de $this->passedArgs[0] (deprecated) | ||
176 | + // Par $this->request->params['pass'][0] | ||
174 | $condition = ''; | 177 | $condition = ''; |
175 | - if (isset($this->passedArgs[0])) { | ||
176 | - $condition = ['Materiels.status =' => $this->passedArgs[0]]; | ||
177 | - $this->set('STATUS', $this->passedArgs[0]); | 178 | + if (isset($this->request->params['pass'][0])) { |
179 | + $condition = ['Materiels.status =' => $this->request->params['pass'][0]]; | ||
180 | + $this->set('STATUS', $this->request->params['pass'][0]); | ||
178 | } | 181 | } |
179 | 182 | ||
180 | $GM = $this->request->query('GM'); | 183 | $GM = $this->request->query('GM'); |
@@ -282,40 +285,43 @@ class MaterielsController extends AppController | @@ -282,40 +285,43 @@ class MaterielsController extends AppController | ||
282 | if ($this->Materiels->save($materiel)) { | 285 | if ($this->Materiels->save($materiel)) { |
283 | $this->Flash->success(__('Le matériel a bien été ajouté.')); | 286 | $this->Flash->success(__('Le matériel a bien été ajouté.')); |
284 | 287 | ||
285 | - $this->sendEmailToManagement($materiel->id); | 288 | +// $this->sendEmailToManagement($materiel->id); |
286 | 289 | ||
287 | - if($materiel->nom_createur != $materiel->nom_responsable) { | ||
288 | - $this->sendEmailToCreate($materiel->id); | ||
289 | - } | 290 | +// if($materiel->nom_createur != $materiel->nom_responsable) { |
291 | +// $this->sendEmailToCreate($materiel->id); | ||
292 | +// } | ||
290 | 293 | ||
291 | - $message = $materiel->get('nom_createur').' a ajouté le matériel "'.$materiel->get('designation').'" ('.$materiel->numero_laboratoire.')'; | 294 | + $msg = $materiel->get('nom_createur').' à ajouté le matériel "'.$materiel->get('designation').'" ('.$materiel->numero_laboratoire.')'; |
295 | + $subject = 'Ajout de matériel'; | ||
296 | + $listMails = []; | ||
292 | 297 | ||
293 | - //Envoi mail responsable | ||
294 | - $mailsResp = TableRegistry::get('Users')->find()->select('email')->where(['role =' => 'Responsable', 'groupes_metier_id =' => $materiel->get('groupes_metier_id')])->orWhere(['role =' => 'Responsable', 'groupe_thematique_id =' => $materiel->get('groupes_thematique_id')])->toArray(); | ||
295 | - $mails = []; | ||
296 | - for($i = 0; $i < sizeof($mailsResp); $i++) { | ||
297 | - $mails[$i] = $mailsResp[$i]['email']; | ||
298 | - } | ||
299 | - $this->sendEmailTo('Ajout d\'un matériel', $message, $mails); | 298 | +// //Envoi mail responsable |
299 | +// $mailsResp = TableRegistry::get('Users')->find()->select('email')->where(['role =' => 'Responsable', 'groupes_metier_id =' => $materiel->get('groupes_metier_id')])->orWhere(['role =' => 'Responsable', 'groupe_thematique_id =' => $materiel->get('groupes_thematique_id')])->toArray(); | ||
300 | +// $mails = []; | ||
301 | +// for($i = 0; $i < sizeof($mailsResp); $i++) { | ||
302 | +// $mails[$i] = $mailsResp[$i]['email']; | ||
303 | +// } | ||
304 | +// $this->sendEmailTo('Ajout d\'un matériel', $message, $mails); | ||
300 | 305 | ||
301 | - //Envoi mail administratif | ||
302 | - //$mailsResp = TableRegistry::get('Users')->find()->select('email')->where(['role =' => 'Administration Plus'])->orWhere(['role =' => 'Administration'])->toArray(); | ||
303 | - $mailsResp = TableRegistry::get('Users')->find()->select('email')->where(['role =' => 'Administration Plus'])->toArray(); | ||
304 | - $mails = []; | ||
305 | - for($i = 0; $i < sizeof($mailsResp); $i++) { | ||
306 | - $mails[$i] = $mailsResp[$i]['email']; | ||
307 | - } | 306 | +// //Envoi mail administratif |
307 | +// //$mailsResp = TableRegistry::get('Users')->find()->select('email')->where(['role =' => 'Administration Plus'])->orWhere(['role =' => 'Administration'])->toArray(); | ||
308 | +// $mailsResp = TableRegistry::get('Users')->find()->select('email')->where(['role =' => 'Administration Plus'])->toArray(); | ||
309 | +// $mails = []; | ||
310 | +// for($i = 0; $i < sizeof($mailsResp); $i++) { | ||
311 | +// $mails[$i] = $mailsResp[$i]['email']; | ||
312 | +// } | ||
308 | 313 | ||
309 | 314 | ||
310 | - // Rajout condition d'envoi de mail ou pas | ||
311 | - $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); | 315 | +// // Rajout condition d'envoi de mail ou pas |
316 | +// $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); | ||
312 | 317 | ||
313 | - if(!$configuration['envoi_mail_management_dev']){ // Si false, on envoie les mails, sinon on les envoie pas | ||
314 | - $this->sendEmailTo('Ajout d\'un matériel', $message, $mails); | ||
315 | - } | ||
316 | - | 318 | +// if(!$configuration['envoi_mail_management_dev']){ // Si false, on envoie les mails, sinon on les envoie pas |
319 | +// $this->sendEmailTo('Ajout d\'un matériel', $message, $mails); | ||
320 | +// } | ||
321 | + | ||
322 | + $this->sendEmail($subject, $msg, $listMails); | ||
317 | 323 | ||
318 | - //return $this->redirect(['action' => 'view', $materiel->id]); | 324 | + return $this->redirect(['action' => 'view', $materiel->id]); |
319 | } else { | 325 | } else { |
320 | $this->Flash->error(__('Le matériel n\'a pas pu être ajouté.')); | 326 | $this->Flash->error(__('Le matériel n\'a pas pu être ajouté.')); |
321 | } | 327 | } |
@@ -339,8 +345,8 @@ class MaterielsController extends AppController | @@ -339,8 +345,8 @@ class MaterielsController extends AppController | ||
339 | 345 | ||
340 | $mail_responsable = TableRegistry::get('Users')->find()->select('email')->where(['username =' => $this->LdapAuth->user($this->request->session()->read('authType'))[0]])->first()['email']; | 346 | $mail_responsable = TableRegistry::get('Users')->find()->select('email')->where(['username =' => $this->LdapAuth->user($this->request->session()->read('authType'))[0]])->first()['email']; |
341 | 347 | ||
342 | - if(isset($this->request->params[0])) { | ||
343 | - $cpMateriel = $this->Materiels->get($this->request->params[0]); | 348 | + if(isset($this->request->params['pass'][0])) { |
349 | + $cpMateriel = $this->Materiels->get($this->request->params['pass'][0]); | ||
344 | $this->set('cpMateriel', $cpMateriel); | 350 | $this->set('cpMateriel', $cpMateriel); |
345 | } | 351 | } |
346 | 352 | ||
@@ -365,11 +371,11 @@ class MaterielsController extends AppController | @@ -365,11 +371,11 @@ class MaterielsController extends AppController | ||
365 | $materiel = $this->Materiels->patchEntity($materiel, $this->request->data); | 371 | $materiel = $this->Materiels->patchEntity($materiel, $this->request->data); |
366 | if ($this->Materiels->save($materiel)) { | 372 | if ($this->Materiels->save($materiel)) { |
367 | $this->Flash->success(__('Le matériel a bien été édité.')); | 373 | $this->Flash->success(__('Le matériel a bien été édité.')); |
368 | - $this->sendEmailToManagement($id); | ||
369 | - if($materiel->nom_modificateur != $materiel->nom_responsable) { | ||
370 | - $message = $materiel->get('nom_modificateur').' a édité le matériel "'.$materiel->get('designation').'" ('.$materiel->numero_laboratoire.')'; | ||
371 | - $this->sendEmailTo('Modification d\'un matériel', $message, [$materiel->get('email_responsable')]); | ||
372 | - } | 374 | +// $this->sendEmailToManagement($id); |
375 | +// if($materiel->nom_modificateur != $materiel->nom_responsable) { | ||
376 | +// $message = $materiel->get('nom_modificateur').' a édité le matériel "'.$materiel->get('designation').'" ('.$materiel->numero_laboratoire.')'; | ||
377 | +// $this->sendEmailTo('Modification d\'un matériel', $message, [$materiel->get('email_responsable')]); | ||
378 | +// } | ||
373 | return $this->redirect(['action' => 'view', $id]); | 379 | return $this->redirect(['action' => 'view', $id]); |
374 | } else { | 380 | } else { |
375 | $this->Flash->error(__('Le matériel n\'a pas pu être édité.')); | 381 | $this->Flash->error(__('Le matériel n\'a pas pu être édité.')); |
@@ -399,7 +405,7 @@ class MaterielsController extends AppController | @@ -399,7 +405,7 @@ class MaterielsController extends AppController | ||
399 | } | 405 | } |
400 | $mail_responsable = TableRegistry::get('Users')->find()->select('email')->where(['username =' => $this->LdapAuth->user($this->request->session()->read('authType'))[0]])->first()['email']; | 406 | $mail_responsable = TableRegistry::get('Users')->find()->select('email')->where(['username =' => $this->LdapAuth->user($this->request->session()->read('authType'))[0]])->first()['email']; |
401 | 407 | ||
402 | - //Fonction utilisé dans la vue, déclaré ici pour éviter les problèmes de tests | 408 | + //Fonction utilisée dans la vue, déclaré ici pour éviter les problèmes de tests |
403 | $isReadonlyField = function ($fieldName, $myReadonlyFields) { | 409 | $isReadonlyField = function ($fieldName, $myReadonlyFields) { |
404 | if (! empty ( $myReadonlyFields ) && $myReadonlyFields [0] == '*') { | 410 | if (! empty ( $myReadonlyFields ) && $myReadonlyFields [0] == '*') { |
405 | $modifiableFields = $myReadonlyFields; | 411 | $modifiableFields = $myReadonlyFields; |
@@ -486,7 +492,7 @@ class MaterielsController extends AppController | @@ -486,7 +492,7 @@ class MaterielsController extends AppController | ||
486 | $materiel = $this->Materiels->get($id); | 492 | $materiel = $this->Materiels->get($id); |
487 | if ($this->Materiels->delete($materiel)) { | 493 | if ($this->Materiels->delete($materiel)) { |
488 | $this->Flash->success(__('Le matériel a bien été supprimé.')); | 494 | $this->Flash->success(__('Le matériel a bien été supprimé.')); |
489 | - $this->sendEmailToManagement($id); | 495 | +// $this->sendEmailToManagement($id); |
490 | } else { | 496 | } else { |
491 | $this->Flash->error(__('Le matériel n\'a pas pu être supprimé.')); | 497 | $this->Flash->error(__('Le matériel n\'a pas pu être supprimé.')); |
492 | } | 498 | } |
@@ -514,13 +520,13 @@ class MaterielsController extends AppController | @@ -514,13 +520,13 @@ class MaterielsController extends AppController | ||
514 | $this->Flash->error('Pour valider un matériel, les champs suivants ne doivent pas être vide : Nom propriétaire, Fournisseur, Numéro de commande, Organisme, prix et date de reception'); | 520 | $this->Flash->error('Pour valider un matériel, les champs suivants ne doivent pas être vide : Nom propriétaire, Fournisseur, Numéro de commande, Organisme, prix et date de reception'); |
515 | return $this->redirect(['action' => 'edit', $id]); | 521 | return $this->redirect(['action' => 'edit', $id]); |
516 | } | 522 | } |
517 | - $message = 'Le matériel "'.$materiel->get('designation').'" ('.$materiel->numero_laboratoire.') a été validé.'; | ||
518 | - $this->sendEmailTo('Validation d\'un matériel', $message, [$materiel->get('email_responsable')]); | 523 | +// $message = 'Le matériel "'.$materiel->get('designation').'" ('.$materiel->numero_laboratoire.') a été validé.'; |
524 | +// $this->sendEmailTo('Validation d\'un matériel', $message, [$materiel->get('email_responsable')]); | ||
519 | } | 525 | } |
520 | 526 | ||
521 | if ($this->Materiels->save($materiel, ['checkRules' => false, 'checkExisting' => false])) { | 527 | if ($this->Materiels->save($materiel, ['checkRules' => false, 'checkExisting' => false])) { |
522 | $this->Flash->success(__($message)); | 528 | $this->Flash->success(__($message)); |
523 | - $this->sendEmailToManagement($id); | 529 | +// $this->sendEmailToManagement($id); |
524 | } | 530 | } |
525 | else { | 531 | else { |
526 | $this->Flash->error(__('Le statut n\'a pas pu être édité.')); | 532 | $this->Flash->error(__('Le statut n\'a pas pu être édité.')); |
@@ -892,10 +898,10 @@ class MaterielsController extends AppController | @@ -892,10 +898,10 @@ class MaterielsController extends AppController | ||
892 | } | 898 | } |
893 | 899 | ||
894 | 900 | ||
895 | - else if (isset($this->passedArgs[0])) { | 901 | + else if (isset($this->request->params['pass'][0])) { |
896 | 902 | ||
897 | $this->myDebug("OTHER CASE 3"); | 903 | $this->myDebug("OTHER CASE 3"); |
898 | - $what = $this->passedArgs[0]; | 904 | + $what = $this->request->params['pass'][0]; |
899 | if ($what == 'search') { | 905 | if ($what == 'search') { |
900 | $materiels = $this->request->session()->read("result"); | 906 | $materiels = $this->request->session()->read("result"); |
901 | } | 907 | } |
@@ -1038,7 +1044,7 @@ class MaterielsController extends AppController | @@ -1038,7 +1044,7 @@ class MaterielsController extends AppController | ||
1038 | $this->Flash->success(__('L\'étiquette a bien été éditer.')); | 1044 | $this->Flash->success(__('L\'étiquette a bien été éditer.')); |
1039 | // Envoi email seulement si etiquette posée | 1045 | // Envoi email seulement si etiquette posée |
1040 | if ($printed) { | 1046 | if ($printed) { |
1041 | - $this->sendEmailToManagement($id); | 1047 | +// $this->sendEmailToManagement($id); |
1042 | } | 1048 | } |
1043 | } | 1049 | } |
1044 | else { | 1050 | else { |
src/Model/Table/CategoriesTable.php
1 | <?php | 1 | <?php |
2 | namespace App\Model\Table; | 2 | namespace App\Model\Table; |
3 | 3 | ||
4 | -use App\Model\Entity\Category; | ||
5 | -use Cake\ORM\Query; | ||
6 | use Cake\ORM\RulesChecker; | 4 | use Cake\ORM\RulesChecker; |
7 | use Cake\ORM\Table; | 5 | use Cake\ORM\Table; |
8 | use Cake\Validation\Validator; | 6 | use Cake\Validation\Validator; |
src/Model/Table/ConfigurationsTable.php
@@ -2,7 +2,6 @@ | @@ -2,7 +2,6 @@ | ||
2 | namespace App\Model\Table; | 2 | namespace App\Model\Table; |
3 | 3 | ||
4 | use App\Model\Entity\Configuration; | 4 | use App\Model\Entity\Configuration; |
5 | -use Cake\ORM\Query; | ||
6 | use Cake\ORM\RulesChecker; | 5 | use Cake\ORM\RulesChecker; |
7 | use Cake\ORM\Table; | 6 | use Cake\ORM\Table; |
8 | use Cake\Validation\Validator; | 7 | use Cake\Validation\Validator; |
src/Model/Table/DocumentsTable.php
1 | <?php | 1 | <?php |
2 | namespace App\Model\Table; | 2 | namespace App\Model\Table; |
3 | 3 | ||
4 | -use App\Model\Entity\Document; | ||
5 | -use Cake\ORM\Query; | ||
6 | use Cake\ORM\RulesChecker; | 4 | use Cake\ORM\RulesChecker; |
7 | use Cake\ORM\Table; | 5 | use Cake\ORM\Table; |
8 | use Cake\Validation\Validator; | 6 | use Cake\Validation\Validator; |
src/Model/Table/EmpruntsTable.php
@@ -2,12 +2,11 @@ | @@ -2,12 +2,11 @@ | ||
2 | namespace App\Model\Table; | 2 | namespace App\Model\Table; |
3 | 3 | ||
4 | use App\Model\Entity\Emprunt; | 4 | use App\Model\Entity\Emprunt; |
5 | -use Cake\ORM\Query; | ||
6 | use Cake\ORM\RulesChecker; | 5 | use Cake\ORM\RulesChecker; |
7 | use Cake\ORM\Table; | 6 | use Cake\ORM\Table; |
8 | -use Cake\Validation\Validator; | ||
9 | use Cake\ORM\toArray; | 7 | use Cake\ORM\toArray; |
10 | use Cake\Validation\Validation; | 8 | use Cake\Validation\Validation; |
9 | +use Cake\Validation\Validator; | ||
11 | 10 | ||
12 | 11 | ||
13 | /** | 12 | /** |
src/Model/Table/GroupesMetiersTable.php
src/Model/Table/GroupesThematiquesTable.php
src/Model/Table/MaterielsTable.php
1 | <?php | 1 | <?php |
2 | namespace App\Model\Table; | 2 | namespace App\Model\Table; |
3 | 3 | ||
4 | -use App\Model\Entity\Materiel; | ||
5 | -use Cake\ORM\Query; | ||
6 | use Cake\ORM\RulesChecker; | 4 | use Cake\ORM\RulesChecker; |
7 | use Cake\ORM\Table; | 5 | use Cake\ORM\Table; |
8 | use Cake\Validation\Validator; | 6 | use Cake\Validation\Validator; |
9 | use Cake\ORM\TableRegistry; | 7 | use Cake\ORM\TableRegistry; |
8 | +use Cake\I18n\Time; | ||
9 | +use Cake\I18n\Date; | ||
10 | 10 | ||
11 | /** | 11 | /** |
12 | * Materiels Model | 12 | * Materiels Model |
@@ -84,6 +84,14 @@ class MaterielsTable extends AppTable | @@ -84,6 +84,14 @@ class MaterielsTable extends AppTable | ||
84 | */ | 84 | */ |
85 | public function validationDefault(Validator $validator) | 85 | public function validationDefault(Validator $validator) |
86 | { | 86 | { |
87 | + $dateValide = function($entity) { | ||
88 | + $time = Time::now(); // On récupère la date et l'heure actuelles | ||
89 | + $today = (new date("$time->year-$time->month-$time->day"))->format('Ymd'); // On extrait la date on la formatte en un format comparable de type 20171231 | ||
90 | + $timeEntity = new time($entity); | ||
91 | + $dateEntity = (new date("$timeEntity->year-$timeEntity->month-$timeEntity->day"))->format('Ymd'); | ||
92 | + return ($today >= $dateEntity); | ||
93 | + }; | ||
94 | + | ||
87 | $validator | 95 | $validator |
88 | ->integer('id') | 96 | ->integer('id') |
89 | ->allowEmpty('id', 'create'); | 97 | ->allowEmpty('id', 'create'); |
@@ -120,12 +128,19 @@ class MaterielsTable extends AppTable | @@ -120,12 +128,19 @@ class MaterielsTable extends AppTable | ||
120 | $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); | 128 | $configuration = TableRegistry::get('Configurations')->find()->where(['id =' => 1])->first(); |
121 | if($configuration->date_commande_facultative) { | 129 | if($configuration->date_commande_facultative) { |
122 | $validator | 130 | $validator |
123 | - ->allowEmpty('date_acquisition'); | 131 | + ->allowEmpty('date_acquisition') |
132 | + ->add('date_acquisition', 'custom', [ // Ajouté par Thibault Ajas, le 28/04/2017 | ||
133 | + 'rule' => $dateValide, | ||
134 | + 'message' => 'La date n\'est pas valide' | ||
135 | + ]); | ||
124 | } | 136 | } |
125 | else { | 137 | else { |
126 | $validator | 138 | $validator |
127 | - ->notEmpty('date_acquisition', 'Ce champ doit être rempli') | ||
128 | - ->date('date_acquisition', 'dmy', null); | 139 | + ->notEmpty('date_acquisition', 'Ce champ doit être rempli') |
140 | + ->add('date_acquisition', 'custom', [ // Ajouté par Thibault Ajas, le 28/04/2017 | ||
141 | + 'rule' => $dateValide, | ||
142 | + 'message' => 'La date n\'est pas valide' | ||
143 | + ]); | ||
129 | } | 144 | } |
130 | 145 | ||
131 | 146 |
src/Model/Table/OrganismesTable.php
src/Model/Table/SitesTable.php
src/Model/Table/SousCategoriesTable.php
1 | <?php | 1 | <?php |
2 | namespace App\Model\Table; | 2 | namespace App\Model\Table; |
3 | 3 | ||
4 | -use App\Model\Entity\SousCategory; | ||
5 | -use Cake\ORM\Query; | ||
6 | use Cake\ORM\RulesChecker; | 4 | use Cake\ORM\RulesChecker; |
7 | use Cake\ORM\Table; | 5 | use Cake\ORM\Table; |
8 | use Cake\Validation\Validator; | 6 | use Cake\Validation\Validator; |
src/Model/Table/SuivisTable.php
src/Model/Table/SurCategoriesTable.php
1 | <?php | 1 | <?php |
2 | namespace App\Model\Table; | 2 | namespace App\Model\Table; |
3 | 3 | ||
4 | -use App\Model\Entity\SurCategory; | ||
5 | -use Cake\ORM\Query; | ||
6 | use Cake\ORM\RulesChecker; | 4 | use Cake\ORM\RulesChecker; |
7 | use Cake\ORM\Table; | 5 | use Cake\ORM\Table; |
8 | use Cake\Validation\Validator; | 6 | use Cake\Validation\Validator; |
src/Model/Table/TypeDocumentsTable.php
src/Model/Table/TypeSuivisTable.php
src/Model/Table/UsersTable.php
1 | <?php | 1 | <?php |
2 | namespace App\Model\Table; | 2 | namespace App\Model\Table; |
3 | 3 | ||
4 | -use App\Model\Entity\User; | ||
5 | -use Cake\ORM\Query; | ||
6 | use Cake\ORM\RulesChecker; | 4 | use Cake\ORM\RulesChecker; |
7 | use Cake\ORM\Table; | 5 | use Cake\ORM\Table; |
8 | -use Cake\Validation\Validator; | ||
9 | use Cake\ORM\TableRegistry; | 6 | use Cake\ORM\TableRegistry; |
7 | +use Cake\Validation\Validator; | ||
10 | 8 | ||
11 | /** | 9 | /** |
12 | * Users Model | 10 | * Users Model |
src/Template/Categories/index.ctp
1 | 1 | ||
2 | <div class="categories index"> | 2 | <div class="categories index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des catégories</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des catégories</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/Documents/index.ctp
1 | 1 | ||
2 | <div class="documents index"> | 2 | <div class="documents index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des documents</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des documents</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/Emprunts/index.ctp
1 | 1 | ||
2 | <div class="emprunts index"> | 2 | <div class="emprunts index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des emprunts ('.$nbEmprunts.')</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des emprunts ('.$nbEmprunts.')</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/GroupesMetiers/index.ctp
1 | 1 | ||
2 | <div class="groupesMetiers index"> | 2 | <div class="groupesMetiers index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des '.$configuration->nom_groupe_metier.'</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des '.$configuration->nom_groupe_metier.'</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/GroupesThematiques/index.ctp
1 | 1 | ||
2 | <div class="groupesThematiques index"> | 2 | <div class="groupesThematiques index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des '.$configuration->nom_groupe_thematique.'s</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des '.$configuration->nom_groupe_thematique.'s</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/Materiels/find.ctp
@@ -3,23 +3,23 @@ | @@ -3,23 +3,23 @@ | ||
3 | <h2> | 3 | <h2> |
4 | <i class="icon-search"></i> Recherche de matériel | 4 | <i class="icon-search"></i> Recherche de matériel |
5 | </h2> | 5 | </h2> |
6 | -<?php | ||
7 | -$r = isset ($_results); | ||
8 | - | ||
9 | -if ($r) { | ||
10 | - echo '<div class="actions" style="margin-bottom: 20px; width: 100%; float: none; padding: 10px 0;">'; | ||
11 | - echo $this->Html->link ( '<i class="icon-file"></i> Exporter la liste', [ | ||
12 | - 'controller' => 'Materiels', | ||
13 | - 'action' => 'export', | ||
14 | - 'search' | ||
15 | - ], [ | ||
16 | - 'title' => 'Editer le résultat de la recherche', | ||
17 | - 'style' => 'margin-right: 15px', | ||
18 | - 'escape' => false | ||
19 | - ]); | ||
20 | - echo '</div>'; | ||
21 | -} | ||
22 | -?> | 6 | + <?php |
7 | + $r = isset ($_results); | ||
8 | + | ||
9 | + if ($r) { | ||
10 | + echo '<div class="actions" style="margin-bottom: 20px; width: 100%; float: none; padding: 10px 0;">'; | ||
11 | + echo $this->Html->link ( '<i class="icon-file"></i> Exporter la liste', [ | ||
12 | + 'controller' => 'Materiels', | ||
13 | + 'action' => 'export', | ||
14 | + 'search' | ||
15 | + ], [ | ||
16 | + 'title' => 'Editer le résultat de la recherche', | ||
17 | + 'style' => 'margin-right: 15px', | ||
18 | + 'escape' => false | ||
19 | + ]); | ||
20 | + echo '</div>'; | ||
21 | + } | ||
22 | + ?> | ||
23 | 23 | ||
24 | <h3 id="t_filter" style="cursor: pointer;"> | 24 | <h3 id="t_filter" style="cursor: pointer;"> |
25 | <i | 25 | <i |
@@ -28,170 +28,171 @@ if ($r) { | @@ -28,170 +28,171 @@ if ($r) { | ||
28 | style="text-decoration: underline;">Filtres</span> | 28 | style="text-decoration: underline;">Filtres</span> |
29 | </h3> | 29 | </h3> |
30 | 30 | ||
31 | - <div id="filter" <?php if ($r) echo 'style="display: none;"'; ?>><?php | ||
32 | - if (isset ( $_results )) | ||
33 | - $selected = []; | ||
34 | - else | ||
35 | - $selected = [ | ||
36 | - 'selected' => '' | ||
37 | - ]; | ||
38 | - | ||
39 | - | ||
40 | - // FORMULAIRE DE RECHERCHE | ||
41 | - echo $this->Form->create(); | ||
42 | - | ||
43 | - // -------Bouton recherche Haut--------- | ||
44 | - echo $this->Form->submit ( 'Rechercher', ['style' => 'width: 20%']); | ||
45 | - | ||
46 | - // Designation | ||
47 | - echo $this->Form->input ( 's_designation', ['label' => 'Désignation']); | ||
48 | - | ||
49 | - // Matériel administratif et/ou technique | ||
50 | - $typeOptions = []; | ||
51 | - echo $this->Form->input ( 's_matostype', [ | ||
52 | - 'label' => 'Type', | ||
53 | - 'empty' => 'Tous', | ||
54 | - 'options' => [ | ||
55 | - 'A' => 'Administratif', | ||
56 | - 'T' => 'Technique', | ||
57 | - 'AT' => 'Administratif et Technique', | ||
58 | - 'AO' => 'Administratif seulement', | ||
59 | - 'TO' => 'Technique seulement' | ||
60 | - ], | ||
61 | - 'style' => 'width: 280px' | ||
62 | - ]); | ||
63 | - | ||
64 | - // DOMAINE | ||
65 | - echo $this->Form->input ( 's_sur_categorie_id', [ | ||
66 | - 'label' => 'Domaine', | ||
67 | - 'empty' => 'Tous', | ||
68 | - $selected, | ||
69 | - 'options' => $s_sur_categories, | ||
70 | - 'style' => 'width: 200px' | ||
71 | - ]); | ||
72 | - | ||
73 | - // CATEGORIES | ||
74 | - // by default, ALL categs | ||
75 | - $categs = $s_categories; | ||
76 | - | ||
77 | - // if a domaine is selected, reduce the categories list to this domaine | ||
78 | - if (isset ( $this->request->data['s_sur_categorie_id'] ) && ($this->request->data['s_sur_categorie_id'] != '')) { | ||
79 | - $categs = $categs->where(['sur_categorie_id =' => $this->request->data['s_sur_categorie_id']]); | ||
80 | - } | ||
81 | - | ||
82 | - echo $this->Form->input ( 's_categorie_id', [ | ||
83 | - 'label' => 'Catégorie', | ||
84 | - 'empty' => 'Toutes', | ||
85 | - 'style' => 'width: 200px', | ||
86 | - 'options' => $categs | ||
87 | - ]); | ||
88 | - | ||
89 | - // SOUS-CATEGORIES | ||
90 | - // by default, list is empty | ||
91 | - $souscategs = []; | ||
92 | - // if a categ is selected, update sous-categs list for this categ (only) | ||
93 | - if (isset ( $this->request->data['s_categorie_id'] ) && ($this->request->data['s_categorie_id'] != '')) { | ||
94 | - $souscategs = $s_sous_categories; | ||
95 | - $souscategs = $souscategs->where(['categorie_id' => $this->request->data['s_categorie_id']]); | ||
96 | - } | ||
97 | - | ||
98 | - echo $this->Form->input ( 's_sous_categorie_id', [ | ||
99 | - 'label' => 'Sous-catégorie', | ||
100 | - 'empty' => 'Toutes', | ||
101 | - 'style' => 'width: 200px', | ||
102 | - 'options' => $souscategs | ||
103 | - ]); | ||
104 | - | ||
105 | - $options = [ | ||
106 | - 'CREATED' => 'Créé', | ||
107 | - 'VALIDATED' => 'Validé', | ||
108 | - 'TOBEARCHIVED' => 'À archiver', | ||
109 | - ]; | ||
110 | - if(in_array($role, ['Administration', 'Administration Plus', 'Super Administrateur'])) { | ||
111 | - $options['ARCHIVED'] = 'Archivé'; | ||
112 | - } | ||
113 | - // STATUT | ||
114 | - echo $this->Form->input ( 's_status', [ | ||
115 | - 'label' => 'Statut', | ||
116 | - 'empty' => 'Tous', | ||
117 | - $selected, | ||
118 | - 'options' => $options, | ||
119 | - 'style' => 'width: 200px' | ||
120 | - ]); | ||
121 | - | ||
122 | - // Groupe metier et thematique | ||
123 | - echo $this->Form->input ( 's_groupes_metier_id', [ | ||
124 | - 'label' => $configuration->nom_groupe_metier, | ||
125 | - 'empty' => 'Tous', | ||
126 | - $selected, | ||
127 | - 'options' => $s_groupes_metiers, | ||
128 | - 'style' => 'width: 200px' | ||
129 | - ]); | ||
130 | - echo $this->Form->input ( 's_groupes_thematique_id', [ | ||
131 | - 'label' => $configuration->nom_groupe_thematique, | ||
132 | - 'empty' => 'Tous', | ||
133 | - $selected, | ||
134 | - 'options' => $s_groupes_thematiques, | ||
135 | - 'style' => 'width: 200px' | ||
136 | - ]); | ||
137 | - | ||
138 | - // Autres champs | ||
139 | - echo $this->Form->input ( 's_numero_commande', [ | ||
140 | - 'label' => 'N° BC' | ||
141 | - ]); | ||
142 | - echo $this->Form->input ( 's_numero_laboratoire', [ | ||
143 | - 'label' => 'N° interne (labo)' | ||
144 | - ]); | ||
145 | - | ||
146 | - //ORGANISME | ||
147 | - $orgas = $s_organismes; | ||
148 | - echo $this->Form->input ( 's_organisme_id', [ | ||
149 | - 'label' => 'Organisme', | ||
150 | - 'empty' => 'Toutes', | ||
151 | - 'style' => 'width: 200px', | ||
152 | - 'options' => $orgas | ||
153 | - ]); | ||
154 | - | ||
155 | - echo $this->Form->input ( 's_nom_responsable', [ | ||
156 | - 'label' => 'Nom du propriétaire' | ||
157 | - ]); | ||
158 | - echo $this->Form->input ( 's_numero_inventaire_organisme', [ | ||
159 | - 'label' => 'N° inventaire organisme' | ||
160 | - ]); | ||
161 | - echo $this->Form->input ( 's_numero_inventaire_old', [ | ||
162 | - 'label' => 'N° inventaire (ancien)' | ||
163 | - ]); | 31 | + <div id="filter" <?php if ($r) echo 'style="display: none;"'; ?>> |
32 | + <?php | ||
33 | + if (isset ( $_results )) | ||
34 | + $selected = []; | ||
35 | + else | ||
36 | + $selected = [ | ||
37 | + 'selected' => '' | ||
38 | + ]; | ||
164 | 39 | ||
165 | - // Date acquisition | ||
166 | - echo "<u>DATE d'achat:</u>"; | ||
167 | - echo $this->Form->input ( 's_date_acquisition', [ | ||
168 | - 'placeholder' => 'Cliquez pour selectionner une date', | ||
169 | - 'label' => '- Date exacte', | ||
170 | - 'class' => 'datepicker' | ||
171 | - ]); | ||
172 | - echo $this->Form->input ( 's_periode_acquisition1', [ | ||
173 | - 'placeholder' => 'Cliquez pour selectionner une date', | ||
174 | - 'label' => '- Date Début', | ||
175 | - 'class' => 'datepicker' | ||
176 | - ]); | ||
177 | - echo $this->Form->input ( 's_periode_acquisition2', [ | ||
178 | - 'placeholder' => 'Cliquez pour selectionner une date', | ||
179 | - 'label' => '- Date Fin', | ||
180 | - 'class' => 'datepicker' | ||
181 | - ]); | ||
182 | - | ||
183 | - echo "<u>MONTANT :</u>"; | ||
184 | - echo $this->Form->input ( 's_prix_ht', ['label' => '- Montant exact']); | ||
185 | - echo $this->Form->input ( 's_prix_ht_sup', ['label' => '- Montant sup. ou égal à']); | ||
186 | - echo $this->Form->input ( 's_prix_ht_inf', ['label' => '- Montant inf. ou égal à']); | 40 | + |
41 | + // FORMULAIRE DE RECHERCHE | ||
42 | + echo $this->Form->create(); | ||
43 | + | ||
44 | + // -------Bouton recherche Haut--------- | ||
45 | + echo $this->Form->submit ( 'Rechercher', ['style' => 'width: 20%']); | ||
46 | + | ||
47 | + // Designation | ||
48 | + echo $this->Form->input ( 's_designation', ['label' => 'Désignation']); | ||
49 | + | ||
50 | + // Matériel administratif et/ou technique | ||
51 | + $typeOptions = []; | ||
52 | + echo $this->Form->input ( 's_matostype', [ | ||
53 | + 'label' => 'Type', | ||
54 | + 'empty' => 'Tous', | ||
55 | + 'options' => [ | ||
56 | + 'A' => 'Administratif', | ||
57 | + 'T' => 'Technique', | ||
58 | + 'AT' => 'Administratif et Technique', | ||
59 | + 'AO' => 'Administratif seulement', | ||
60 | + 'TO' => 'Technique seulement' | ||
61 | + ], | ||
62 | + 'style' => 'width: 280px' | ||
63 | + ]); | ||
64 | + | ||
65 | + // DOMAINE | ||
66 | + echo $this->Form->input ( 's_sur_categorie_id', [ | ||
67 | + 'label' => 'Domaine', | ||
68 | + 'empty' => 'Tous', | ||
69 | + $selected, | ||
70 | + 'options' => $s_sur_categories, | ||
71 | + 'style' => 'width: 200px' | ||
72 | + ]); | ||
73 | + | ||
74 | + // CATEGORIES | ||
75 | + // by default, ALL categs | ||
76 | + $categs = $s_categories; | ||
77 | + | ||
78 | + // if a domaine is selected, reduce the categories list to this domaine | ||
79 | + if (isset ( $this->request->data['s_sur_categorie_id'] ) && ($this->request->data['s_sur_categorie_id'] != '')) { | ||
80 | + $categs = $categs->where(['sur_categorie_id =' => $this->request->data['s_sur_categorie_id']]); | ||
81 | + } | ||
82 | + | ||
83 | + echo $this->Form->input ( 's_categorie_id', [ | ||
84 | + 'label' => 'Catégorie', | ||
85 | + 'empty' => 'Toutes', | ||
86 | + 'style' => 'width: 200px', | ||
87 | + 'options' => $categs | ||
88 | + ]); | ||
89 | + | ||
90 | + // SOUS-CATEGORIES | ||
91 | + // by default, list is empty | ||
92 | + $souscategs = []; | ||
93 | + // if a categ is selected, update sous-categs list for this categ (only) | ||
94 | + if (isset ( $this->request->data['s_categorie_id'] ) && ($this->request->data['s_categorie_id'] != '')) { | ||
95 | + $souscategs = $s_sous_categories; | ||
96 | + $souscategs = $souscategs->where(['categorie_id' => $this->request->data['s_categorie_id']]); | ||
97 | + } | ||
98 | + | ||
99 | + echo $this->Form->input ( 's_sous_categorie_id', [ | ||
100 | + 'label' => 'Sous-catégorie', | ||
101 | + 'empty' => 'Toutes', | ||
102 | + 'style' => 'width: 200px', | ||
103 | + 'options' => $souscategs | ||
104 | + ]); | ||
105 | + | ||
106 | + $options = [ | ||
107 | + 'CREATED' => 'Créé', | ||
108 | + 'VALIDATED' => 'Validé', | ||
109 | + 'TOBEARCHIVED' => 'À archiver', | ||
110 | + ]; | ||
111 | + if(in_array($role, ['Administration', 'Administration Plus', 'Super Administrateur'])) { | ||
112 | + $options['ARCHIVED'] = 'Archivé'; | ||
113 | + } | ||
114 | + // STATUT | ||
115 | + echo $this->Form->input ( 's_status', [ | ||
116 | + 'label' => 'Statut', | ||
117 | + 'empty' => 'Tous', | ||
118 | + $selected, | ||
119 | + 'options' => $options, | ||
120 | + 'style' => 'width: 200px' | ||
121 | + ]); | ||
122 | + | ||
123 | + // Groupe metier et thematique | ||
124 | + echo $this->Form->input ( 's_groupes_metier_id', [ | ||
125 | + 'label' => $configuration->nom_groupe_metier, | ||
126 | + 'empty' => 'Tous', | ||
127 | + $selected, | ||
128 | + 'options' => $s_groupes_metiers, | ||
129 | + 'style' => 'width: 200px' | ||
130 | + ]); | ||
131 | + echo $this->Form->input ( 's_groupes_thematique_id', [ | ||
132 | + 'label' => $configuration->nom_groupe_thematique, | ||
133 | + 'empty' => 'Tous', | ||
134 | + $selected, | ||
135 | + 'options' => $s_groupes_thematiques, | ||
136 | + 'style' => 'width: 200px' | ||
137 | + ]); | ||
138 | + | ||
139 | + // Autres champs | ||
140 | + echo $this->Form->input ( 's_numero_commande', [ | ||
141 | + 'label' => 'N° BC' | ||
142 | + ]); | ||
143 | + echo $this->Form->input ( 's_numero_laboratoire', [ | ||
144 | + 'label' => 'N° interne (labo)' | ||
145 | + ]); | ||
187 | 146 | ||
188 | - // CHAMP DE RECHERCHE GENERIQUE | ||
189 | - echo $this->Form->input ( 's_all', ['label' => 'TOUS LES CHAMPS' ]); | 147 | + //ORGANISME |
148 | + $orgas = $s_organismes; | ||
149 | + echo $this->Form->input ( 's_organisme_id', [ | ||
150 | + 'label' => 'Organisme', | ||
151 | + 'empty' => 'Toutes', | ||
152 | + 'style' => 'width: 200px', | ||
153 | + 'options' => $orgas | ||
154 | + ]); | ||
190 | 155 | ||
191 | - // -------Bouton recherche Bas--------- | ||
192 | - echo $this->Form->submit('Rechercher', ['style' => 'width: 20%']); | ||
193 | - echo '<br/><br/><br/>'; | ||
194 | - ?> | 156 | + echo $this->Form->input ( 's_nom_responsable', [ |
157 | + 'label' => 'Nom du propriétaire' | ||
158 | + ]); | ||
159 | + echo $this->Form->input ( 's_numero_inventaire_organisme', [ | ||
160 | + 'label' => 'N° inventaire organisme' | ||
161 | + ]); | ||
162 | + echo $this->Form->input ( 's_numero_inventaire_old', [ | ||
163 | + 'label' => 'N° inventaire (ancien)' | ||
164 | + ]); | ||
165 | + | ||
166 | + // Date acquisition | ||
167 | + echo "<u>DATE d'achat:</u>"; | ||
168 | + echo $this->Form->input ( 's_date_acquisition', [ | ||
169 | + 'placeholder' => 'Cliquez pour selectionner une date', | ||
170 | + 'label' => '- Date exacte', | ||
171 | + 'class' => 'datepicker' | ||
172 | + ]); | ||
173 | + echo $this->Form->input ( 's_periode_acquisition1', [ | ||
174 | + 'placeholder' => 'Cliquez pour selectionner une date', | ||
175 | + 'label' => '- Date Début', | ||
176 | + 'class' => 'datepicker' | ||
177 | + ]); | ||
178 | + echo $this->Form->input ( 's_periode_acquisition2', [ | ||
179 | + 'placeholder' => 'Cliquez pour selectionner une date', | ||
180 | + 'label' => '- Date Fin', | ||
181 | + 'class' => 'datepicker' | ||
182 | + ]); | ||
183 | + | ||
184 | + echo "<u>MONTANT :</u>"; | ||
185 | + echo $this->Form->input ( 's_prix_ht', ['label' => '- Montant exact']); | ||
186 | + echo $this->Form->input ( 's_prix_ht_sup', ['label' => '- Montant sup. ou égal à']); | ||
187 | + echo $this->Form->input ( 's_prix_ht_inf', ['label' => '- Montant inf. ou égal à']); | ||
188 | + | ||
189 | + // CHAMP DE RECHERCHE GENERIQUE | ||
190 | + echo $this->Form->input ( 's_all', ['label' => 'TOUS LES CHAMPS' ]); | ||
191 | + | ||
192 | + // -------Bouton recherche Bas--------- | ||
193 | + echo $this->Form->submit('Rechercher', ['style' => 'width: 20%']); | ||
194 | + echo '<br/><br/><br/>'; | ||
195 | + ?> | ||
195 | </div> | 196 | </div> |
196 | <!-- RESULT DISPLAY --> | 197 | <!-- RESULT DISPLAY --> |
197 | <h3 id="t_result" style="cursor: pointer;"> | 198 | <h3 id="t_result" style="cursor: pointer;"> |
@@ -206,7 +207,7 @@ if ($r) { | @@ -206,7 +207,7 @@ if ($r) { | ||
206 | $this->request->session()->write("resultTri", $_results); | 207 | $this->request->session()->write("resultTri", $_results); |
207 | 208 | ||
208 | ?> | 209 | ?> |
209 | - <table cellpadding="0" cellspacing="0"> | 210 | + <table style="border-collapse: separate; border-spacing: 0;"> |
210 | <thead> | 211 | <thead> |
211 | <tr> | 212 | <tr> |
212 | <th class="actions"><?= __('') ?></th> | 213 | <th class="actions"><?= __('') ?></th> |
src/Template/Materiels/index.ctp
1 | +<?php | ||
2 | +use Cake\I18n\Time; | ||
3 | +use Cake\I18n\Date; | ||
4 | +?> | ||
5 | + | ||
6 | + | ||
1 | <div class="materiels index"> | 7 | <div class="materiels index"> |
2 | <?php echo '<h2><i class="icon-list"></i> Liste des matériels ('.$nbMateriels.')</h2>'; ?> | 8 | <?php echo '<h2><i class="icon-list"></i> Liste des matériels ('.$nbMateriels.')</h2>'; ?> |
3 | 9 | ||
@@ -114,7 +120,7 @@ if (isset ( $STATUS )) { | @@ -114,7 +120,7 @@ if (isset ( $STATUS )) { | ||
114 | } | 120 | } |
115 | ?> | 121 | ?> |
116 | 122 | ||
117 | - <table cellpadding="0" cellspacing="0"> | 123 | + <table style="border-collapse: separate; border-spacing: 0;"> |
118 | <thead> | 124 | <thead> |
119 | <tr> | 125 | <tr> |
120 | <?php if (isset($STATUS)) { echo '<th></th>'; }?> | 126 | <?php if (isset($STATUS)) { echo '<th></th>'; }?> |
@@ -131,7 +137,26 @@ if (isset ( $STATUS )) { | @@ -131,7 +137,26 @@ if (isset ( $STATUS )) { | ||
131 | </tr> | 137 | </tr> |
132 | </thead> | 138 | </thead> |
133 | <tbody> | 139 | <tbody> |
140 | + | ||
141 | + <?php | ||
142 | + // Pour changer la couleur du nom du matos si la garantie est passée - Ajout par Thibault Ajas le 28/04/2017 | ||
143 | + $time = Time::now(); // On récupère la date et l'heure actuelles | ||
144 | + $today = new date("$time->year-$time->month-$time->day"); // On extrait la date pour la vérification de fin de garantie | ||
145 | + $today = $today->format('Ydm'); // On formatte la date initialement en 31-12-2000 (par exemple) en un format qui pourra etre comparé : 20001231 | ||
146 | + ?> | ||
147 | + | ||
134 | <?php foreach ($materiels as $materiel): ?> | 148 | <?php foreach ($materiels as $materiel): ?> |
149 | + | ||
150 | + <?php | ||
151 | + if ($materiel->date_fin_garantie !== NULL) { | ||
152 | + $timeFin = new time($materiel->date_fin_garantie); | ||
153 | + $dateFin = new date("$timeFin->year-$timeFin->month-$timeFin->day"); | ||
154 | + $dateFin = $dateFin->format('Ydm'); | ||
155 | + } | ||
156 | + if($materiel->date_fin_garantie !== NULL) $styleLien = ($today >= $dateFin) ? 'style="color: #FF0000"' : '' ; else $styleLien = ''; | ||
157 | + // Fin ajout - Utilisation de la variable $styleLien ligne 213 | ||
158 | + ?> | ||
159 | + | ||
135 | <tr> | 160 | <tr> |
136 | <?php if (isset($STATUS)) { | 161 | <?php if (isset($STATUS)) { |
137 | echo '<td class="smallText">'.$this->Form->checkbox($materiel->id, ['style' => 'margin: 3px','id' => $materiel->id]).'</td>' ; | 162 | echo '<td class="smallText">'.$this->Form->checkbox($materiel->id, ['style' => 'margin: 3px','id' => $materiel->id]).'</td>' ; |
@@ -188,7 +213,7 @@ if (isset ( $STATUS )) { | @@ -188,7 +213,7 @@ if (isset ( $STATUS )) { | ||
188 | } | 213 | } |
189 | ?> | 214 | ?> |
190 | </td> | 215 | </td> |
191 | - <td class="smallText"><?= $materiel->has('designation') ? $this->Html->link($materiel->designation, ['controller' => 'Materiels', 'action' => 'view', $materiel->id]) : '' ?></td> | 216 | + <td class="smallText"><?= $materiel->has('designation') ? $this->Html->link($materiel->designation, ['controller' => 'Materiels', 'action' => 'view', $materiel->id],[$styleLien]) : '' ?></td> |
192 | <td class="smallText"><?= h($materiel->numero_laboratoire) ?></td> | 217 | <td class="smallText"><?= h($materiel->numero_laboratoire) ?></td> |
193 | <td class="smallText"><?= $materiel->has('category') ? h($materiel->category->nom) : '' ?></td> | 218 | <td class="smallText"><?= $materiel->has('category') ? h($materiel->category->nom) : '' ?></td> |
194 | <td class="smallText"><?= $materiel->has('organisme') ? h($materiel->organisme->nom) : '' ?></td> | 219 | <td class="smallText"><?= $materiel->has('organisme') ? h($materiel->organisme->nom) : '' ?></td> |
@@ -294,7 +319,9 @@ if (isset ( $STATUS )) { | @@ -294,7 +319,9 @@ if (isset ( $STATUS )) { | ||
294 | 'singularHumanName' => 'Matériel' ]) ?> | 319 | 'singularHumanName' => 'Matériel' ]) ?> |
295 | </div> | 320 | </div> |
296 | 321 | ||
297 | - | 322 | + |
323 | + | ||
324 | + | ||
298 | <script type="text/javascript"> | 325 | <script type="text/javascript"> |
299 | function changeNbrMateriels(nbr) { | 326 | function changeNbrMateriels(nbr) { |
300 | var urlDeBase = window.location.href.split("?"); | 327 | var urlDeBase = window.location.href.split("?"); |
src/Template/Materiels/view.ctp
1 | - | 1 | +<?php |
2 | +use Cake\I18n\Time; | ||
3 | +use Cake\I18n\Date; | ||
4 | +?> | ||
2 | <div class="materiels view"> | 5 | <div class="materiels view"> |
3 | 6 | ||
4 | <h2> | 7 | <h2> |
@@ -18,7 +21,7 @@ if (h ( $materiel->status ) == 'ARCHIVED') | @@ -18,7 +21,7 @@ if (h ( $materiel->status ) == 'ARCHIVED') | ||
18 | <?php if (h($materiel->status) == 'ARCHIVED') echo ' (Archivé)'; ?> | 21 | <?php if (h($materiel->status) == 'ARCHIVED') echo ' (Archivé)'; ?> |
19 | </span> | 22 | </span> |
20 | </h2> | 23 | </h2> |
21 | - </br> | 24 | + <br> |
22 | <div style="text-align: center;"> | 25 | <div style="text-align: center;"> |
23 | <?php | 26 | <?php |
24 | 27 | ||
@@ -39,7 +42,7 @@ if (h ( $materiel->status ) == 'ARCHIVED') | @@ -39,7 +42,7 @@ if (h ( $materiel->status ) == 'ARCHIVED') | ||
39 | ] ); | 42 | ] ); |
40 | echo '</div>'; | 43 | echo '</div>'; |
41 | ?> | 44 | ?> |
42 | - </br> | 45 | + <br> |
43 | 46 | ||
44 | <div class="actions" | 47 | <div class="actions" |
45 | style="margin-bottom: 20px; width: 100%; float: none; padding: 10px 0;"> | 48 | style="margin-bottom: 20px; width: 100%; float: none; padding: 10px 0;"> |
@@ -301,6 +304,21 @@ if (h ( $materiel->status ) == 'ARCHIVED') | @@ -301,6 +304,21 @@ if (h ( $materiel->status ) == 'ARCHIVED') | ||
301 | <th></th> | 304 | <th></th> |
302 | </tr> | 305 | </tr> |
303 | 306 | ||
307 | + | ||
308 | + <?php | ||
309 | + // Pour changer la couleur de la date de garantie si elle est passée - Ajout par Thibault Ajas le 02/05/2017 | ||
310 | + $time = Time::now(); // On récupère la date et l'heure actuelles | ||
311 | + $today = new date("$time->year-$time->month-$time->day"); // On extrait la date pour la vérification de fin de garantie | ||
312 | + $today = $today->format('Ydm'); // On formatte la date initialement en 31-12-2000 en un format qui pourra etre comparé : 20001231 | ||
313 | + if ($materiel->date_fin_garantie !== NULL) { | ||
314 | + $timeFin = new time($materiel->date_fin_garantie); | ||
315 | + $dateFin = new date("$timeFin->year-$timeFin->month-$timeFin->day"); | ||
316 | + $dateFin = $dateFin->format('Ydm'); | ||
317 | + } | ||
318 | + if($materiel->date_fin_garantie !== NULL) $style = ($today >= $dateFin) ? 'style="color: #FF0000"' : '' ; else $style = ''; | ||
319 | + ?> | ||
320 | + | ||
321 | + | ||
304 | <?php | 322 | <?php |
305 | $type = ""; | 323 | $type = ""; |
306 | if (h ( $materiel->materiel_administratif ) == 1 && h ( $materiel->materiel_technique ) == 1) { | 324 | if (h ( $materiel->materiel_administratif ) == 1 && h ( $materiel->materiel_technique ) == 1) { |
@@ -312,7 +330,9 @@ if (h ( $materiel->status ) == 'ARCHIVED') | @@ -312,7 +330,9 @@ if (h ( $materiel->status ) == 'ARCHIVED') | ||
312 | } | 330 | } |
313 | 331 | ||
314 | echo '<tr><td><strong>'.__('Description').' </strong></td><td>'.nl2br($materiel->description).'</td></tr>'; | 332 | echo '<tr><td><strong>'.__('Description').' </strong></td><td>'.nl2br($materiel->description).'</td></tr>'; |
315 | - | 333 | + |
334 | + // La variable-fonction $displayElement est définie dans le fichier src/Controller/AppController.php | ||
335 | + | ||
316 | $displayElement ( __ ( 'Materiel inventorié' ), $type ); | 336 | $displayElement ( __ ( 'Materiel inventorié' ), $type ); |
317 | $displayElement ( __ ( 'Organisme' ), $materiel->has ( 'organisme' ) ? h ( $materiel->organisme->nom ) : '' ); | 337 | $displayElement ( __ ( 'Organisme' ), $materiel->has ( 'organisme' ) ? h ( $materiel->organisme->nom ) : '' ); |
318 | $displayElement ( __ ( 'Domaine' ), $materiel->has ( 'sur_category' ) ? h ( $materiel->sur_category->nom ) : '' ); | 338 | $displayElement ( __ ( 'Domaine' ), $materiel->has ( 'sur_category' ) ? h ( $materiel->sur_category->nom ) : '' ); |
@@ -341,8 +361,8 @@ if (h ( $materiel->status ) == 'ARCHIVED') | @@ -341,8 +361,8 @@ if (h ( $materiel->status ) == 'ARCHIVED') | ||
341 | if (! empty ( h ( $materiel->duree_garntie ) )) { | 361 | if (! empty ( h ( $materiel->duree_garntie ) )) { |
342 | $displayElement ( __ ( 'Duree garantie' ), h ( $materiel->duree_garantie ) . ' ' . h ( $materiel->unite_duree_garantie ) ); | 362 | $displayElement ( __ ( 'Duree garantie' ), h ( $materiel->duree_garantie ) . ' ' . h ( $materiel->unite_duree_garantie ) ); |
343 | } | 363 | } |
344 | - $displayElement ( __ ( 'Date fin de garantie' ), h ( $materiel->date_fin_garantie ) ); | ||
345 | - | 364 | + $displayElement ( __ ( 'Date fin de garantie' ), h ( $materiel->date_fin_garantie ), $style ); |
365 | + | ||
346 | $displayElement ( __ ( 'Statut' ), h ( $materiel->status ) ); | 366 | $displayElement ( __ ( 'Statut' ), h ( $materiel->status ) ); |
347 | if ($materiel->status == 'ARCHIVED') { | 367 | if ($materiel->status == 'ARCHIVED') { |
348 | $displayElement ( __ ( 'Date d\'archivage' ), h ( $materiel->date_archivage ) ); | 368 | $displayElement ( __ ( 'Date d\'archivage' ), h ( $materiel->date_archivage ) ); |
src/Template/Organismes/index.ctp
1 | 1 | ||
2 | <div class="organismes index"> | 2 | <div class="organismes index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des organismes</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des organismes</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/Pages/acls.ctp
@@ -114,7 +114,7 @@ | @@ -114,7 +114,7 @@ | ||
114 | .WW8Num8z0 { font-family:Symbol; font-size:9pt; font-weight:normal; } | 114 | .WW8Num8z0 { font-family:Symbol; font-size:9pt; font-weight:normal; } |
115 | <!-- ODF styles with no properties representable as CSS --> | 115 | <!-- ODF styles with no properties representable as CSS --> |
116 | .Tableau2.13 .T10 .T11 .T12 .T19 .T2 .T20 .T21 .T22 .T23 .T24 .T3 .T8 .T9 .WW8Num8z1 .WW8Num8z2 .WW8Num8z3 .WW8Num8z4 .WW8Num8z5 .WW8Num8z6 .WW8Num8z7 .WW8Num8z8 .WW8Num9z0 .WW8Num9z1 .WW8Num9z2 .WW8Num9z3 .WW8Num9z4 .WW8Num9z5 .WW8Num9z6 .WW8Num9z7 .WW8Num9z8 { } | 116 | .Tableau2.13 .T10 .T11 .T12 .T19 .T2 .T20 .T21 .T22 .T23 .T24 .T3 .T8 .T9 .WW8Num8z1 .WW8Num8z2 .WW8Num8z3 .WW8Num8z4 .WW8Num8z5 .WW8Num8z6 .WW8Num8z7 .WW8Num8z8 .WW8Num9z0 .WW8Num9z1 .WW8Num9z2 .WW8Num9z3 .WW8Num9z4 .WW8Num9z5 .WW8Num9z6 .WW8Num9z7 .WW8Num9z8 { } |
117 | - </style></head><body dir="ltr" style="max-width:29.7cm;margin-top:1cm; margin-bottom:1cm; margin-left:1cm; margin-right:1.45cm; writing-mode:lr-tb; "><p class="P46">ACL (Access Control List)</p><p class="P11">(Etienne Pallier – 24/<span class="T22">06</span>/201<span class="T23">6</span>)</p><p class="P1"> </p><p class="P1"> </p><p class="P1"> </p><p class="P1">I – Cycle de vie du statut du matériel</p><p class="P1"> </p><p class="Standard"><span class="T5">Créer</span><span class="T2"> un matériel ==</span><span class="T9">> passe alors en statut </span><span class="T7">CREATED ==> </span><span class="T1">peut alors être éventuellement supprimé (mais ne pourra plus être supprimé ensuite)</span></p><p class="Standard"><span class="T7">Valider</span><span class="T9"> un matériel CREATED ==> passe alors en statut </span><span class="T7">VALIDATED </span><span class="T9">(</span><span class="T11">resp et </span><span class="T9">admin only)</span></p><p class="P4"><span class="T7">Demander l'Archivage</span><span class="T9"> d'un materiel VALIDATED ==> passe alors en statut </span><span class="T7">TOBEARCHIVED</span><span class="T9"> (resp et admin only)</span></p><p class="P4"><span class="T7">Sortir</span><span class="T9"> de l'inventaire (Valider une demande d'archivage d'un matériel TOBEARCHIVED) ==> statut </span><span class="T7">ARCHIVED</span><span class="T9"> (admin only)</span></p><p class="P4"><span class="T7">Désarchiver</span><span class="T9"> un matériel ==> repasse de TOBEARCHIVED ou ARCHIVED à </span><span class="T7">VALIDATED</span><span class="T9"> (admin only) </span></p><p class="P4"> </p><p class="P5">En résumé : </p><p class="P4"> </p><p class="P3">CREATED ==> VALIDATED ==> TOBEARCHIVED ==> ARCHIVED</p><p class="P2"><span class="T12"> </span><span class="T8">I /\ I I</span></p><p class="P2"><span class="T12"> </span><span class="T8">V I ------------------------ I --------------------------------- I (adminplus only)</span></p><p class="P3">DELETED</p><p class="P2"> </p><p class="P2"> </p><p class="P2"> </p><p class="P1">II - Droits des utilisateurs selon leur profil</p><p class="P1"> </p><p class="P1">A – Globalement (principes généraux)</p><p class="P1"> </p><p class="P6">Un utilisateur non logué ne doit RIEN pouvoir faire. Seulement se loguer, c'est tout. Il n'a accès qu'à la page d'accueil (de login).</p><p class="P6">Une fois logué, un utilisateur a des droits différents selon son profil, globalement :</p><p class="P14"><span class="T2">- un </span><span class="T5">USER</span><span class="T2"> ne peut que créer un matériel, un suivi, ou un emprunt, consulter, et modifier (uniquement ce qu'il a créé lui-même)</span></p><p class="P18"><span class="T2">- un </span><span class="T5">RESPONSABLE</span><span class="T2"> a tous les droits sauf accès à certains champs et certaines vues réservées à l'administration (ADMIN). Il ne peut pas non plus archiver un matériel, mais seulement demander l'archivage (comme un USER)(uniquement ce </span><span class="T3">lié à son groupe métier ou thématiques</span><span class="T2">)</span></p><p class="P14"><span class="T2">- un </span><span class="T5">ADMIN</span><span class="T2">(istratif) a tous les droits (y-compris champs réservés à l'administration)</span></p><p class="P14"><span class="T2">- un </span><span class="T5">ADMINPLUS</span><span class="T2"> (administratif Plus) a tous les droits de ADMIN et en plus il peut modifier un matériel quelque soit son statut (y-compris TOBEARCHIVED et ARCHIVED), notamment il peut modifier le statut du matériel (pour le rétrograder)</span></p><p class="P14"><span class="T2">- un </span><span class="T5">SUPERADMIN</span><span class="T2"> a tous les droits : ceux d'ADMINPLUS et certains droits supplémentaires pour lui permettre des corrections d'erreur et la configuration de l'application (notamment l'administration des utilisateurs...)</span></p><p class="P15"> </p><p class="Standard"><span class="T2">Concernant les informations internes permettant de savoir </span><span class="T5">qui a fait quoi</span><span class="T2"> (mises en place en février 2014), elles ne sont bien sûr pas modifiables puisque gérées automatiquement par le système, mais sont visibles par tous excepté le profil USER.</span></p><p class="P1"/><p class="P7">B - sur la table MATERIEL</p><table border="0" cellspacing="0" cellpadding="0" class="Tableau2"><colgroup><col width="170"/><col width="170"/><col width="170"/><col width="170"/><col width="170"/><col width="170"/><col width="170"/></colgroup><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="Table_20_Contents"> </p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="P41">ALL (TOUS)</p><p class="P43">(droits par defaut)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="P40"><span class="T5">U</span><span class="T6">tilisateur </span><span class="T5"> </span><span class="T2">(quelconque)</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="P42">Responsable</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="P42">Administration</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="P42">Administration Plus</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_G1"><p class="P42">Super-Administrateur</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Read (un seul ou une liste)</p><p class="P45">(view ou index)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P25">Y</p><p class="Table_20_Contents"><span class="T14">champs caches:</span><span class="T13"> donnees admin</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P36">idem ALL</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P36">idem ALL</p></td><td rowspan="3" style="text-align:left;width:3.893cm; " class="Tableau2_E4"><p class="P23"><span class="T16">(idem Responsable </span><span class="T15">+ donnees admin</span><span class="T16">)</span></p><p class="P37"> </p><p class="P23"><span class="T13">En mode edit (update), si VALIDATED, on ajoute aux donnees </span><span class="T14">readonly</span><span class="T13"> les </span><span class="T14">donnees admin</span></p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_F3"><p class="P37">idem Admin</p></td><td rowspan="11" style="text-align:left;width:3.893cm; " class="Tableau2_G12"><p class="P37">idem Adminplus</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Create (1)</p><p class="P45">(add)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">Y</p><p class="P39"><span class="T14">champs caches</span><span class="T13">:</span></p><p class="P34">donnees admin + statut + etiquette </p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P36">Idem ALL</p><p class="P39"><span class="T14">champs readonly </span><span class="T13">:</span></p><p class="P34">nom_responsable</p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_D4"><p class="P36">idem ALL</p><p class="P36">(+ etiquette)</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Update (1)</p><p class="P45">(edit)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">Y</p><p class="P33">ssi</p><p class="P39"><span class="T15">CREATED</span><span class="T16"> (tous les champs) </span></p><p class="P39"><span class="T13">ou </span><span class="T14">VALIDATED</span><span class="T13"> (quelques champs visibles sont </span><span class="T14">readonly</span><span class="T13">) (1)</span></p><p class="P34"> </p><p class="P39"><span class="T14">champs caches</span><span class="T13">:</span></p><p class="P34">donnees admin + statut + etiquette</p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_C5"><p class="P36">idem ALL</p><p class="P22"><span class="T16">ssi </span><span class="T15">createur</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">idem Admin</p><p class="P23"><span class="T16">(</span><span class="T15">tous les statuts</span><span class="T16">)</span></p><p class="P23"><span class="T16">(+ champ </span><span class="T15">statut</span><span class="T16">)</span></p><p class="P23"> </p><p class="P23"><span class="T16">TOBEARCHIVED ou ARCHIVED: </span><span class="T15">seulement le statut</span></p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Delete</p><p class="P45">(delete)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">Y</p><p class="P29">ssi CREATED</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">idem ALL</p></td><td rowspan="3" style="text-align:left;width:3.893cm; " class="Tableau2_E7"><p class="P37">idem Responsable</p></td><td rowspan="4" style="text-align:left;width:3.893cm; " class="Tableau2_F8"><p class="P37">idem Admin</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Valider</p><p class="P45">(statusValidated)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P25">N</p><p class="P28">(resp+)</p></td><td rowspan="7" style="text-align:left;width:3.893cm; " class="Tableau2_C12"><p class="P36">idem ALL</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">Y</p><p class="P30">ssi</p><p class="P30">CREATED</p><p class="P37"> </p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Demander archivage</p><p class="P45">(statusToBeArchived)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P25">N</p><p class="P28">(resp+)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">Y</p><p class="P30">ssi</p><p class="P30">VALIDATED</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Sortir de l'inventaire</p><p class="P45"><span class="T12"> </span>(statusArchived)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">N</p><p class="P29">(admin+)</p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_D9"><p class="P37">idem ALL</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P35">Y</p><p class="P28">ssi</p><p class="P28">TOBEARCHIVED</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Desarchiver (2)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">N</p><p class="P29">(adminplus+)</p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_E10"><p class="P37">idem Responsable</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">Y</p><p class="P30">ssi</p><p class="P30">ARCHIVED ou</p><p class="P30">TOBEARCHIVED</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Exporter</p><p class="P45">(csv)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">N</p><p class="P29">(resp+)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">Y</p></td><td rowspan="3" style="text-align:left;width:3.893cm; " class="Tableau2_F12"><p class="P37">idem Admin</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Montee de statut group<span class="T24">é</span>e</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">N</p><p class="P29">(admin+)</p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_D12"><p class="P37">idem ALL</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P38">Y</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Edition (4)</p><p class="P44">DOCUMENTS</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E12"><p class="P26">N</p><p class="P29">(admin+)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E12"><p class="P37">Y</p><p class="P31">- admission : ssi VALIDATED</p><p class="P31">- sortie : ssi TOBEARCHIVED ou ARCHIVED</p></td></tr><tr class="Tableau213"><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P68">Fiche Matériel </p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E13"><p class="P62">Y <span class="T25">(sans partie admin)</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_C13"><p class="P49">Y <span class="T25">(sans partie admin)</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_D13"><p class="P49">Y <span class="T25">(sans partie admin)</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E13"><p class="P62">Y</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_F13"><p class="P49">Y</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_G13"><p class="P49">Y <span class="T25">(sans partie admin)</span></p></td></tr></table><p class="P7"> </p><p class="P7"> </p><p class="P6"> </p><p class="P10">Par défaut, le superadmin a TOUS les droits</p><p class="P10"> </p><p class="Standard"><span class="T15">Conventions d'écriture </span><span class="T16">: </span></p><p class="P14"><span class="T16">- r</span><span class="T15">esp+</span><span class="T16"> = possible pour un </span><span class="T15">Responsable et plus </span><span class="T16">(responsable, admin, adminplus, et superadmin)</span></p><p class="P14"><span class="T16">- </span><span class="T15">admin+</span><span class="T16"> = possible pour un </span><span class="T15">Admin</span><span class="T16"> </span><span class="T15">et plus </span><span class="T16">(admin, adminplus, et superadmin)</span></p><p class="P16">- ...</p><p class="P16"> </p><p class="Standard"><span class="T15">Notes </span><span class="T16">:</span></p><p class="P9"> </p><ol><li><p class="P47" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0,635cm;">(1)</span><span class="T15">Droits en modification (edit) </span><span class="T16">:</span><span class="odfLiEnd"/> </p></li></ol><p class="P16">- Un simple « user » ne doit pas pouvoir modifier le responsable, ni le statut, ni l'étiquette, ni les données admin d'un matériel (en mode Création comme Modification)</p><p class="P16">- Un «responsable » ne doit pas pouvoir modifier le statut, ni les données admin d'un matériel (en mode Création comme Modification)</p><p class="P16">- Les données admin ne sont accessibles qu'aux profils admin+</p><p class="P14"><span class="T16">- Le champ "</span><span class="T15">status</span><span class="T16">" n'est modifiable que par les profils adminplus+</span></p><p class="P14"><span class="T16">- Tout le monde peut modifier un matériel </span><span class="T15">VALIDATED </span><span class="T16">(</span><span class="T15">user </span><span class="T16">ne peut modifier que </span><span class="T15">ses</span><span class="T16"> matériels, </span><span class="T17">resp ne peut modifier que les matériels de son groupe thématique ou métier</span><span class="T16">),</span></p><p class="P14"><span class="T16">MAIS PAS</span><span class="T15"> certains champs</span><span class="T16"> qui sont </span><span class="T15">readonly</span><span class="T16"> (</span><span class="T18">sur_categorie_id', 'categorie_id', 'materiel_administratif', 'materiel_technique', 'date_acquisition', 'nom_responsable', 'fournisseur', 'organisme', 'prix_ht')</span></p><p class="P14"><span class="T16">Les seuls champs qu'on peut éditer sont donc : (</span><span class="T18">designation, sous_categorie, materiel_administratif, materiel_technique, description, etiquette, lieu_stockage, lieu_detail, numero_serie, groupes_thematique, groupes_metier),</span><span class="T16"><br/>- Seuls les profils </span><span class="T15">adminplus+</span><span class="T16"> peuvent modifier un matériel </span><span class="T15">TOBEARCHIVED, ou ARCHIVED </span><span class="T16">mais </span><span class="T15">UNIQUEMENT le champ "status" </span><span class="T16">(pour pouvoir rétrograder à CREATED ou VALIDATED)</span></p><p class="P14"><span class="T16">- Le seul moyen de modifier COMPLÈTEMENT un matériel VALIDATED, TOBEARCHIVED, ou ARCHIVED, <br/>c'est de </span><span class="T15">changer son statut</span><span class="T16">, en le rétrogradant à CREATED (seuls les profils adminplus+ peuvent le faire)</span></p><p class="P16"> </p><ol><li><p class="P47" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0,635cm;">(2)</span><span class="T15">Désarchiver </span><span class="T16">: consiste à rétrograder un matériel ARCHIVED ou TOBEARCHIVED dans le statut VALIDATED ou CREATED (adminplus+ only) ; utile en cas d'erreur</span><span class="odfLiEnd"/> </p></li></ol><p class="P8"> </p><ol><li><p class="P47" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0,635cm;">(3)</span><span class="T15">Montée de statut groupée : </span><span class="T16">seul ADMIN peut (exporter tout ou partie de la liste des matériels, et) </span><span class="T15">augmenter (+1) le statut d'un groupe de matériels</span><span class="T16">, depuis la vue « index » (vue spéciale pour ADMIN, avec des cases à cocher et boutons pour exporter ou faire évoluer le statut)</span><span class="odfLiEnd"/> </p></li></ol><p class="P8"> </p><ol><li><p class="P48" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0,635cm;">(4)</span>Edition des documents :<span class="odfLiEnd"/> </p></li></ol><p class="P16">Admission : quand on "VALIDE" un matériel "CREATED", le statut passe en VALIDATED et le document d'admission est automatiquement édité</p><p class="P16">Sortie : quand on "ARCHIVE" un document "TOBEARCHIVED", le statut passe en ARCHIVED et le document de sortie est automatiquement édité</p><p class="P16">De plus :</p><p class="P16">- Bouton "Doc admission" affiché à partir du statut "VALIDATED"</p><p class="P16">- Bouton "Doc Sortie" affiché à partir du statut TOBEARCHIVED (et donc aussi pour ARCHIVED)</p><p class="P16">Enfin, Le doc de sortie doit être couplée avec la liste des matériels a archiver (TOBEARCHIVED) quand il y a une demande de sortie.</p><p class="P16"> </p><p class="P17"> </p><p class="P1">C - sur les différentes VUES liées au matériel</p><p class="Standard"> </p><p class="P6"><span class="T4">Page accueil </span>:</p><p class="P6"><span> Administration <span class="T20">& Administration Plus </span>voit un menu avec 2 options :</span></p><ul><li><ul><li><ul><li><p class="P51" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0,635cm;">.</span>« Voir les matériels à valider »<span class="odfLiEnd"/> </p></li><li><p class="P52" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0,635cm;">.</span>« Voir les matériels à sortir de l'inventaire »<span class="odfLiEnd"/> </p></li></ul></li></ul><p class="P52" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0cm"><!-- --></span><span class="T21">Responsable </span>voit un menu avec <span class="T21">3</span> options :<span class="odfLiEnd"/> </p><ul><li><ul><li><p class="P52" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0,635cm;">.</span>« Voir les matériels <span class="T21">de mon groupe métier</span> »<span class="odfLiEnd"/> </p></li><li><p class="P52" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0,635cm;">.</span>« Voir les matériels <span class="T21">de mon groupe métier à valider</span> »<span class="odfLiEnd"/> </p></li><li><p class="P52" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0,635cm;">.</span>« <span class="T21">Voir les suivis des matériels donc je suis responsable »</span><span class="odfLiEnd"/> </p></li></ul></li></ul></li></ul><p class="P1">Page Outils :</p><p class="P6">User n'a pas accès à cette page</p><p class="P6">Les autres ont quelques options</p><p class="P6">superadmin a ces options en plus :</p><ul><li><p class="P53" style="margin-left:0cm;"><span class="WW8Num4z0" style="display:block;float:left;min-width:0,635cm;">.</span>Configuration générale de l'application<span class="odfLiEnd"/> </p></li><li><p class="P53" style="margin-left:0cm;"><span class="WW8Num4z0" style="display:block;float:left;min-width:0,635cm;">.</span>Gérer les utilisateurs <span class="T20">privilégiés</span><span class="odfLiEnd"/> </p></li><li><p class="P53" style="margin-left:0cm;"><span class="WW8Num4z0" style="display:block;float:left;min-width:0,635cm;">.</span>Passer en mode debug<span class="odfLiEnd"/> </p></li><li><p class="P54" style="margin-left:0cm;"><span class="WW8Num4z0" style="display:block;float:left;min-width:0,635cm;">.</span>Passer en mode install<span class="odfLiEnd"/> </p></li></ul><p class="P6"> </p><p class="Standard"><span class="T5">Vue materiel/index (liste) </span><span class="T2">: limiter aux </span><span class="T5">matériels actifs</span><span class="T2"> (non archivés)</span></p><ul><li><ul><li><p class="P55" style="margin-left:0cm;"><span class="WW8Num1z0" style="display:block;float:left;min-width:0,635cm;">.</span>Admin<span class="T20">+ </span>voit des boutons pour filtrer par « tous », « à valider », « validés », « à sortir », « archivés »<span class="odfLiEnd"/> </p></li></ul></li></ul><p class="P6"> </p><p class="Standard"><span class="T5">Vue materiel/find </span><span class="T2">: limiter aux </span><span class="T5">matériels actifs</span><span class="T2"> (non archivés)</span></p><p class="P6"><span> Seul le<span class="T20">s</span> profil<span class="T20">s</span> Admin<span class="T20">+ </span>voit TOUS les matériels (y-compris archivés)</span></p><p class="P6"> </p><p class="P6"><span class="T4">Vue materiel/view </span>:</p><p class="P6"><span> boutons « Imprimer Etiquettes » : <span class="T20">resp+</span></span></p><p class="P6"> </p><p class="P6"><span class="T4">Vue materiel/edit </span>:</p><ul><li><p class="P56" style="margin-left:0cm;"><span class="WW8Num5z0" style="display:block;float:left;min-width:0,635cm;">.</span>Etiquette O/N (admin<span class="T20">+)</span><span class="odfLiEnd"/> </p></li><li><p class="P56" style="margin-left:0cm;"><span class="WW8Num5z0" style="display:block;float:left;min-width:0,635cm;">.</span>Statut (<span class="T20">superadmin+)</span><span class="odfLiEnd"/> </p></li><li><p class="P56" style="margin-left:0cm;"><span class="WW8Num5z0" style="display:block;float:left;min-width:0,635cm;">.</span>Informations administratives (admin<span class="T20">+)</span><span class="odfLiEnd"/> </p></li></ul><p class="P6"> </p><p class="P6"> </p><p class="P1"> </p><p class="P19">D - sur un SUIVI et un EMPRUNT</p><p class="P1"> </p><ul><li><p class="P57" style="margin-left:0cm;"><span class="WW8Num3z0" style="display:block;float:left;min-width:0,635cm;">.</span>Dans tous les cas, on ne doit pas pouvoir emprunter ou suivre un materiel non validé (CREATED)<span class="odfLiEnd"/> </p></li><li><p class="P57" style="margin-left:0cm;"><span class="WW8Num3z0" style="display:block;float:left;min-width:0,635cm;">.</span>User a les droits C, R, U (si créateur), D (si créateur)<span class="odfLiEnd"/> </p></li><li><p class="P57" style="margin-left:0cm;"><span class="WW8Num3z0" style="display:block;float:left;min-width:0,635cm;">.</span>Resp+ a les droits C, R, U, D<span class="odfLiEnd"/> </p></li></ul><p class="P4"><span class="T9">Un USER peut modifier/supprimer un emprunt dont il est soit le créateur soit l'emprunteur</span><span class="T19">.</span></p><p class="P12">Un USER qui créé un emprunt ne doit pas pouvoir changer le nom de l'emprunteur (par défaut, c'est lui). Ainsi, il pourra modifier/supprimer cette fiche au besoin plus tard. Par défaut donc, pour un user, emprunt.emprunteur=creator, materiel.responsable=creator</p><p class="P13">Tout le monde peut rechercher un suivi,</p><p class="P5"> </p><p class="P5"> </p><p class="P3">E - sur les UTILISATEURS</p><p class="P4"><span class="T9">Par défaut, superadmin a tous les droits, et les autres profils n'ont que le droit de lecture (</span><span class="T7">view </span><span class="T9">et </span><span class="T7">index</span><span class="T9">)</span></p><p class="P5"> </p><p class="P5"> </p><p class="P3">F - sur tous les autres objets métiers</p><p class="P5">Voici la liste des autres objets métiers :</p><ul><li><p class="P58" style="margin-left:0cm;"><span class="WW8Num7z0" style="display:block;float:left;min-width:0,635cm;">.</span>Catégories (et domaines et sous-catégories)<span class="odfLiEnd"/> </p></li></ul><ul><li><p class="P59" style="margin-left:0cm;"><span class="WW8Num6z0" style="display:block;float:left;min-width:0,635cm;">.</span>Groupes thématiques<span class="odfLiEnd"/> </p></li><li><p class="P59" style="margin-left:0cm;"><span class="WW8Num6z0" style="display:block;float:left;min-width:0,635cm;">.</span>Groupes métiers<span class="odfLiEnd"/> </p></li></ul><p class="P4"><span class="T9">Par défaut, pour tous ces objets, superadmin a tous les droits, admin</span><span class="T10">plus</span><span class="T9"> a tous les droits sauf « delete », et les autres profils n'ont que le droit de lecture (</span><span class="T7">view </span><span class="T9">et </span><span class="T7">index</span><span class="T9">)</span></p> | 117 | + </style></head><body dir="ltr" style="max-width:29.7cm;margin-top:1cm; margin-bottom:1cm; margin-left:1cm; margin-right:1.45cm; writing-mode:lr-tb; "><p class="P46">ACL (Access Control List)</p><p class="P11">(Etienne Pallier – 24/<span class="T22">06</span>/201<span class="T23">6</span>)</p><p class="P1"> </p><p class="P1"> </p><p class="P1"> </p><p class="P1">I – Cycle de vie du statut du matériel</p><p class="P1"> </p><p class="Standard"><span class="T5">Créer</span><span class="T2"> un matériel ==</span><span class="T9">> passe alors en statut </span><span class="T7">CREATED ==> </span><span class="T1">peut alors être éventuellement supprimé (mais ne pourra plus être supprimé ensuite)</span></p><p class="Standard"><span class="T7">Valider</span><span class="T9"> un matériel CREATED ==> passe alors en statut </span><span class="T7">VALIDATED </span><span class="T9">(</span><span class="T11">resp et </span><span class="T9">admin only)</span></p><p class="P4"><span class="T7">Demander l'Archivage</span><span class="T9"> d'un materiel VALIDATED ==> passe alors en statut </span><span class="T7">TOBEARCHIVED</span><span class="T9"> (resp et admin only)</span></p><p class="P4"><span class="T7">Sortir</span><span class="T9"> de l'inventaire (Valider une demande d'archivage d'un matériel TOBEARCHIVED) ==> statut </span><span class="T7">ARCHIVED</span><span class="T9"> (admin only)</span></p><p class="P4"><span class="T7">Désarchiver</span><span class="T9"> un matériel ==> repasse de TOBEARCHIVED ou ARCHIVED à </span><span class="T7">VALIDATED</span><span class="T9"> (admin only) </span></p><p class="P4"> </p><p class="P5">En résumé : </p><p class="P4"> </p><p class="P3">CREATED ==> VALIDATED ==> TOBEARCHIVED ==> ARCHIVED</p><p class="P2"><span class="T12"> </span><span class="T8">I /\ I I</span></p><p class="P2"><span class="T12"> </span><span class="T8">V I ------------------------ I --------------------------------- I (adminplus only)</span></p><p class="P3">DELETED</p><p class="P2"> </p><p class="P2"> </p><p class="P2"> </p><p class="P1">II - Droits des utilisateurs selon leur profil</p><p class="P1"> </p><p class="P1">A – Globalement (principes généraux)</p><p class="P1"> </p><p class="P6">Un utilisateur non logué ne doit RIEN pouvoir faire. Seulement se loguer, c'est tout. Il n'a accès qu'à la page d'accueil (de login).</p><p class="P6">Une fois logué, un utilisateur a des droits différents selon son profil, globalement :</p><p class="P14"><span class="T2">- un </span><span class="T5">USER</span><span class="T2"> ne peut que créer un matériel, un suivi, ou un emprunt, consulter, et modifier (uniquement ce qu'il a créé lui-même)</span></p><p class="P18"><span class="T2">- un </span><span class="T5">RESPONSABLE</span><span class="T2"> a tous les droits sauf accès à certains champs et certaines vues réservées à l'administration (ADMIN). Il ne peut pas non plus archiver un matériel, mais seulement demander l'archivage (comme un USER)(uniquement ce </span><span class="T3">lié à son groupe métier ou thématiques</span><span class="T2">)</span></p><p class="P14"><span class="T2">- un </span><span class="T5">ADMIN</span><span class="T2">(istratif) a tous les droits (y-compris champs réservés à l'administration)</span></p><p class="P14"><span class="T2">- un </span><span class="T5">ADMINPLUS</span><span class="T2"> (administratif Plus) a tous les droits de ADMIN et en plus il peut modifier un matériel quelque soit son statut (y-compris TOBEARCHIVED et ARCHIVED), notamment il peut modifier le statut du matériel (pour le rétrograder)</span></p><p class="P14"><span class="T2">- un </span><span class="T5">SUPERADMIN</span><span class="T2"> a tous les droits : ceux d'ADMINPLUS et certains droits supplémentaires pour lui permettre des corrections d'erreur et la configuration de l'application (notamment l'administration des utilisateurs...)</span></p><p class="P15"> </p><p class="Standard"><span class="T2">Concernant les informations internes permettant de savoir </span><span class="T5">qui a fait quoi</span><span class="T2"> (mises en place en février 2014), elles ne sont bien sûr pas modifiables puisque gérées automatiquement par le système, mais sont visibles par tous excepté le profil USER.</span></p><p class="P1"/><p class="P7">B - sur la table MATERIEL</p><table border="0" cellspacing="0" cellpadding="0" class="Tableau2"><colgroup><col width="170"/><col width="170"/><col width="170"/><col width="170"/><col width="170"/><col width="170"/><col width="170"/></colgroup><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="Table_20_Contents"> </p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="P41">ALL (TOUS)</p><p class="P43">(droits par defaut)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="P40"><span class="T5">U</span><span class="T6">tilisateur </span><span class="T5"> </span><span class="T2">(quelconque)</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="P42">Responsable</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="P42">Administration</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_A1"><p class="P42">Administration Plus</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_G1"><p class="P42">Super-Administrateur</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Read (un seul ou une liste)</p><p class="P45">(view ou index)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P25">Y</p><p class="Table_20_Contents"><span class="T14">champs caches:</span><span class="T13"> donnees admin</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P36">idem ALL</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P36">idem ALL</p></td><td rowspan="3" style="text-align:left;width:3.893cm; " class="Tableau2_E4"><p class="P23"><span class="T16">(idem Responsable </span><span class="T15">+ donnees admin</span><span class="T16">)</span></p><p class="P37"> </p><p class="P23"><span class="T13">En mode edit (update), si VALIDATED, on ajoute aux donnees </span><span class="T14">readonly</span><span class="T13"> les </span><span class="T14">donnees admin</span></p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_F3"><p class="P37">idem Admin</p></td><td rowspan="11" style="text-align:left;width:3.893cm; " class="Tableau2_G12"><p class="P37">idem Adminplus</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Create (1)</p><p class="P45">(add)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">Y</p><p class="P39"><span class="T14">champs caches</span><span class="T13">:</span></p><p class="P34">donnees admin + statut + etiquette </p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P36">Idem ALL</p><p class="P39"><span class="T14">champs readonly </span><span class="T13">:</span></p><p class="P34">nom_responsable</p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_D4"><p class="P36">idem ALL</p><p class="P36">(+ etiquette)</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Update (1)</p><p class="P45">(edit)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">Y</p><p class="P33">ssi</p><p class="P39"><span class="T15">CREATED</span><span class="T16"> (tous les champs) </span></p><p class="P39"><span class="T13">ou </span><span class="T14">VALIDATED</span><span class="T13"> (quelques champs visibles sont </span><span class="T14">readonly</span><span class="T13">) (1)</span></p><p class="P34"> </p><p class="P39"><span class="T14">champs caches</span><span class="T13">:</span></p><p class="P34">donnees admin + statut + etiquette</p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_C5"><p class="P36">idem ALL</p><p class="P22"><span class="T16">ssi </span><span class="T15">createur</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">idem Admin</p><p class="P23"><span class="T16">(</span><span class="T15">tous les statuts</span><span class="T16">)</span></p><p class="P23"><span class="T16">(+ champ </span><span class="T15">statut</span><span class="T16">)</span></p><p class="P23"> </p><p class="P23"><span class="T16">TOBEARCHIVED ou ARCHIVED: </span><span class="T15">seulement le statut</span></p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Delete</p><p class="P45">(delete)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">Y</p><p class="P29">ssi CREATED</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">idem ALL</p></td><td rowspan="3" style="text-align:left;width:3.893cm; " class="Tableau2_E7"><p class="P37">idem Responsable</p></td><td rowspan="4" style="text-align:left;width:3.893cm; " class="Tableau2_F8"><p class="P37">idem Admin</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Valider</p><p class="P45">(statusValidated)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P25">N</p><p class="P28">(resp+)</p></td><td rowspan="7" style="text-align:left;width:3.893cm; " class="Tableau2_C12"><p class="P36">idem ALL</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">Y</p><p class="P30">ssi</p><p class="P30">CREATED</p><p class="P37"> </p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Demander archivage</p><p class="P45">(statusToBeArchived)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P25">N</p><p class="P28">(resp+)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">Y</p><p class="P30">ssi</p><p class="P30">VALIDATED</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Sortir de l'inventaire</p><p class="P45"><span class="T12"> </span>(statusArchived)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">N</p><p class="P29">(admin+)</p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_D9"><p class="P37">idem ALL</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P35">Y</p><p class="P28">ssi</p><p class="P28">TOBEARCHIVED</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Desarchiver (2)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">N</p><p class="P29">(adminplus+)</p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_E10"><p class="P37">idem Responsable</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">Y</p><p class="P30">ssi</p><p class="P30">ARCHIVED ou</p><p class="P30">TOBEARCHIVED</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Exporter</p><p class="P45">(csv)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">N</p><p class="P29">(resp+)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P37">Y</p></td><td rowspan="3" style="text-align:left;width:3.893cm; " class="Tableau2_F12"><p class="P37">idem Admin</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Montee de statut group<span class="T24">é</span>e</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P26">N</p><p class="P29">(admin+)</p></td><td rowspan="2" style="text-align:left;width:3.893cm; " class="Tableau2_D12"><p class="P37">idem ALL</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E11"><p class="P38">Y</p></td></tr><tr><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P44">Edition (4)</p><p class="P44">DOCUMENTS</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E12"><p class="P26">N</p><p class="P29">(admin+)</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E12"><p class="P37">Y</p><p class="P31">- admission : ssi VALIDATED</p><p class="P31">- sortie : ssi TOBEARCHIVED ou ARCHIVED</p></td></tr><tr class="Tableau213"><td style="text-align:left;width:3.893cm; " class="Tableau2_A2"><p class="P68">Fiche Matériel </p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E13"><p class="P62">Y <span class="T25">(sans partie admin)</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_C13"><p class="P49">Y <span class="T25">(sans partie admin)</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_D13"><p class="P49">Y <span class="T25">(sans partie admin)</span></p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_E13"><p class="P62">Y</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_F13"><p class="P49">Y</p></td><td style="text-align:left;width:3.893cm; " class="Tableau2_G13"><p class="P49">Y <span class="T25">(sans partie admin)</span></p></td></tr></table><p class="P7"> </p><p class="P7"> </p><p class="P6"> </p><p class="P10">Par défaut, le superadmin a TOUS les droits</p><p class="P10"> </p><p class="Standard"><span class="T15">Conventions d'écriture </span><span class="T16">: </span></p><p class="P14"><span class="T16">- r</span><span class="T15">esp+</span><span class="T16"> = possible pour un </span><span class="T15">Responsable et plus </span><span class="T16">(responsable, admin, adminplus, et superadmin)</span></p><p class="P14"><span class="T16">- </span><span class="T15">admin+</span><span class="T16"> = possible pour un </span><span class="T15">Admin</span><span class="T16"> </span><span class="T15">et plus </span><span class="T16">(admin, adminplus, et superadmin)</span></p><p class="P16">- ...</p><p class="P16"> </p><p class="Standard"><span class="T15">Notes </span><span class="T16">:</span></p><p class="P9"> </p><ol><li><p class="P47" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0,635cm;">(1)</span><span class="T15">Droits en modification (edit) </span><span class="T16">:</span><span class="odfLiEnd"></span> </p></li></ol><p class="P16">- Un simple « user » ne doit pas pouvoir modifier le responsable, ni le statut, ni l'étiquette, ni les données admin d'un matériel (en mode Création comme Modification)</p><p class="P16">- Un «responsable » ne doit pas pouvoir modifier le statut, ni les données admin d'un matériel (en mode Création comme Modification)</p><p class="P16">- Les données admin ne sont accessibles qu'aux profils admin+</p><p class="P14"><span class="T16">- Le champ "</span><span class="T15">status</span><span class="T16">" n'est modifiable que par les profils adminplus+</span></p><p class="P14"><span class="T16">- Tout le monde peut modifier un matériel </span><span class="T15">VALIDATED </span><span class="T16">(</span><span class="T15">user </span><span class="T16">ne peut modifier que </span><span class="T15">ses</span><span class="T16"> matériels, </span><span class="T17">resp ne peut modifier que les matériels de son groupe thématique ou métier</span><span class="T16">),</span></p><p class="P14"><span class="T16">MAIS PAS</span><span class="T15"> certains champs</span><span class="T16"> qui sont </span><span class="T15">readonly</span><span class="T16"> (</span><span class="T18">sur_categorie_id', 'categorie_id', 'materiel_administratif', 'materiel_technique', 'date_acquisition', 'nom_responsable', 'fournisseur', 'organisme', 'prix_ht')</span></p><p class="P14"><span class="T16">Les seuls champs qu'on peut éditer sont donc : (</span><span class="T18">designation, sous_categorie, materiel_administratif, materiel_technique, description, etiquette, lieu_stockage, lieu_detail, numero_serie, groupes_thematique, groupes_metier),</span><span class="T16"><br/>- Seuls les profils </span><span class="T15">adminplus+</span><span class="T16"> peuvent modifier un matériel </span><span class="T15">TOBEARCHIVED, ou ARCHIVED </span><span class="T16">mais </span><span class="T15">UNIQUEMENT le champ "status" </span><span class="T16">(pour pouvoir rétrograder à CREATED ou VALIDATED)</span></p><p class="P14"><span class="T16">- Le seul moyen de modifier COMPLÈTEMENT un matériel VALIDATED, TOBEARCHIVED, ou ARCHIVED, <br/>c'est de </span><span class="T15">changer son statut</span><span class="T16">, en le rétrogradant à CREATED (seuls les profils adminplus+ peuvent le faire)</span></p><p class="P16"> </p><ol><li><p class="P47" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0,635cm;">(2)</span><span class="T15">Désarchiver </span><span class="T16">: consiste à rétrograder un matériel ARCHIVED ou TOBEARCHIVED dans le statut VALIDATED ou CREATED (adminplus+ only) ; utile en cas d'erreur</span><span class="odfLiEnd"></span> </p></li></ol><p class="P8"> </p><ol><li><p class="P47" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0,635cm;">(3)</span><span class="T15">Montée de statut groupée : </span><span class="T16">seul ADMIN peut (exporter tout ou partie de la liste des matériels, et) </span><span class="T15">augmenter (+1) le statut d'un groupe de matériels</span><span class="T16">, depuis la vue « index » (vue spéciale pour ADMIN, avec des cases à cocher et boutons pour exporter ou faire évoluer le statut)</span><span class="odfLiEnd"></span> </p></li></ol><p class="P8"> </p><ol><li><p class="P48" style="margin-left:0cm;"><span class="WW8Num8z0" style="display:block;float:left;min-width:0,635cm;">(4)</span>Edition des documents :<span class="odfLiEnd"/> </p></li></ol><p class="P16">Admission : quand on "VALIDE" un matériel "CREATED", le statut passe en VALIDATED et le document d'admission est automatiquement édité</p><p class="P16">Sortie : quand on "ARCHIVE" un document "TOBEARCHIVED", le statut passe en ARCHIVED et le document de sortie est automatiquement édité</p><p class="P16">De plus :</p><p class="P16">- Bouton "Doc admission" affiché à partir du statut "VALIDATED"</p><p class="P16">- Bouton "Doc Sortie" affiché à partir du statut TOBEARCHIVED (et donc aussi pour ARCHIVED)</p><p class="P16">Enfin, Le doc de sortie doit être couplée avec la liste des matériels a archiver (TOBEARCHIVED) quand il y a une demande de sortie.</p><p class="P16"> </p><p class="P17"> </p><p class="P1">C - sur les différentes VUES liées au matériel</p><p class="Standard"> </p><p class="P6"><span class="T4">Page accueil </span>:</p><p class="P6"><span> Administration <span class="T20">& Administration Plus </span>voit un menu avec 2 options :</span></p><ul><li><ul><li><ul><li><p class="P51" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0,635cm;">.</span>« Voir les matériels à valider »<span class="odfLiEnd"/> </p></li><li><p class="P52" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0,635cm;">.</span>« Voir les matériels à sortir de l'inventaire »<span class="odfLiEnd"/> </p></li></ul></li></ul><p class="P52" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0cm"><!-- --></span><span class="T21">Responsable </span>voit un menu avec <span class="T21">3</span> options :<span class="odfLiEnd"/> </p><ul><li><ul><li><p class="P52" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0,635cm;">.</span>« Voir les matériels <span class="T21">de mon groupe métier</span> »<span class="odfLiEnd"/> </p></li><li><p class="P52" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0,635cm;">.</span>« Voir les matériels <span class="T21">de mon groupe métier à valider</span> »<span class="odfLiEnd"/> </p></li><li><p class="P52" style="margin-left:0cm;"><span class="WW8Num2z0" style="display:block;float:left;min-width:0,635cm;">.</span>« <span class="T21">Voir les suivis des matériels donc je suis responsable »</span><span class="odfLiEnd"/> </p></li></ul></li></ul></li></ul><p class="P1">Page Outils :</p><p class="P6">User n'a pas accès à cette page</p><p class="P6">Les autres ont quelques options</p><p class="P6">superadmin a ces options en plus :</p><ul><li><p class="P53" style="margin-left:0cm;"><span class="WW8Num4z0" style="display:block;float:left;min-width:0,635cm;">.</span>Configuration générale de l'application<span class="odfLiEnd"></span> </p></li><li><p class="P53" style="margin-left:0cm;"><span class="WW8Num4z0" style="display:block;float:left;min-width:0,635cm;">.</span>Gérer les utilisateurs <span class="T20">privilégiés</span><span class="odfLiEnd"/> </p></li><li><p class="P53" style="margin-left:0cm;"><span class="WW8Num4z0" style="display:block;float:left;min-width:0,635cm;">.</span>Passer en mode debug<span class="odfLiEnd"/> </p></li><li><p class="P54" style="margin-left:0cm;"><span class="WW8Num4z0" style="display:block;float:left;min-width:0,635cm;">.</span>Passer en mode install<span class="odfLiEnd"/> </p></li></ul><p class="P6"> </p><p class="Standard"><span class="T5">Vue materiel/index (liste) </span><span class="T2">: limiter aux </span><span class="T5">matériels actifs</span><span class="T2"> (non archivés)</span></p><ul><li><ul><li><p class="P55" style="margin-left:0cm;"><span class="WW8Num1z0" style="display:block;float:left;min-width:0,635cm;">.</span>Admin<span class="T20">+ </span>voit des boutons pour filtrer par « tous », « à valider », « validés », « à sortir », « archivés »<span class="odfLiEnd"/> </p></li></ul></li></ul><p class="P6"> </p><p class="Standard"><span class="T5">Vue materiel/find </span><span class="T2">: limiter aux </span><span class="T5">matériels actifs</span><span class="T2"> (non archivés)</span></p><p class="P6"><span> Seul le<span class="T20">s</span> profil<span class="T20">s</span> Admin<span class="T20">+ </span>voit TOUS les matériels (y-compris archivés)</span></p><p class="P6"> </p><p class="P6"><span class="T4">Vue materiel/view </span>:</p><p class="P6"><span> boutons « Imprimer Etiquettes » : <span class="T20">resp+</span></span></p><p class="P6"> </p><p class="P6"><span class="T4">Vue materiel/edit </span>:</p><ul><li><p class="P56" style="margin-left:0cm;"><span class="WW8Num5z0" style="display:block;float:left;min-width:0,635cm;">.</span>Etiquette O/N (admin<span class="T20">+)</span><span class="odfLiEnd"/> </p></li><li><p class="P56" style="margin-left:0cm;"><span class="WW8Num5z0" style="display:block;float:left;min-width:0,635cm;">.</span>Statut (<span class="T20">superadmin+)</span><span class="odfLiEnd"/> </p></li><li><p class="P56" style="margin-left:0cm;"><span class="WW8Num5z0" style="display:block;float:left;min-width:0,635cm;">.</span>Informations administratives (admin<span class="T20">+)</span><span class="odfLiEnd"/> </p></li></ul><p class="P6"> </p><p class="P6"> </p><p class="P1"> </p><p class="P19">D - sur un SUIVI et un EMPRUNT</p><p class="P1"> </p><ul><li><p class="P57" style="margin-left:0cm;"><span class="WW8Num3z0" style="display:block;float:left;min-width:0,635cm;">.</span>Dans tous les cas, on ne doit pas pouvoir emprunter ou suivre un materiel non validé (CREATED)<span class="odfLiEnd"/> </p></li><li><p class="P57" style="margin-left:0cm;"><span class="WW8Num3z0" style="display:block;float:left;min-width:0,635cm;">.</span>User a les droits C, R, U (si créateur), D (si créateur)<span class="odfLiEnd"/> </p></li><li><p class="P57" style="margin-left:0cm;"><span class="WW8Num3z0" style="display:block;float:left;min-width:0,635cm;">.</span>Resp+ a les droits C, R, U, D<span class="odfLiEnd"/> </p></li></ul><p class="P4"><span class="T9">Un USER peut modifier/supprimer un emprunt dont il est soit le créateur soit l'emprunteur</span><span class="T19">.</span></p><p class="P12">Un USER qui créé un emprunt ne doit pas pouvoir changer le nom de l'emprunteur (par défaut, c'est lui). Ainsi, il pourra modifier/supprimer cette fiche au besoin plus tard. Par défaut donc, pour un user, emprunt.emprunteur=creator, materiel.responsable=creator</p><p class="P13">Tout le monde peut rechercher un suivi,</p><p class="P5"> </p><p class="P5"> </p><p class="P3">E - sur les UTILISATEURS</p><p class="P4"><span class="T9">Par défaut, superadmin a tous les droits, et les autres profils n'ont que le droit de lecture (</span><span class="T7">view </span><span class="T9">et </span><span class="T7">index</span><span class="T9">)</span></p><p class="P5"> </p><p class="P5"> </p><p class="P3">F - sur tous les autres objets métiers</p><p class="P5">Voici la liste des autres objets métiers :</p><ul><li><p class="P58" style="margin-left:0cm;"><span class="WW8Num7z0" style="display:block;float:left;min-width:0,635cm;">.</span>Catégories (et domaines et sous-catégories)<span class="odfLiEnd"/> </p></li></ul><ul><li><p class="P59" style="margin-left:0cm;"><span class="WW8Num6z0" style="display:block;float:left;min-width:0,635cm;">.</span>Groupes thématiques<span class="odfLiEnd"/> </p></li><li><p class="P59" style="margin-left:0cm;"><span class="WW8Num6z0" style="display:block;float:left;min-width:0,635cm;">.</span>Groupes métiers<span class="odfLiEnd"/> </p></li></ul><p class="P4"><span class="T9">Par défaut, pour tous ces objets, superadmin a tous les droits, admin</span><span class="T10">plus</span><span class="T9"> a tous les droits sauf « delete », et les autres profils n'ont que le droit de lecture (</span><span class="T7">view </span><span class="T9">et </span><span class="T7">index</span><span class="T9">)</span></p> |
118 | 118 | ||
119 | <div class="actions"> | 119 | <div class="actions"> |
120 | <?php echo $this->element('menu') ?> | 120 | <?php echo $this->element('menu') ?> |
src/Template/Pages/home.ctp
src/Template/Pages/home_install.ctp
@@ -13,7 +13,6 @@ | @@ -13,7 +13,6 @@ | ||
13 | * @license http://www.opensource.org/licenses/mit-license.php MIT License | 13 | * @license http://www.opensource.org/licenses/mit-license.php MIT License |
14 | */ | 14 | */ |
15 | use Cake\Cache\Cache; | 15 | use Cake\Cache\Cache; |
16 | -use Cake\Core\Configure; | ||
17 | use Cake\Datasource\ConnectionManager; | 16 | use Cake\Datasource\ConnectionManager; |
18 | use Cake\Error\Debugger; | 17 | use Cake\Error\Debugger; |
19 | 18 | ||
@@ -39,7 +38,7 @@ $this->layout = false; | @@ -39,7 +38,7 @@ $this->layout = false; | ||
39 | </header> | 38 | </header> |
40 | <div id="content"> | 39 | <div id="content"> |
41 | <div class="row"> | 40 | <div class="row"> |
42 | - <div class="columns large-12 ctp-warning checks", style="text-align: center"> | 41 | + <div class="columns large-12 ctp-warning checks" style="text-align: center"> |
43 | <?php echo $this->Form->postLink("Stopper le mode installation", ['controller' => 'configurations', 'action'=>'installOff'], ['confirm' => __('Êtes-vous sur ?')]); ?> | 42 | <?php echo $this->Form->postLink("Stopper le mode installation", ['controller' => 'configurations', 'action'=>'installOff'], ['confirm' => __('Êtes-vous sur ?')]); ?> |
44 | </div> | 43 | </div> |
45 | <?php Debugger::checkSecurityKeys(); ?> | 44 | <?php Debugger::checkSecurityKeys(); ?> |
src/Template/Pages/tools.ctp
1 | 1 | ||
2 | <div class="index"> | 2 | <div class="index"> |
3 | <h2><i class="icon-wrench"></i> Outils</h2> | 3 | <h2><i class="icon-wrench"></i> Outils</h2> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <tr><th></th></tr> | 5 | <tr><th></th></tr> |
6 | <?php | 6 | <?php |
7 | if($role == 'Super Administrateur'): | 7 | if($role == 'Super Administrateur'): |
src/Template/Pages/tools_cat.ctp
1 | 1 | ||
2 | <div class="index"> | 2 | <div class="index"> |
3 | <h2><i class="icon-wrench"></i> Gérer les Catégories</h2> | 3 | <h2><i class="icon-wrench"></i> Gérer les Catégories</h2> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <tr><th></th></tr> | 5 | <tr><th></th></tr> |
6 | <?php | 6 | <?php |
7 | 7 |
src/Template/Pages/tools_menu_cat.ctp
1 | 1 | ||
2 | <div class="index"> | 2 | <div class="index"> |
3 | <h2><i class="icon-wrench"></i> Voir les liste des Catégories</h2> | 3 | <h2><i class="icon-wrench"></i> Voir les liste des Catégories</h2> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <tr><th></th></tr> | 5 | <tr><th></th></tr> |
6 | <?php | 6 | <?php |
7 | 7 |
src/Template/Pages/tools_menu_sm.ctp
1 | <div class="index"> | 1 | <div class="index"> |
2 | <h2><i class="icon-wrench"></i> Voir les autres listes</h2> | 2 | <h2><i class="icon-wrench"></i> Voir les autres listes</h2> |
3 | -<table cellpadding="0" cellspacing="0"> | 3 | +<table style="border-collapse: separate; border-spacing: 0;"> |
4 | <tr><th></th></tr> | 4 | <tr><th></th></tr> |
5 | <?php | 5 | <?php |
6 | 6 |
src/Template/Pages/tools_sm.ctp
1 | <div class="index"> | 1 | <div class="index"> |
2 | <h2><i class="icon-wrench"></i> Gérer le contenu variable de l'application</h2> | 2 | <h2><i class="icon-wrench"></i> Gérer le contenu variable de l'application</h2> |
3 | -<table cellpadding="0" cellspacing="0"> | 3 | +<table style="border-collapse: separate; border-spacing: 0;"> |
4 | <tr><th></th></tr> | 4 | <tr><th></th></tr> |
5 | <?php | 5 | <?php |
6 | 6 |
src/Template/Sites/index.ctp
1 | 1 | ||
2 | <div class="sites index"> | 2 | <div class="sites index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des sites</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des sites</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/SousCategories/index.ctp
1 | 1 | ||
2 | <div class="sousCategories index"> | 2 | <div class="sousCategories index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des sous-catégories</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des sous-catégories</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/Suivis/index.ctp
1 | 1 | ||
2 | <div class="suivis index"> | 2 | <div class="suivis index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des suivis ('.$nbSuivis.')</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des suivis ('.$nbSuivis.')</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/SurCategories/index.ctp
1 | 1 | ||
2 | <div class="surCategories index"> | 2 | <div class="surCategories index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des domaines</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des domaines</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/TypeDocuments/index.ctp
1 | 1 | ||
2 | <div class="typeDocuments index"> | 2 | <div class="typeDocuments index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des types de documents</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des types de documents</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/TypeSuivis/index.ctp
1 | 1 | ||
2 | <div class="typeSuivis index"> | 2 | <div class="typeSuivis index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des types de suivis</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des types de suivis</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
src/Template/Users/index.ctp
1 | 1 | ||
2 | <div class="users index"> | 2 | <div class="users index"> |
3 | <?php echo '<h2><i class="icon-list"></i> Liste des utilisateurs privilégiés ('.$nbUsers.')</h2>'; ?> | 3 | <?php echo '<h2><i class="icon-list"></i> Liste des utilisateurs privilégiés ('.$nbUsers.')</h2>'; ?> |
4 | - <table cellpadding="0" cellspacing="0"> | 4 | + <table style="border-collapse: separate; border-spacing: 0;"> |
5 | <thead> | 5 | <thead> |
6 | <tr> | 6 | <tr> |
7 | <th class="actions"><?= __('') ?></th> | 7 | <th class="actions"><?= __('') ?></th> |
tests/Fixture/ConfigurationsFixture.php
@@ -51,6 +51,7 @@ class ConfigurationsFixture extends TestFixture | @@ -51,6 +51,7 @@ class ConfigurationsFixture extends TestFixture | ||
51 | 'numero_labo_sans_annee' => ['type' => 'boolean', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null], | 51 | 'numero_labo_sans_annee' => ['type' => 'boolean', 'length' => null, 'null' => true, 'default' => null, 'comment' => '', 'precision' => null], |
52 | 'prix_inventaire_administratif' => ['type' => 'integer', 'length' => 10, 'null' => true, 'default' => 800, 'comment' => '', 'precision' => null], | 52 | 'prix_inventaire_administratif' => ['type' => 'integer', 'length' => 10, 'null' => true, 'default' => 800, 'comment' => '', 'precision' => null], |
53 | 'taille_max_doc' => ['type' => 'integer', 'length' => 15, 'null' => true, 'default' => 8000000, 'comment' => '', 'precision' => null], | 53 | 'taille_max_doc' => ['type' => 'integer', 'length' => 15, 'null' => true, 'default' => 8000000, 'comment' => '', 'precision' => null], |
54 | + 'aff_par_defaut' => ['type' => 'integer', 'length' => 6, 'null' => false, 'default' => 20, 'comment' => '', 'precision' => null], | ||
54 | '_constraints' => [ | 55 | '_constraints' => [ |
55 | 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], | 56 | 'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []], |
56 | 'nom_UNIQUE' => ['type' => 'unique', 'columns' => ['nom'], 'length' => []], | 57 | 'nom_UNIQUE' => ['type' => 'unique', 'columns' => ['nom'], 'length' => []], |
tests/TestCase/Controller/MaterielsControllerTest.php
@@ -296,7 +296,7 @@ class MaterielsControllerTest extends IntegrationTestCase | @@ -296,7 +296,7 @@ class MaterielsControllerTest extends IntegrationTestCase | ||
296 | ]; | 296 | ]; |
297 | $this->post('/materiels/edit/2', $data); | 297 | $this->post('/materiels/edit/2', $data); |
298 | $this->get('/materiels/index'); | 298 | $this->get('/materiels/index'); |
299 | - $this->assertResponseContains("Test 6", "Le matériel n'a pas était édité correctement"); | 299 | + $this->assertResponseContains("Test 6", "Le matériel n'a pas été édité correctement"); |
300 | // $this->assertResponseNotContains("Test 2", "Le matériel n'a pas était édité correctement"); | 300 | // $this->assertResponseNotContains("Test 2", "Le matériel n'a pas était édité correctement"); |
301 | 301 | ||
302 | $data2 = [ | 302 | $data2 = [ |
@@ -560,7 +560,8 @@ class MaterielsControllerTest extends IntegrationTestCase | @@ -560,7 +560,8 @@ class MaterielsControllerTest extends IntegrationTestCase | ||
560 | $this->assertResponseContains("TEST COPIE MATERIEL", "La copie du materiel ne se fait pas correctement."); | 560 | $this->assertResponseContains("TEST COPIE MATERIEL", "La copie du materiel ne se fait pas correctement."); |
561 | 561 | ||
562 | } | 562 | } |
563 | - | 563 | + */ |
564 | + | ||
564 | /** | 565 | /** |
565 | * | 566 | * |
566 | * Test updateStatutCreated | 567 | * Test updateStatutCreated |
@@ -0,0 +1,40 @@ | @@ -0,0 +1,40 @@ | ||
1 | +build: false | ||
2 | +platform: x86 | ||
3 | +clone_folder: c:\projects\webmozart\assert | ||
4 | + | ||
5 | +branches: | ||
6 | + only: | ||
7 | + - master | ||
8 | + | ||
9 | +cache: | ||
10 | + - c:\php -> appveyor.yml | ||
11 | + | ||
12 | +init: | ||
13 | + - SET PATH=c:\php;%PATH% | ||
14 | + - SET COMPOSER_NO_INTERACTION=1 | ||
15 | + - SET PHP=1 | ||
16 | + | ||
17 | +install: | ||
18 | + - IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php) | ||
19 | + - cd c:\php | ||
20 | + - IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-7.0.0-nts-Win32-VC14-x86.zip | ||
21 | + - IF %PHP%==1 7z x php-7.0.0-nts-Win32-VC14-x86.zip -y >nul | ||
22 | + - IF %PHP%==1 del /Q *.zip | ||
23 | + - IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat | ||
24 | + - IF %PHP%==1 copy /Y php.ini-development php.ini | ||
25 | + - IF %PHP%==1 echo max_execution_time=1200 >> php.ini | ||
26 | + - IF %PHP%==1 echo date.timezone="UTC" >> php.ini | ||
27 | + - IF %PHP%==1 echo extension_dir=ext >> php.ini | ||
28 | + - IF %PHP%==1 echo extension=php_curl.dll >> php.ini | ||
29 | + - IF %PHP%==1 echo extension=php_openssl.dll >> php.ini | ||
30 | + - IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini | ||
31 | + - IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini | ||
32 | + - appveyor DownloadFile https://getcomposer.org/composer.phar | ||
33 | + - cd c:\projects\webmozart\assert | ||
34 | + - mkdir %APPDATA%\Composer | ||
35 | + - IF %APPVEYOR_REPO_NAME%==webmozart/assert copy /Y .composer-auth.json %APPDATA%\Composer\auth.json | ||
36 | + - composer update --prefer-dist --no-progress --ansi | ||
37 | + | ||
38 | +test_script: | ||
39 | + - cd c:\projects\webmozart\assert | ||
40 | + - vendor\bin\phpunit.bat --verbose |