diff --git a/basics/views.md b/basics/views.md index 1e53956..d25be94 100644 --- a/basics/views.md +++ b/basics/views.md @@ -12,7 +12,9 @@ In case the response header is set to JSON the view will automatically get parse The base view class contains the request as well as the response objects hence it also contains the request/response localization. One of the most important methods is the `getText()` method. This private method allows for module and theme specific translations of defined language elements. -In the template you can simply use `$this->getText({TEXT_ID})` for localized text. All other localization elements can be accessed in a similar way e.g. `$this->l11n->getTemperature()` +In the template you can simply use `$this->getText({TEXT_ID})` for localized text. All other localization elements can be accessed in a similar way e.g. `$this->l11n->getTemperature()`. + +In html templates it's recommended to use `$this->getHtml({TEXT_ID})` as this will savely escape defined strings for html output. In case you would like to escape none pre-defined language strings use `$this->printHtml('string to escape')`. ## Templates diff --git a/datastorage/database/datamapper.md b/datastorage/database/datamapper.md index 94460cd..03e00da 100644 --- a/datastorage/database/datamapper.md +++ b/datastorage/database/datamapper.md @@ -53,6 +53,7 @@ Possible types are: * string * bool * float +* \DateTime * serializable (will call `serialize()`) * json (will call `jsonSerialize()`) diff --git a/datastorage/database/queries.md b/datastorage/database/queries.md index f3d19dc..71107a6 100644 --- a/datastorage/database/queries.md +++ b/datastorage/database/queries.md @@ -16,22 +16,99 @@ The query builder is used for regular CRUD opperations on the database. #### Prefix +Projects often use a prefix for all of the tables. For this project the default prefix is `oms_`. + +```php +$query = new Builder(); +$query->prefix('oms_'); +``` + #### Select, Insert, Update, Delete +Both `select` and `insert` expect the column names as parameter. The `where`, `from` and `into` clause can be necessary depending on the type of operation like a normal sql query. + +```php +$query->prefix(...)->select('columnA', 'columnB')->from('table')->where(...); +$query->prefix(...)->insert('columnA', 'columnB')->values('a', 'b')->into('table'); +``` + +The `update` expects the table name which should be updated and then the `set` function to define the columns and new values. + +```php +$query->prefix(...)->update('table')->set(['columnA' => 'a'])->set(['columnB' => 'b'])->where(...); +``` + +The `delete` function only expects the `from` and `where` clause to identify the to delete columns in a table. + +```php +$query->prefix(...)->delete()->from('table')->where(...); +``` + ##### Random #### From +The `from` part of a query accepts `string`, `array`, `\Closure`, `From`, `Builder` as parameter. + +```php +$query->prefix(...)->select(...)->from('table'); +$query->prefix(...)->select(...)->from('tableA', 'tableB'); +``` + #### Into +The `into` part of a query accepts `string`, `array`, `\Closure`, `Into`, `Builder` as parameter. + #### Where +The basic `where` clause expects a column, operator, value and boolean concatenater which is used to concatenate multiple where clauses. + +```php +$query->prefix(...)->select(...)->from(...)->where('columnA', '=', 123)->where('columnB', '=', 'abc', 'or'); +``` + +For easier use additional `where` clauses are defined such as: + +* `orWhere()` - same as `where` with `or` as default boolean concatenater +* `andWhere()` - same as `where` with `and` as default boolean concatenater +* `whereIn()` - uses the sql `in(...)` +* `whereNull()` - used for null condition +* `whereNotNull()` - used for not null condition + #### Limit +The `limit` expects an integer. + +```php +$query->prefix(...)->select(...)->from(...)->where(...)->limit(3); +``` + #### Offset +The `offset` expects an integer. + +```php +$query->prefix(...)->select(...)->from(...)->where(...)->offset(3); +``` + #### Order +The ordering is performed by `orderBy`. + +```php +$query->prefix(...)->select(...)->from(...)->where(...)->orderBy('columnA', 'DESC'); +``` + +The `newest` and `oldest` operation are a small wrapper which automatically order by `DESC` and `ASC` respectively. + +#### Group By + +Grouping of columns can be achieved through `groupBy`. + +```php +$query->prefix(...)->select(...)->from(...)->where(...)->groupBy('columnA', 'columnB'); +``` + #### Join ### Schema Builder diff --git a/frontend/styles_and_layout.md b/frontend/styles_and_layout.md index 8190bc0..99bfcda 100644 --- a/frontend/styles_and_layout.md +++ b/frontend/styles_and_layout.md @@ -4,6 +4,26 @@ This project only supports scss and css. All css files need to be provided with a scss file which will be processed for every build. The css file has to be minimized, optimized and compressed as `.gz`. This means there is at least one scss file (multiple if you are combining/importing multiple scss files and creating one output css file), one css file and one compressed `.gz` file. The file name has to be lower case and the same for every file and only the extension is different. +## Grid/Flexbox + +Flexboxes are preferred for all content containers. + +```html +
+
+
...
+
+
+``` + +Available sizes are `xs`, `sm`, `md`, `lg` with a grid ranging from `1-12`. + +## Sizes + +### Container + +A container (e.g. section, div, table, etc) can be sized by using `.wf-*` classes. Available sizes for `*` are `100`, `80`, `75`, `66`, `50`, `33`, `25`, `20`. + ## Icons This project uses font-awesome for its icons, the following example allows for stacked icons e.g. creating new/undread email notifications: @@ -14,6 +34,44 @@ This project uses font-awesome for its icons, the following example allows for s ``` +## Form Elements + +### Input with button + +The following snippet creates a 100% input with a button next to it. + +```html +
+
+
+
+``` + +### Input with dictionary + +The following snippet creates a dictionary button (e.g. for opening a popup window to search for accounts/groups etc) right befor an input field. + +```html + + + + +``` + +## Section + +## Tabs + +## Tables + +## Lists + +## Accordion + +## Breadcrumbs + +## Badges/Tags + ## Examples An example of all styles can be found in the tests called `StandardElements.htm`. \ No newline at end of file diff --git a/setup/installation.md b/setup/installation.md index 64523d4..df0cd1d 100644 --- a/setup/installation.md +++ b/setup/installation.md @@ -6,7 +6,17 @@ Installing the application as a developer can be achived by following one of the * PHP >= 7.1 * PDO PHP Extension -* Mbstring PHP Extension + +### Recommended Extensions + +* Memcache +* Sqlite +* Socket +* Curl +* Imap +* bcmath +* zip +* mbstring ## Linux Shell Script @@ -24,7 +34,7 @@ This is the prefered way to install the application since this also installs all ### Annotation -The database user and password can't be changed right now since the install config relies on the same data. Future releases will make use of a new user that will get set up by the install script as well. If you don't have `xdebug` installed but `phpdbg` you can replace `php phpunit.phar ...` with `phpdbg -qrr phpunit.phar ...`. +During this process the database automatically gets dropped (if existing) and re-created. The database user and password can't be changed right now since the install config relies on the same data. Future releases will make use of a new user that will get set up by the install script as well. If you don't have `xdebug` installed but `phpdbg` you can replace `php phpunit.phar ...` with `phpdbg -qrr phpunit.phar ...`. ## FTP Web Install @@ -45,4 +55,4 @@ This only installs an application without any dev tools that may be required by ### Annotation -Re-installing the application this way requires you to drop and re-create the database. +During this process the database automatically gets dropped (if existing) and re-created. diff --git a/standards/documentation.md b/standards/documentation.md index b308a30..4d3e552 100644 --- a/standards/documentation.md +++ b/standards/documentation.md @@ -103,18 +103,52 @@ The scss documentation is based on SassDoc, therefore only valid SassDoc comment ```js /** - * Documentation - * - * Optional example or more detailed description. - * - * @since 1.0.0 + * File description + * + * @category Category name + * @package Package name + * @copyright Orange Management + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://your.url.com */ ``` ### Class +A class documentation MUST be implemented in the following form: + +```js +/** + * Class description. + * + * @category Category name + * @package Package name + * @license OMS License 1.0 + * @link http://your.url.com + * @since 1.0.0 + */ +``` + #### Member #### Function/Method +A function/method documentation MUST be implemented in the following form: + +```js +/** + * Function/method description. + * + * Optional example or more detailed description. + * + * @param {variable_type} param1Name Parameter description + * @param {variable_type} [optionalPara] Parameter description + * + * @return {return_type} + * + * @since 1.0.0 + */ +``` + ### Variable \ No newline at end of file