From 40b5eab33637e715cdcef2ebde47b82c238f212e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 13 Oct 2023 09:55:42 +0200 Subject: [PATCH 01/39] fix: test saturn function exists on constructor load by Dolibarr on Module Page --- core/modules/modEasyCRM.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/modules/modEasyCRM.class.php b/core/modules/modEasyCRM.class.php index f50990b..6d5ce19 100644 --- a/core/modules/modEasyCRM.class.php +++ b/core/modules/modEasyCRM.class.php @@ -244,7 +244,9 @@ public function __construct($db) $pictopath = dol_buildpath('/custom/easycrm/img/easycrm_color.png', 1); $pictoEasycrm = img_picto('', $pictopath, '', 1, 0, 0, '', 'pictoModule'); - $objectsMetadata = saturne_get_objects_metadata(); + if (function_exists('saturne_get_objects_metadata')) { + $objectsMetadata = saturne_get_objects_metadata(); + } $this->tabs = []; if (is_array($objectsMetadata) && !empty($objectsMetadata)) { From e2e7c4213e36c0aef37f3829acfc9376d599792a Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Mon, 13 Nov 2023 16:38:08 +0100 Subject: [PATCH 02/39] #171 [QuickCreation] add: commercial fields --- admin/setup.php | 13 ++++++++++++- core/modules/modEasyCRM.class.php | 1 + core/tpl/easycrm_quickcreation_actions.tpl.php | 11 +++++++++++ core/tpl/easycrm_thirdparty_quickcreation.tpl.php | 8 ++++++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/admin/setup.php b/admin/setup.php index 477244f..f0900dd 100644 --- a/admin/setup.php +++ b/admin/setup.php @@ -205,6 +205,17 @@ print ajax_constantonoff('EASYCRM_THIRDPARTY_WEB_VISIBLE'); print ''; +// Commercial +print ''; +print $langs->trans('AllocateCommercial'); +print ''; +print $langs->trans('ObjectVisibleDescription', $langs->trans('AllocateCommercial')); +print ''; + +print ''; +print ajax_constantonoff('EASYCRM_THIRDPARTY_COMMERCIAL_VISIBLE'); +print ''; + // Private note print ''; print $langs->trans('NotePrivate'); @@ -220,7 +231,7 @@ print ''; print $langs->trans('CustomersProspectsCategoriesShort'); print ''; -print $langs->trans('ObjectVisibleDescription', $langs->trans('CustomersProspectsCategoriesShort')); +print $langs->trans('ObjectVisibleDescription', $langs->transnoentities('CustomersProspectsCategoriesShort')); print ''; print ''; diff --git a/core/modules/modEasyCRM.class.php b/core/modules/modEasyCRM.class.php index f50990b..43db663 100644 --- a/core/modules/modEasyCRM.class.php +++ b/core/modules/modEasyCRM.class.php @@ -178,6 +178,7 @@ public function __construct($db) $i++ => ['EASYCRM_THIRDPARTY_PHONE_VISIBLE', 'integer', 1, '', 0, 'current'], $i++ => ['EASYCRM_THIRDPARTY_EMAIL_VISIBLE', 'integer', 1, '', 0, 'current'], $i++ => ['EASYCRM_THIRDPARTY_WEB_VISIBLE', 'integer', 1, '', 0, 'current'], + $i++ => ['EASYCRM_THIRDPARTY_COMMERCIAL_VISIBLE', 'integer', 1, '', 0, 'current'], $i++ => ['EASYCRM_THIRDPARTY_PRIVATE_NOTE_VISIBLE', 'integer', 1, '', 0, 'current'], $i++ => ['EASYCRM_THIRDPARTY_CATEGORIES_VISIBLE', 'integer', 1, '', 0, 'current'], diff --git a/core/tpl/easycrm_quickcreation_actions.tpl.php b/core/tpl/easycrm_quickcreation_actions.tpl.php index f0bdb32..7484135 100644 --- a/core/tpl/easycrm_quickcreation_actions.tpl.php +++ b/core/tpl/easycrm_quickcreation_actions.tpl.php @@ -31,6 +31,16 @@ if ($thirdpartyID > 0) { $backtopage = dol_buildpath('/societe/card.php', 1) . '?id=' . $thirdpartyID; + // Sales representatives association + $salesReps = GETPOST('commercial', 'array'); + if (count($salesReps) > 0) { + $result = $thirdparty->setSalesRep($salesReps, true); + if ($result < 0) { + setEventMessages($thirdparty->error, $thirdparty->errors, 'errors'); + $error++; + } + } + // Category association $categories = GETPOST('categories_customer', 'array'); if (count($categories) > 0) { @@ -40,6 +50,7 @@ $error++; } } + if (!empty(GETPOST('lastname', 'alpha'))) { $contact->socid = !empty($thirdpartyID) ? $thirdpartyID : ''; $contact->lastname = GETPOST('lastname', 'alpha'); diff --git a/core/tpl/easycrm_thirdparty_quickcreation.tpl.php b/core/tpl/easycrm_thirdparty_quickcreation.tpl.php index e8ac2ae..208ce8a 100644 --- a/core/tpl/easycrm_thirdparty_quickcreation.tpl.php +++ b/core/tpl/easycrm_thirdparty_quickcreation.tpl.php @@ -41,6 +41,14 @@ print ''; } + // Commerical + if ($conf->global->EASYCRM_THIRDPARTY_WEB_VISIBLE > 0) { + print '' . $langs->trans('AllocateCommercial') . ''; + $userList = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, ' AND u.statut = 1 AND u.employee = 1', 0, '', '', 0, 1); + print img_picto('', 'user', 'class="pictofixedwidth"') . $form->multiselectarray('commercial', $userList, GETPOST('commercial', 'array'), '', '', 'quatrevingtpercent widthcentpercentminusx'); + print ''; + } + // Private note if ($conf->global->EASYCRM_THIRDPARTY_PRIVATE_NOTE_VISIBLE > 0 && isModEnabled('fckeditor')) { print ''; From 79f8da1b922018ea4354b7a6a4a6011f987af0cd Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Fri, 24 Nov 2023 14:07:05 +0100 Subject: [PATCH 03/39] #178 [QuickCreation] add: description fields --- admin/setup.php | 11 +++++++++++ core/modules/modEasyCRM.class.php | 1 + core/tpl/easycrm_project_quickcreation.tpl.php | 9 +++++++++ core/tpl/easycrm_quickcreation_actions.tpl.php | 9 +++++---- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/admin/setup.php b/admin/setup.php index f0900dd..47eaccd 100644 --- a/admin/setup.php +++ b/admin/setup.php @@ -357,6 +357,17 @@ print ajax_constantonoff('EASYCRM_PROJECT_DATE_START_VISIBLE'); print ''; +// Description +print ''; +print $langs->trans('Description'); +print ''; +print $langs->trans('ObjectVisibleDescription', $langs->trans('Description')); +print ''; + +print ''; +print ajax_constantonoff('EASYCRM_PROJECT_DESCRIPTION_VISIBLE'); +print ''; + // Extrafields print ''; print $langs->trans('Extrafields'); diff --git a/core/modules/modEasyCRM.class.php b/core/modules/modEasyCRM.class.php index 8543b06..1d33646 100644 --- a/core/modules/modEasyCRM.class.php +++ b/core/modules/modEasyCRM.class.php @@ -196,6 +196,7 @@ public function __construct($db) $i++ => ['EASYCRM_PROJECT_OPPORTUNITY_AMOUNT_VISIBLE', 'integer', 1, '', 0, 'current'], $i++ => ['EASYCRM_PROJECT_OPPORTUNITY_AMOUNT_VALUE', 'integer', 3000, '', 0, 'current'], $i++ => ['EASYCRM_PROJECT_DATE_START_VISIBLE', 'integer', 1, '', 0, 'current'], + $i++ => ['EASYCRM_PROJECT_DESCRIPTION_VISIBLE', 'integer', 1, '', 0, 'current'], $i++ => ['EASYCRM_PROJECT_EXTRAFIELDS_VISIBLE', 'integer', 1, '', 0, 'current'], $i++ => ['EASYCRM_PROJECT_CATEGORIES_VISIBLE', 'integer', 1, '', 0, 'current'], diff --git a/core/tpl/easycrm_project_quickcreation.tpl.php b/core/tpl/easycrm_project_quickcreation.tpl.php index f3546b6..32b53b1 100644 --- a/core/tpl/easycrm_project_quickcreation.tpl.php +++ b/core/tpl/easycrm_project_quickcreation.tpl.php @@ -70,6 +70,15 @@ print ''; } + // Description + if ($conf->global->EASYCRM_PROJECT_DESCRIPTION_VISIBLE > 0 && isModEnabled('fckeditor')) { + print '' . $langs->trans('Description') . ''; + print ''; + $dolEditor = new DolEditor('description', GETPOST('description', 'restricthtml'), '', 90, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $dolEditor->Create(); + print ''; + } + // Other attributes. if ($conf->global->EASYCRM_PROJECT_EXTRAFIELDS_VISIBLE > 0) { $object = $project; diff --git a/core/tpl/easycrm_quickcreation_actions.tpl.php b/core/tpl/easycrm_quickcreation_actions.tpl.php index 7484135..df2468c 100644 --- a/core/tpl/easycrm_quickcreation_actions.tpl.php +++ b/core/tpl/easycrm_quickcreation_actions.tpl.php @@ -72,10 +72,11 @@ } if (!empty(GETPOST('title'))) { - $project->socid = !empty($thirdpartyID) ? $thirdpartyID : ''; - $project->ref = GETPOST('ref'); - $project->title = GETPOST('title'); - $project->opp_status = GETPOST('opp_status', 'int'); + $project->socid = !empty($thirdpartyID) ? $thirdpartyID : ''; + $project->ref = GETPOST('ref'); + $project->title = GETPOST('title'); + $project->description = GETPOST('description', 'restricthtml'); // Do not use 'alpha' here, we want field as it is + $project->opp_status = GETPOST('opp_status', 'int'); $extrafields->fetch_name_optionals_label($project->table_element); $extrafields->setOptionalsFromPost([], $project); From 7024a342666981971a069d6f2f86b93b12a967de Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Fri, 24 Nov 2023 16:26:27 +0100 Subject: [PATCH 04/39] #180 [Admin] add: PWA config lib --- lib/easycrm.lib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/easycrm.lib.php b/lib/easycrm.lib.php index 3ab0815..e51ecd2 100644 --- a/lib/easycrm.lib.php +++ b/lib/easycrm.lib.php @@ -43,6 +43,11 @@ function easycrm_admin_prepare_head(): array $head[$h][2] = 'settings'; $h++; + $head[$h][0] = dol_buildpath('/saturne/admin/pwa.php', 1). '?module_name=EasyCRM&start_url=quickcreation.php'; + $head[$h][1] = $conf->browser->layout != 'phone' ? '' . $langs->trans('PWA') : ''; + $head[$h][2] = 'pwa'; + $h++; + $head[$h][0] = dol_buildpath('/easycrm/admin/address.php', 1); $head[$h][1] = $conf->browser->layout != 'phone' ? '' . $langs->trans('Addresses') : ''; $head[$h][2] = 'address'; From 7b2af2340c6469607127a2e37ad2f13578548b1d Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Wed, 22 Nov 2023 18:25:39 +0100 Subject: [PATCH 05/39] #174 [Mod] add: manifest file --- img/easycrm_color.svg | 1 + img/easycrm_color_192.png | Bin 0 -> 5241 bytes img/easycrm_color_512.png | Bin 0 -> 17791 bytes manifest.json.php | 125 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+) create mode 100644 img/easycrm_color.svg create mode 100644 img/easycrm_color_192.png create mode 100644 img/easycrm_color_512.png create mode 100644 manifest.json.php diff --git a/img/easycrm_color.svg b/img/easycrm_color.svg new file mode 100644 index 0000000..bace48c --- /dev/null +++ b/img/easycrm_color.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/img/easycrm_color_192.png b/img/easycrm_color_192.png new file mode 100644 index 0000000000000000000000000000000000000000..faa4b60aba374e5853cf3e85586e3611857a0a7e GIT binary patch literal 5241 zcmeHL`(G1h)_;bC+(@{lk^~}GAu4LPiXakh5?qC#T`MYepj?88MUAz>x=cV5c|`$5 zixzbPRH+q963myAmW=j)x0AMyU^MPvZ+p7TJ&X0)< zd-vmthknC$tFb2X0t7LJf6o7%z!D$JL$fE zFa%>j3XnffGow%V!@3sCKPGp{TN~ck zgO=s#13#Xi$eeV_#~wDg|3cav+v@Wn?}$%K(1iwd-_`pNnShZ%ekomt?lS4Azs}8! zE45#Y`HF|qrZlh0dKJdGr}6j8z~aH3qDngY*O(j5eZ*yN6+=Nm(Mw?x0v`iEi36>c z5)Jv3s5{%Ot+3c}ofBbN`H$&Rs9P1qCySx>IUORN%sFoLCbFeKP(SJ0KjxGJ>X+^d z)M~Z3qDGx*MW=?j{{|qt+z7=$OIS3H^EZ8IB$xhNc#X;yc&AaMwL-7;Fezk28g+6S zuL)@sroOGV{nGzb!P%hlJ+%)heV7y0CIgjT_)!23`E{@kD2ktmc*EpCjKArfn1;xD zjXION(O};8#PS1@x7c3#$0oCTH@IYCVN#A*0gd=$bfsW0yy+lsgpp9p*$!`#TSnzH ztmqLrGbHIWo44Svf&-Ow_uVQ|GUZ6wPWLL<0CijTrjooUhwG<96;K8}g{-<9R#4?8 zv+m6^)qp1hlg`3C{x_)~g&i;UG#1r=U`x(+IgBl=dRm%7s)c4(rk&m@fL_Y947XP$ zA^{wjcT5*nm59FT%>Lh-1*4fq$vl#R9LBJWW~H&;<)ytemm09va_d4#aUOIskJ=J3 zX)W$9mZp=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terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file manifest.json.php + * \ingroup easycrm + * \brief File for The Web App + */ + +if (!defined('NOREQUIREUSER')) { + define('NOREQUIREUSER', '1'); +} +if (!defined('NOREQUIRESOC')) { + define('NOREQUIRESOC', '1'); +} +if (!defined('NOREQUIRETRAN')) { + define('NOREQUIRETRAN', '1'); +} +if (!defined('NOTOKENRENEWAL')) { + define('NOTOKENRENEWAL', '1'); +} +if (!defined('NOLOGIN')) { + define('NOLOGIN', '1'); +} +if (!defined('NOREQUIREMENU')) { + define('NOREQUIREMENU', '1'); +} +if (!defined('NOREQUIREHTML')) { + define('NOREQUIREHTML', '1'); +} +if (!defined('NOREQUIREAJAX')) { + define('NOREQUIREAJAX', '1'); +} +if (!defined('NOSESSION')) { + define('NOSESSION', '1'); +} +if (!defined('NOCSRFCHECK')) { // We accept to go on this page from external website. + define('NOCSRFCHECK', '1'); +} +if (!defined('NOIPCHECK')) { // Do not check IP defined into conf $dolibarr_main_restrict_ip. + define('NOIPCHECK', '1'); +} +if (!defined('NOBROWSERNOTIF')) { + define('NOBROWSERNOTIF', '1'); +} + +require_once __DIR__ . '/../../main.inc.php'; + +top_httphead('text/json'); + +// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. +if (empty($dolibarr_nocache)) { + header('Cache-Control: max-age=10800, public, must-revalidate'); + // For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server + header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800).' GMT'); +} else { + header('Cache-Control: no-cache'); +} + +// Global variables definitions +global $conf, $moduleNameLowerCase, $langs; + +// Initialize technical objects +$manifest = new stdClass(); + +$manifest->short_name = 'EasyCRM'; +$manifest->name = 'EasyCRM'; +$manifest->icons = []; + +$img = new stdClass(); +$img->src = dol_buildpath('/custom/easycrm/img/easycrm_color.svg', 1); +$img->type = 'image/svg+xml'; +$img->sizes = '150x150'; +$manifest->icons[] = $img; + +$img = new stdClass(); +$img->src = dol_buildpath('/custom/easycrm/img/easycrm_color_192.png', 1); +$img->type = 'image/png'; +$img->sizes = '192x192'; +$manifest->icons[] = $img; + +$img = new stdClass(); +$img->src = dol_buildpath('/custom/easycrm/img/easycrm_color_512.png', 1); +$img->type = 'image/png'; +$img->sizes = '512x512'; +$manifest->icons[] = $img; + +$manifest->id = dol_buildpath('/custom/easycrm/view/frontend/quickcreation.php?source=pwa', 1); +$manifest->start_url = dol_buildpath('/custom/easycrm/view/frontend/quickcreation.php?source=pwa', 1); +$manifest->background_color = '#ffffff'; +$manifest->display = 'standalone'; +$manifest->display_override = ['window-controls-overlay']; +$manifest->scope = dol_buildpath('/custom/easycrm/view/frontend/', 1); +$manifest->theme_color = '#ffffff'; +$manifest->description = 'EasyCRMDescription'; + +$img = new stdClass(); +$img->src = dol_buildpath('/custom/easycrm/img/easycrm_color_512.png', 1); +$img->type = 'image/png'; +$img->sizes = '512x512'; +$img->form_factor = 'narrow'; +$manifest->screenshots[] = $img; + +$img = new stdClass(); +$img->src = dol_buildpath('/custom/easycrm/img/easycrm_color_512.png', 1); +$img->type = 'image/png'; +$img->sizes = '512x512'; +$img->form_factor = 'wide'; +$manifest->screenshots[] = $img; + +print json_encode($manifest); From d289a99b2952b8d89182ae90cac629d3ba258219 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Wed, 22 Nov 2023 18:29:03 +0100 Subject: [PATCH 06/39] #175 [QuickCreation] add: quickcreation project with media gallery --- core/modules/modEasyCRM.class.php | 29 +++- ...crm_project_quickcreation_frontend.tpl.php | 94 ++++++++++++ core/tpl/frontend/index.php | 2 + core/tpl/index.php | 2 + easycrm.main.inc.php | 5 +- view/frontend/index.php | 2 + view/frontend/quickcreation.php | 135 ++++++++++++++++++ view/index.php | 2 + 8 files changed, 268 insertions(+), 3 deletions(-) create mode 100644 core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php create mode 100644 core/tpl/frontend/index.php create mode 100644 core/tpl/index.php create mode 100644 view/frontend/index.php create mode 100644 view/frontend/quickcreation.php create mode 100644 view/index.php diff --git a/core/modules/modEasyCRM.class.php b/core/modules/modEasyCRM.class.php index 1d33646..4c2895d 100644 --- a/core/modules/modEasyCRM.class.php +++ b/core/modules/modEasyCRM.class.php @@ -225,7 +225,16 @@ public function __construct($db) $i++ => ['EASYCRM_VERSION','chaine', $this->version, '', 0, 'current'], $i++ => ['EASYCRM_DB_VERSION', 'chaine', $this->version, '', 0, 'current'], $i++ => ['EASYCRM_SHOW_PATCH_NOTE', 'integer', 1, '', 0, 'current'], - $i => ['EASYCRM_ACTIONCOMM_COMMERCIAL_RELAUNCH_TAG', 'integer', 0, '', 0, 'current'], + $i++ => ['EASYCRM_ACTIONCOMM_COMMERCIAL_RELAUNCH_TAG', 'integer', 0, '', 0, 'current'], + $i++ => ['EASYCRM_MEDIA_MAX_WIDTH_MINI', 'integer', 128, '', 0, 'current'], + $i++ => ['EASYCRM_MEDIA_MAX_HEIGHT_MINI', 'integer', 72, '', 0, 'current'], + $i++ => ['EASYCRM_MEDIA_MAX_WIDTH_SMALL', 'integer', 480, '', 0, 'current'], + $i++ => ['EASYCRM_MEDIA_MAX_HEIGHT_SMALL', 'integer', 270, '', 0, 'current'], + $i++ => ['EASYCRM_MEDIA_MAX_WIDTH_MEDIUM', 'integer', 854, '', 0, 'current'], + $i++ => ['EASYCRM_MEDIA_MAX_HEIGHT_MEDIUM', 'integer', 480, '', 0, 'current'], + $i++ => ['EASYCRM_MEDIA_MAX_WIDTH_LARGE', 'integer', 1280, '', 0, 'current'], + $i++ => ['EASYCRM_MEDIA_MAX_HEIGHT_LARGE', 'integer', 720, '', 0, 'current'], + $i => ['EASYCRM_DISPLAY_NUMBER_MEDIA_GALLERY', 'integer', 8, '', 0, 'current'], ]; // Some keys to add into the overwriting translation tables @@ -451,6 +460,24 @@ public function __construct($db) 'user' => 0, // 0=Menu for internal users, 1=external users, 2=both ]; + $menuEnabled = ($conf->browser->layout != 'classic') ? 1 : 0; + + $this->menu[$r++] = [ + 'fk_menu' => 'fk_mainmenu=easycrm', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type' => 'left', // This is a Top menu entry + 'titre' => $langs->transnoentities('QuickCreation'), + 'prefix' => '', + 'mainmenu' => 'easycrm', + 'leftmenu' => 'quickcreationfrontend', + 'url' => '/easycrm/view/frontend/quickcreation.php', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs' => 'easycrm@easycrm', + 'position' => 1000 + $r, + 'enabled' => $menuEnabled, // Define condition to show or hide menu entry. Use '$conf->easycrm->enabled' if entry must be visible if module is enabled. + 'perms' => '$user->rights->easycrm->read', // Use 'perms'=>'$user->rights->easycrm->myobject->read' if you want your menu with a permission rules + 'target' => '', + 'user' => 0, // 0=Menu for internal users, 1=external users, 2=both + ]; + $this->menu[$r++] = [ 'fk_menu' => 'fk_mainmenu=easycrm', 'type' => 'left', diff --git a/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php b/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php new file mode 100644 index 0000000..a98fd30 --- /dev/null +++ b/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php @@ -0,0 +1,94 @@ +trans('QuickProjectCreation'), '', 'project'); + + print dol_get_fiche_head(); + + print ''; + + $defaultref = ''; + $modele = empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON; + + // Search template files + $file = ''; + $classname = ''; + $filefound = 0; + $dirmodels = array_merge(['/'], $conf->modules_parts['models']); + foreach ($dirmodels as $reldir) { + $file = dol_buildpath($reldir . 'core/modules/project/' . $modele . '.php'); + if (file_exists($file)) { + $filefound = 1; + $classname = $modele; + break; + } + } + + if ($filefound) { + $result = dol_include_once($reldir . 'core/modules/project/' . $modele . '.php'); + $modProject = new $classname(); + + $defaultref = $modProject->getNextValue($thirdparty, $project); + } + + if (is_numeric($defaultref) && $defaultref <= 0) { + $defaultref = ''; + } + + // Ref + $suggestedref = (GETPOST('ref') ? GETPOST('ref') : $defaultref); + print ''; + + // Label + if ($conf->global->EASYCRM_PROJECT_LABEL_VISIBLE > 0) { + print ''; + print ''; + print ''; + } + + // Description + if (isModEnabled('fckeditor')) { + print ''; + print ''; + } + + print ''; + +// // Other attributes. +// if ($conf->global->EASYCRM_PROJECT_EXTRAFIELDS_VISIBLE > 0) { +// $object = $project; +// $extrafields->fetch_name_optionals_label($object->table_element); +// include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; +// $object = ''; +// } + + // Categories + if (isModEnabled('categorie') && $conf->global->EASYCRM_PROJECT_CATEGORIES_VISIBLE > 0) { + print ''; + } + + print '
' . $langs->trans('Description') . ''; + $dolEditor = new DolEditor('description', GETPOST('description', 'restricthtml'), '', 90, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); + $dolEditor->Create(); + print '
' . $langs->trans('Categories') . ''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); + print img_picto('', 'category', 'class="pictofixedwidth"') . $form->multiselectarray('categories_project', $cate_arbo, GETPOST('categories_project', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx'); + print '
'; + + print dol_get_fiche_end(); +} diff --git a/core/tpl/frontend/index.php b/core/tpl/frontend/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/core/tpl/frontend/index.php @@ -0,0 +1,2 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file view/frontend/quickcreation.php + * \ingroup easycrm + * \brief Page to quick creation project on frontend view + */ + +// Load EasyCRM environment +if (file_exists('../easycrm.main.inc.php')) { + require_once __DIR__ . '/../easycrm.main.inc.php'; +} elseif (file_exists('../../easycrm.main.inc.php')) { + require_once __DIR__ . '/../../easycrm.main.inc.php'; +} else { + die('Include of easycrm main fails'); +} + +// Libraries +if (isModEnabled('project')) { + require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; + + require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; +} +if (isModEnabled('fckeditor')) { + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; +} +if (isModEnabled('categorie')) { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; +} + +// Global variables definitions +global $conf, $db, $hookmanager, $langs, $mysoc, $user; + +// Load translation files required by the page +saturne_load_langs(['categories']); + +// Get parameters +$action = GETPOST('action', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'quickcretion'; // To manage different context of search +$cancel = GETPOST('cancel', 'aZ09'); +$backtopage = GETPOST('backtopage', 'alpha'); +$subaction = GETPOST('subaction', 'alpha'); + +// Initialize technical objects +$extrafields = new ExtraFields($db); +if (isModEnabled('project')) { + $project = new Project($db); + $task = new Task($db); +} +if (isModEnabled('categorie')) { + $category = new Categorie($db); +} + +// Initialize view objects +$form = new Form($db); +if (isModEnabled('project')) { + $formproject = new FormProjets($db); +} + +$hookmanager->initHooks(['easycrm_quickcreation']); // Note that conf->hooks_modules contains array + +$date_start = dol_mktime(0, 0, 0, GETPOST('projectstartmonth', 'int'), GETPOST('projectstartday', 'int'), GETPOST('projectstartyear', 'int')); + +// Security check - Protection if external user +$permissiontoread = $user->rights->easycrm->read; +$permissiontoaddproject = $user->rights->projet->creer; +saturne_check_access($permissiontoread); + +/* + * Actions + */ + +$parameters = []; +$reshook = $hookmanager->executeHooks('doActions', $parameters, $project, $action); // Note that $action and $project may have been modified by some hooks +if ($reshook < 0) { + setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { + $error = 0; + + if ($cancel) { + header('Location: ' . dol_buildpath('/easycrm/easycrmindex.php', 1)); + exit; + } + require_once __DIR__ . '/../../core/tpl/easycrm_quickcreation_actions.tpl.php'; +} + +/* + * View + */ + + +$title = $langs->trans('QuickCreation'); +$help_url = 'FR:Module_EasyCRM'; + +saturne_header(1, '', $title, $help_url); + +if (empty($permissiontoaddproject)) { + accessforbidden($langs->trans('NotEnoughPermissions'), 0); + exit; +} + +print '
'; +print ''; +print ''; +if ($backtopage) { + print ''; +} + +require_once __DIR__ . '/../../core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php'; + +print $form->buttonsSaveCancel('Create'); + +print '
'; + +// End of page +llxFooter(); +$db->close(); diff --git a/view/index.php b/view/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/view/index.php @@ -0,0 +1,2 @@ + Date: Fri, 24 Nov 2023 14:50:32 +0100 Subject: [PATCH 07/39] #175 [QuickCreation] add: quickcreation project conf hide menu --- view/frontend/quickcreation.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/view/frontend/quickcreation.php b/view/frontend/quickcreation.php index de41c49..3c433a9 100644 --- a/view/frontend/quickcreation.php +++ b/view/frontend/quickcreation.php @@ -110,6 +110,9 @@ $title = $langs->trans('QuickCreation'); $help_url = 'FR:Module_EasyCRM'; +$conf->dol_hide_topmenu = 1; +$conf->dol_hide_leftmenu = 1; + saturne_header(1, '', $title, $help_url); if (empty($permissiontoaddproject)) { From c25244a60680d988e25b0aefbe012b5f9798620d Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Fri, 24 Nov 2023 15:12:08 +0100 Subject: [PATCH 08/39] #175 [QuickCreation] add: CSS lib pico --- css/index.php | 2 ++ css/pico.min.css | 5 +++++ view/frontend/quickcreation.php | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 css/index.php create mode 100644 css/pico.min.css diff --git a/css/index.php b/css/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/css/index.php @@ -0,0 +1,2 @@ +footer,body>header,body>main,section{--block-spacing-vertical:calc(var(--spacing) * 2.5)}}@media (min-width:768px){body>footer,body>header,body>main,section{--block-spacing-vertical:calc(var(--spacing) * 3)}}@media (min-width:992px){body>footer,body>header,body>main,section{--block-spacing-vertical:calc(var(--spacing) * 3.5)}}@media (min-width:1200px){body>footer,body>header,body>main,section{--block-spacing-vertical:calc(var(--spacing) * 4)}}@media (min-width:576px){article{--block-spacing-horizontal:calc(var(--spacing) * 1.25)}}@media (min-width:768px){article{--block-spacing-horizontal:calc(var(--spacing) * 1.5)}}@media (min-width:992px){article{--block-spacing-horizontal:calc(var(--spacing) * 1.75)}}@media (min-width:1200px){article{--block-spacing-horizontal:calc(var(--spacing) * 2)}}dialog>article{--block-spacing-vertical:calc(var(--spacing) * 2);--block-spacing-horizontal:var(--spacing)}@media (min-width:576px){dialog>article{--block-spacing-vertical:calc(var(--spacing) * 2.5);--block-spacing-horizontal:calc(var(--spacing) * 1.25)}}@media (min-width:768px){dialog>article{--block-spacing-vertical:calc(var(--spacing) * 3);--block-spacing-horizontal:calc(var(--spacing) * 1.5)}}a{--text-decoration:none}a.contrast,a.secondary{--text-decoration:underline}small{--font-size:0.875em}h1,h2,h3,h4,h5,h6{--font-weight:700}h1{--font-size:2rem;--typography-spacing-vertical:3rem}h2{--font-size:1.75rem;--typography-spacing-vertical:2.625rem}h3{--font-size:1.5rem;--typography-spacing-vertical:2.25rem}h4{--font-size:1.25rem;--typography-spacing-vertical:1.874rem}h5{--font-size:1.125rem;--typography-spacing-vertical:1.6875rem}[type=checkbox],[type=radio]{--border-width:2px}[type=checkbox][role=switch]{--border-width:3px}tfoot td,tfoot th,thead td,thead th{--border-width:3px}:not(thead,tfoot)>*>td{--font-size:0.875em}code,kbd,pre,samp{--font-family:"Menlo","Consolas","Roboto Mono","Ubuntu Monospace","Noto Mono","Oxygen Mono","Liberation Mono",monospace,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}kbd{--font-weight:bolder}:root:not([data-theme=dark]),[data-theme=light]{--background-color:#fff;--color:hsl(205, 20%, 32%);--h1-color:hsl(205, 30%, 15%);--h2-color:#24333e;--h3-color:hsl(205, 25%, 23%);--h4-color:#374956;--h5-color:hsl(205, 20%, 32%);--h6-color:#4d606d;--muted-color:hsl(205, 10%, 50%);--muted-border-color:hsl(205, 20%, 94%);--primary:hsl(195, 85%, 41%);--primary-hover:hsl(195, 90%, 32%);--primary-focus:rgba(16, 149, 193, 0.125);--primary-inverse:#fff;--secondary:hsl(205, 15%, 41%);--secondary-hover:hsl(205, 20%, 32%);--secondary-focus:rgba(89, 107, 120, 0.125);--secondary-inverse:#fff;--contrast:hsl(205, 30%, 15%);--contrast-hover:#000;--contrast-focus:rgba(89, 107, 120, 0.125);--contrast-inverse:#fff;--mark-background-color:#fff2ca;--mark-color:#543a26;--ins-color:#388e3c;--del-color:#c62828;--blockquote-border-color:var(--muted-border-color);--blockquote-footer-color:var(--muted-color);--button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--form-element-background-color:transparent;--form-element-border-color:hsl(205, 14%, 68%);--form-element-color:var(--color);--form-element-placeholder-color:var(--muted-color);--form-element-active-background-color:transparent;--form-element-active-border-color:var(--primary);--form-element-focus-color:var(--primary-focus);--form-element-disabled-background-color:hsl(205, 18%, 86%);--form-element-disabled-border-color:hsl(205, 14%, 68%);--form-element-disabled-opacity:0.5;--form-element-invalid-border-color:#c62828;--form-element-invalid-active-border-color:#d32f2f;--form-element-invalid-focus-color:rgba(211, 47, 47, 0.125);--form-element-valid-border-color:#388e3c;--form-element-valid-active-border-color:#43a047;--form-element-valid-focus-color:rgba(67, 160, 71, 0.125);--switch-background-color:hsl(205, 16%, 77%);--switch-color:var(--primary-inverse);--switch-checked-background-color:var(--primary);--range-border-color:hsl(205, 18%, 86%);--range-active-border-color:hsl(205, 16%, 77%);--range-thumb-border-color:var(--background-color);--range-thumb-color:var(--secondary);--range-thumb-hover-color:var(--secondary-hover);--range-thumb-active-color:var(--primary);--table-border-color:var(--muted-border-color);--table-row-stripped-background-color:#f6f8f9;--code-background-color:hsl(205, 20%, 94%);--code-color:var(--muted-color);--code-kbd-background-color:var(--contrast);--code-kbd-color:var(--contrast-inverse);--code-tag-color:hsl(330, 40%, 50%);--code-property-color:hsl(185, 40%, 40%);--code-value-color:hsl(40, 20%, 50%);--code-comment-color:hsl(205, 14%, 68%);--accordion-border-color:var(--muted-border-color);--accordion-close-summary-color:var(--color);--accordion-open-summary-color:var(--muted-color);--card-background-color:var(--background-color);--card-border-color:var(--muted-border-color);--card-box-shadow:0.0145rem 0.029rem 0.174rem rgba(27, 40, 50, 0.01698),0.0335rem 0.067rem 0.402rem rgba(27, 40, 50, 0.024),0.0625rem 0.125rem 0.75rem rgba(27, 40, 50, 0.03),0.1125rem 0.225rem 1.35rem rgba(27, 40, 50, 0.036),0.2085rem 0.417rem 2.502rem rgba(27, 40, 50, 0.04302),0.5rem 1rem 6rem rgba(27, 40, 50, 0.06),0 0 0 0.0625rem rgba(27, 40, 50, 0.015);--card-sectionning-background-color:#fbfbfc;--dropdown-background-color:#fbfbfc;--dropdown-border-color:#e1e6eb;--dropdown-box-shadow:var(--card-box-shadow);--dropdown-color:var(--color);--dropdown-hover-background-color:hsl(205, 20%, 94%);--modal-overlay-background-color:rgba(213, 220, 226, 0.7);--progress-background-color:hsl(205, 18%, 86%);--progress-color:var(--primary);--loading-spinner-opacity:0.5;--tooltip-background-color:var(--contrast);--tooltip-color:var(--contrast-inverse);--icon-checkbox:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--icon-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--icon-chevron-button:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--icon-chevron-button-inverse:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--icon-close:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(115, 130, 140)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");--icon-date:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");--icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(198, 40, 40)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");--icon-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");--icon-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");--icon-time:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(65, 84, 98)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");--icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(56, 142, 60)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");color-scheme:light}@media only screen and (prefers-color-scheme:dark){:root:not([data-theme]){--background-color:#11191f;--color:hsl(205, 16%, 77%);--h1-color:hsl(205, 20%, 94%);--h2-color:#e1e6eb;--h3-color:hsl(205, 18%, 86%);--h4-color:#c8d1d8;--h5-color:hsl(205, 16%, 77%);--h6-color:#afbbc4;--muted-color:hsl(205, 10%, 50%);--muted-border-color:#1f2d38;--primary:hsl(195, 85%, 41%);--primary-hover:hsl(195, 80%, 50%);--primary-focus:rgba(16, 149, 193, 0.25);--primary-inverse:#fff;--secondary:hsl(205, 15%, 41%);--secondary-hover:hsl(205, 10%, 50%);--secondary-focus:rgba(115, 130, 140, 0.25);--secondary-inverse:#fff;--contrast:hsl(205, 20%, 94%);--contrast-hover:#fff;--contrast-focus:rgba(115, 130, 140, 0.25);--contrast-inverse:#000;--mark-background-color:#d1c284;--mark-color:#11191f;--ins-color:#388e3c;--del-color:#c62828;--blockquote-border-color:var(--muted-border-color);--blockquote-footer-color:var(--muted-color);--button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--form-element-background-color:#11191f;--form-element-border-color:#374956;--form-element-color:var(--color);--form-element-placeholder-color:var(--muted-color);--form-element-active-background-color:var(--form-element-background-color);--form-element-active-border-color:var(--primary);--form-element-focus-color:var(--primary-focus);--form-element-disabled-background-color:hsl(205, 25%, 23%);--form-element-disabled-border-color:hsl(205, 20%, 32%);--form-element-disabled-opacity:0.5;--form-element-invalid-border-color:#b71c1c;--form-element-invalid-active-border-color:#c62828;--form-element-invalid-focus-color:rgba(198, 40, 40, 0.25);--form-element-valid-border-color:#2e7d32;--form-element-valid-active-border-color:#388e3c;--form-element-valid-focus-color:rgba(56, 142, 60, 0.25);--switch-background-color:#374956;--switch-color:var(--primary-inverse);--switch-checked-background-color:var(--primary);--range-border-color:#24333e;--range-active-border-color:hsl(205, 25%, 23%);--range-thumb-border-color:var(--background-color);--range-thumb-color:var(--secondary);--range-thumb-hover-color:var(--secondary-hover);--range-thumb-active-color:var(--primary);--table-border-color:var(--muted-border-color);--table-row-stripped-background-color:rgba(115, 130, 140, 0.05);--code-background-color:#18232c;--code-color:var(--muted-color);--code-kbd-background-color:var(--contrast);--code-kbd-color:var(--contrast-inverse);--code-tag-color:hsl(330, 30%, 50%);--code-property-color:hsl(185, 30%, 50%);--code-value-color:hsl(40, 10%, 50%);--code-comment-color:#4d606d;--accordion-border-color:var(--muted-border-color);--accordion-active-summary-color:var(--primary);--accordion-close-summary-color:var(--color);--accordion-open-summary-color:var(--muted-color);--card-background-color:#141e26;--card-border-color:var(--card-background-color);--card-box-shadow:0.0145rem 0.029rem 0.174rem rgba(0, 0, 0, 0.01698),0.0335rem 0.067rem 0.402rem rgba(0, 0, 0, 0.024),0.0625rem 0.125rem 0.75rem rgba(0, 0, 0, 0.03),0.1125rem 0.225rem 1.35rem rgba(0, 0, 0, 0.036),0.2085rem 0.417rem 2.502rem rgba(0, 0, 0, 0.04302),0.5rem 1rem 6rem rgba(0, 0, 0, 0.06),0 0 0 0.0625rem rgba(0, 0, 0, 0.015);--card-sectionning-background-color:#18232c;--dropdown-background-color:hsl(205, 30%, 15%);--dropdown-border-color:#24333e;--dropdown-box-shadow:var(--card-box-shadow);--dropdown-color:var(--color);--dropdown-hover-background-color:rgba(36, 51, 62, 0.75);--modal-overlay-background-color:rgba(36, 51, 62, 0.8);--progress-background-color:#24333e;--progress-color:var(--primary);--loading-spinner-opacity:0.5;--tooltip-background-color:var(--contrast);--tooltip-color:var(--contrast-inverse);--icon-checkbox:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--icon-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--icon-chevron-button:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--icon-chevron-button-inverse:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(0, 0, 0)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--icon-close:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(115, 130, 140)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");--icon-date:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");--icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(183, 28, 28)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");--icon-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");--icon-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");--icon-time:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");--icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(46, 125, 50)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");color-scheme:dark}}[data-theme=dark]{--background-color:#11191f;--color:hsl(205, 16%, 77%);--h1-color:hsl(205, 20%, 94%);--h2-color:#e1e6eb;--h3-color:hsl(205, 18%, 86%);--h4-color:#c8d1d8;--h5-color:hsl(205, 16%, 77%);--h6-color:#afbbc4;--muted-color:hsl(205, 10%, 50%);--muted-border-color:#1f2d38;--primary:hsl(195, 85%, 41%);--primary-hover:hsl(195, 80%, 50%);--primary-focus:rgba(16, 149, 193, 0.25);--primary-inverse:#fff;--secondary:hsl(205, 15%, 41%);--secondary-hover:hsl(205, 10%, 50%);--secondary-focus:rgba(115, 130, 140, 0.25);--secondary-inverse:#fff;--contrast:hsl(205, 20%, 94%);--contrast-hover:#fff;--contrast-focus:rgba(115, 130, 140, 0.25);--contrast-inverse:#000;--mark-background-color:#d1c284;--mark-color:#11191f;--ins-color:#388e3c;--del-color:#c62828;--blockquote-border-color:var(--muted-border-color);--blockquote-footer-color:var(--muted-color);--button-box-shadow:0 0 0 rgba(0, 0, 0, 0);--button-hover-box-shadow:0 0 0 rgba(0, 0, 0, 0);--form-element-background-color:#11191f;--form-element-border-color:#374956;--form-element-color:var(--color);--form-element-placeholder-color:var(--muted-color);--form-element-active-background-color:var(--form-element-background-color);--form-element-active-border-color:var(--primary);--form-element-focus-color:var(--primary-focus);--form-element-disabled-background-color:hsl(205, 25%, 23%);--form-element-disabled-border-color:hsl(205, 20%, 32%);--form-element-disabled-opacity:0.5;--form-element-invalid-border-color:#b71c1c;--form-element-invalid-active-border-color:#c62828;--form-element-invalid-focus-color:rgba(198, 40, 40, 0.25);--form-element-valid-border-color:#2e7d32;--form-element-valid-active-border-color:#388e3c;--form-element-valid-focus-color:rgba(56, 142, 60, 0.25);--switch-background-color:#374956;--switch-color:var(--primary-inverse);--switch-checked-background-color:var(--primary);--range-border-color:#24333e;--range-active-border-color:hsl(205, 25%, 23%);--range-thumb-border-color:var(--background-color);--range-thumb-color:var(--secondary);--range-thumb-hover-color:var(--secondary-hover);--range-thumb-active-color:var(--primary);--table-border-color:var(--muted-border-color);--table-row-stripped-background-color:rgba(115, 130, 140, 0.05);--code-background-color:#18232c;--code-color:var(--muted-color);--code-kbd-background-color:var(--contrast);--code-kbd-color:var(--contrast-inverse);--code-tag-color:hsl(330, 30%, 50%);--code-property-color:hsl(185, 30%, 50%);--code-value-color:hsl(40, 10%, 50%);--code-comment-color:#4d606d;--accordion-border-color:var(--muted-border-color);--accordion-active-summary-color:var(--primary);--accordion-close-summary-color:var(--color);--accordion-open-summary-color:var(--muted-color);--card-background-color:#141e26;--card-border-color:var(--card-background-color);--card-box-shadow:0.0145rem 0.029rem 0.174rem rgba(0, 0, 0, 0.01698),0.0335rem 0.067rem 0.402rem rgba(0, 0, 0, 0.024),0.0625rem 0.125rem 0.75rem rgba(0, 0, 0, 0.03),0.1125rem 0.225rem 1.35rem rgba(0, 0, 0, 0.036),0.2085rem 0.417rem 2.502rem rgba(0, 0, 0, 0.04302),0.5rem 1rem 6rem rgba(0, 0, 0, 0.06),0 0 0 0.0625rem rgba(0, 0, 0, 0.015);--card-sectionning-background-color:#18232c;--dropdown-background-color:hsl(205, 30%, 15%);--dropdown-border-color:#24333e;--dropdown-box-shadow:var(--card-box-shadow);--dropdown-color:var(--color);--dropdown-hover-background-color:rgba(36, 51, 62, 0.75);--modal-overlay-background-color:rgba(36, 51, 62, 0.8);--progress-background-color:#24333e;--progress-color:var(--primary);--loading-spinner-opacity:0.5;--tooltip-background-color:var(--contrast);--tooltip-color:var(--contrast-inverse);--icon-checkbox:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");--icon-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--icon-chevron-button:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--icon-chevron-button-inverse:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(0, 0, 0)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");--icon-close:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(115, 130, 140)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");--icon-date:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");--icon-invalid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(183, 28, 28)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='8' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'%3E%3C/line%3E%3C/svg%3E");--icon-minus:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(255, 255, 255)' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");--icon-search:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");--icon-time:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(162, 175, 185)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");--icon-valid:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgb(46, 125, 50)' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");color-scheme:dark}[type=checkbox],[type=radio],[type=range],progress{accent-color:var(--primary)}*,::after,::before{box-sizing:border-box;background-repeat:no-repeat}::after,::before{text-decoration:inherit;vertical-align:inherit}:where(:root){-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--background-color);color:var(--color);font-weight:var(--font-weight);font-size:var(--font-size);line-height:var(--line-height);font-family:var(--font-family);text-rendering:optimizeLegibility;overflow-wrap:break-word;cursor:default;-moz-tab-size:4;-o-tab-size:4;tab-size:4}main{display:block}body{width:100%;margin:0}body>footer,body>header,body>main{width:100%;margin-right:auto;margin-left:auto;padding:var(--block-spacing-vertical) 0}.container,.container-fluid{width:100%;margin-right:auto;margin-left:auto;padding-right:var(--spacing);padding-left:var(--spacing)}@media (min-width:576px){.container{max-width:510px;padding-right:0;padding-left:0}}@media (min-width:768px){.container{max-width:700px}}@media (min-width:992px){.container{max-width:920px}}@media (min-width:1200px){.container{max-width:1130px}}section{margin-bottom:var(--block-spacing-vertical)}.grid{grid-column-gap:var(--grid-spacing-horizontal);grid-row-gap:var(--grid-spacing-vertical);display:grid;grid-template-columns:1fr;margin:0}@media (min-width:992px){.grid{grid-template-columns:repeat(auto-fit,minmax(0%,1fr))}}.grid>*{min-width:0}figure{display:block;margin:0;padding:0;overflow-x:auto}figure figcaption{padding:calc(var(--spacing) * .5) 0;color:var(--muted-color)}b,strong{font-weight:bolder}sub,sup{position:relative;font-size:.75em;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}address,blockquote,dl,figure,form,ol,p,pre,table,ul{margin-top:0;margin-bottom:var(--typography-spacing-vertical);color:var(--color);font-style:normal;font-weight:var(--font-weight);font-size:var(--font-size)}[role=link],a{--color:var(--primary);--background-color:transparent;outline:0;background-color:var(--background-color);color:var(--color);-webkit-text-decoration:var(--text-decoration);text-decoration:var(--text-decoration);transition:background-color var(--transition),color var(--transition),box-shadow var(--transition),-webkit-text-decoration var(--transition);transition:background-color var(--transition),color var(--transition),text-decoration var(--transition),box-shadow var(--transition);transition:background-color var(--transition),color var(--transition),text-decoration var(--transition),box-shadow var(--transition),-webkit-text-decoration var(--transition)}[role=link]:is([aria-current],:hover,:active,:focus),a:is([aria-current],:hover,:active,:focus){--color:var(--primary-hover);--text-decoration:underline}[role=link]:focus,a:focus{--background-color:var(--primary-focus)}[role=link].secondary,a.secondary{--color:var(--secondary)}[role=link].secondary:is([aria-current],:hover,:active,:focus),a.secondary:is([aria-current],:hover,:active,:focus){--color:var(--secondary-hover)}[role=link].secondary:focus,a.secondary:focus{--background-color:var(--secondary-focus)}[role=link].contrast,a.contrast{--color:var(--contrast)}[role=link].contrast:is([aria-current],:hover,:active,:focus),a.contrast:is([aria-current],:hover,:active,:focus){--color:var(--contrast-hover)}[role=link].contrast:focus,a.contrast:focus{--background-color:var(--contrast-focus)}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:var(--typography-spacing-vertical);color:var(--color);font-weight:var(--font-weight);font-size:var(--font-size);font-family:var(--font-family)}h1{--color:var(--h1-color)}h2{--color:var(--h2-color)}h3{--color:var(--h3-color)}h4{--color:var(--h4-color)}h5{--color:var(--h5-color)}h6{--color:var(--h6-color)}:where(address,blockquote,dl,figure,form,ol,p,pre,table,ul)~:is(h1,h2,h3,h4,h5,h6){margin-top:var(--typography-spacing-vertical)}.headings,hgroup{margin-bottom:var(--typography-spacing-vertical)}.headings>*,hgroup>*{margin-bottom:0}.headings>:last-child,hgroup>:last-child{--color:var(--muted-color);--font-weight:unset;font-size:1rem;font-family:unset}p{margin-bottom:var(--typography-spacing-vertical)}small{font-size:var(--font-size)}:where(dl,ol,ul){padding-right:0;padding-left:var(--spacing);-webkit-padding-start:var(--spacing);padding-inline-start:var(--spacing);-webkit-padding-end:0;padding-inline-end:0}:where(dl,ol,ul) li{margin-bottom:calc(var(--typography-spacing-vertical) * .25)}:where(dl,ol,ul) :is(dl,ol,ul){margin:0;margin-top:calc(var(--typography-spacing-vertical) * .25)}ul li{list-style:square}mark{padding:.125rem .25rem;background-color:var(--mark-background-color);color:var(--mark-color);vertical-align:baseline}blockquote{display:block;margin:var(--typography-spacing-vertical) 0;padding:var(--spacing);border-right:none;border-left:.25rem solid var(--blockquote-border-color);-webkit-border-start:0.25rem solid var(--blockquote-border-color);border-inline-start:0.25rem solid var(--blockquote-border-color);-webkit-border-end:none;border-inline-end:none}blockquote footer{margin-top:calc(var(--typography-spacing-vertical) * .5);color:var(--blockquote-footer-color)}abbr[title]{border-bottom:1px dotted;text-decoration:none;cursor:help}ins{color:var(--ins-color);text-decoration:none}del{color:var(--del-color)}::-moz-selection{background-color:var(--primary-focus)}::selection{background-color:var(--primary-focus)}:where(audio,canvas,iframe,img,svg,video){vertical-align:middle}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}:where(iframe){border-style:none}img{max-width:100%;height:auto;border-style:none}:where(svg:not([fill])){fill:currentColor}svg:not(:root){overflow:hidden}button{margin:0;overflow:visible;font-family:inherit;text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}button{display:block;width:100%;margin-bottom:var(--spacing)}[role=button]{display:inline-block;text-decoration:none}[role=button],button,input[type=button],input[type=reset],input[type=submit]{--background-color:var(--primary);--border-color:var(--primary);--color:var(--primary-inverse);--box-shadow:var(--button-box-shadow, 0 0 0 rgba(0, 0, 0, 0));padding:var(--form-element-spacing-vertical) var(--form-element-spacing-horizontal);border:var(--border-width) solid var(--border-color);border-radius:var(--border-radius);outline:0;background-color:var(--background-color);box-shadow:var(--box-shadow);color:var(--color);font-weight:var(--font-weight);font-size:1rem;line-height:var(--line-height);text-align:center;cursor:pointer;transition:background-color var(--transition),border-color var(--transition),color var(--transition),box-shadow var(--transition)}[role=button]:is([aria-current],:hover,:active,:focus),button:is([aria-current],:hover,:active,:focus),input[type=button]:is([aria-current],:hover,:active,:focus),input[type=reset]:is([aria-current],:hover,:active,:focus),input[type=submit]:is([aria-current],:hover,:active,:focus){--background-color:var(--primary-hover);--border-color:var(--primary-hover);--box-shadow:var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0));--color:var(--primary-inverse)}[role=button]:focus,button:focus,input[type=button]:focus,input[type=reset]:focus,input[type=submit]:focus{--box-shadow:var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--outline-width) var(--primary-focus)}:is(button,input[type=submit],input[type=button],[role=button]).secondary,input[type=reset]{--background-color:var(--secondary);--border-color:var(--secondary);--color:var(--secondary-inverse);cursor:pointer}:is(button,input[type=submit],input[type=button],[role=button]).secondary:is([aria-current],:hover,:active,:focus),input[type=reset]:is([aria-current],:hover,:active,:focus){--background-color:var(--secondary-hover);--border-color:var(--secondary-hover);--color:var(--secondary-inverse)}:is(button,input[type=submit],input[type=button],[role=button]).secondary:focus,input[type=reset]:focus{--box-shadow:var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--outline-width) var(--secondary-focus)}:is(button,input[type=submit],input[type=button],[role=button]).contrast{--background-color:var(--contrast);--border-color:var(--contrast);--color:var(--contrast-inverse)}:is(button,input[type=submit],input[type=button],[role=button]).contrast:is([aria-current],:hover,:active,:focus){--background-color:var(--contrast-hover);--border-color:var(--contrast-hover);--color:var(--contrast-inverse)}:is(button,input[type=submit],input[type=button],[role=button]).contrast:focus{--box-shadow:var(--button-hover-box-shadow, 0 0 0 rgba(0, 0, 0, 0)),0 0 0 var(--outline-width) var(--contrast-focus)}:is(button,input[type=submit],input[type=button],[role=button]).outline,input[type=reset].outline{--background-color:transparent;--color:var(--primary)}:is(button,input[type=submit],input[type=button],[role=button]).outline:is([aria-current],:hover,:active,:focus),input[type=reset].outline:is([aria-current],:hover,:active,:focus){--background-color:transparent;--color:var(--primary-hover)}:is(button,input[type=submit],input[type=button],[role=button]).outline.secondary,input[type=reset].outline{--color:var(--secondary)}:is(button,input[type=submit],input[type=button],[role=button]).outline.secondary:is([aria-current],:hover,:active,:focus),input[type=reset].outline:is([aria-current],:hover,:active,:focus){--color:var(--secondary-hover)}:is(button,input[type=submit],input[type=button],[role=button]).outline.contrast{--color:var(--contrast)}:is(button,input[type=submit],input[type=button],[role=button]).outline.contrast:is([aria-current],:hover,:active,:focus){--color:var(--contrast-hover)}:where(button,[type=submit],[type=button],[type=reset],[role=button])[disabled],:where(fieldset[disabled]) :is(button,[type=submit],[type=button],[type=reset],[role=button]),a[role=button]:not([href]){opacity:.5;pointer-events:none}input,optgroup,select,textarea{margin:0;font-size:1rem;line-height:var(--line-height);font-family:inherit;letter-spacing:inherit}input{overflow:visible}select{text-transform:none}legend{max-width:100%;padding:0;color:inherit;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{padding:0}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}::-moz-focus-inner{padding:0;border-style:none}:-moz-focusring{outline:0}:-moz-ui-invalid{box-shadow:none}::-ms-expand{display:none}[type=file],[type=range]{padding:0;border-width:0}input:not([type=checkbox],[type=radio],[type=range]){height:calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2)}fieldset{margin:0;margin-bottom:var(--spacing);padding:0;border:0}fieldset legend,label{display:block;margin-bottom:calc(var(--spacing) * .25);font-weight:var(--form-label-font-weight,var(--font-weight))}input:not([type=checkbox],[type=radio]),select,textarea{width:100%}input:not([type=checkbox],[type=radio],[type=range],[type=file]),select,textarea{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:var(--form-element-spacing-vertical) var(--form-element-spacing-horizontal)}input,select,textarea{--background-color:var(--form-element-background-color);--border-color:var(--form-element-border-color);--color:var(--form-element-color);--box-shadow:none;border:var(--border-width) solid var(--border-color);border-radius:var(--border-radius);outline:0;background-color:var(--background-color);box-shadow:var(--box-shadow);color:var(--color);font-weight:var(--font-weight);transition:background-color var(--transition),border-color var(--transition),color var(--transition),box-shadow var(--transition)}:where(select,textarea):is(:active,:focus),input:not([type=submit],[type=button],[type=reset],[type=checkbox],[type=radio],[readonly]):is(:active,:focus){--background-color:var(--form-element-active-background-color)}:where(select,textarea):is(:active,:focus),input:not([type=submit],[type=button],[type=reset],[role=switch],[readonly]):is(:active,:focus){--border-color:var(--form-element-active-border-color)}input:not([type=submit],[type=button],[type=reset],[type=range],[type=file],[readonly]):focus,select:focus,textarea:focus{--box-shadow:0 0 0 var(--outline-width) var(--form-element-focus-color)}:where(fieldset[disabled]) :is(input:not([type=submit],[type=button],[type=reset]),select,textarea),input:not([type=submit],[type=button],[type=reset])[disabled],select[disabled],textarea[disabled]{--background-color:var(--form-element-disabled-background-color);--border-color:var(--form-element-disabled-border-color);opacity:var(--form-element-disabled-opacity);pointer-events:none}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week])[aria-invalid]{padding-right:calc(var(--form-element-spacing-horizontal) + 1.5rem)!important;padding-left:var(--form-element-spacing-horizontal);-webkit-padding-start:var(--form-element-spacing-horizontal)!important;padding-inline-start:var(--form-element-spacing-horizontal)!important;-webkit-padding-end:calc(var(--form-element-spacing-horizontal) + 1.5rem)!important;padding-inline-end:calc(var(--form-element-spacing-horizontal) + 1.5rem)!important;background-position:center right .75rem;background-size:1rem auto;background-repeat:no-repeat}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week])[aria-invalid=false]{background-image:var(--icon-valid)}:where(input,select,textarea):not([type=checkbox],[type=radio],[type=date],[type=datetime-local],[type=month],[type=time],[type=week])[aria-invalid=true]{background-image:var(--icon-invalid)}:where(input,select,textarea)[aria-invalid=false]{--border-color:var(--form-element-valid-border-color)}:where(input,select,textarea)[aria-invalid=false]:is(:active,:focus){--border-color:var(--form-element-valid-active-border-color)!important;--box-shadow:0 0 0 var(--outline-width) var(--form-element-valid-focus-color)!important}:where(input,select,textarea)[aria-invalid=true]{--border-color:var(--form-element-invalid-border-color)}:where(input,select,textarea)[aria-invalid=true]:is(:active,:focus){--border-color:var(--form-element-invalid-active-border-color)!important;--box-shadow:0 0 0 var(--outline-width) var(--form-element-invalid-focus-color)!important}[dir=rtl] :where(input,select,textarea):not([type=checkbox],[type=radio]):is([aria-invalid],[aria-invalid=true],[aria-invalid=false]){background-position:center left .75rem}input::-webkit-input-placeholder,input::placeholder,select:invalid,textarea::-webkit-input-placeholder,textarea::placeholder{color:var(--form-element-placeholder-color);opacity:1}input:not([type=checkbox],[type=radio]),select,textarea{margin-bottom:var(--spacing)}select::-ms-expand{border:0;background-color:transparent}select:not([multiple],[size]){padding-right:calc(var(--form-element-spacing-horizontal) + 1.5rem);padding-left:var(--form-element-spacing-horizontal);-webkit-padding-start:var(--form-element-spacing-horizontal);padding-inline-start:var(--form-element-spacing-horizontal);-webkit-padding-end:calc(var(--form-element-spacing-horizontal) + 1.5rem);padding-inline-end:calc(var(--form-element-spacing-horizontal) + 1.5rem);background-image:var(--icon-chevron);background-position:center right .75rem;background-size:1rem auto;background-repeat:no-repeat}[dir=rtl] select:not([multiple],[size]){background-position:center left .75rem}:where(input,select,textarea,.grid)+small{display:block;width:100%;margin-top:calc(var(--spacing) * -.75);margin-bottom:var(--spacing);color:var(--muted-color)}label>:where(input,select,textarea){margin-top:calc(var(--spacing) * .25)}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:1.25em;height:1.25em;margin-top:-.125em;margin-right:.375em;margin-left:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:.375em;margin-inline-end:.375em;border-width:var(--border-width);font-size:inherit;vertical-align:middle;cursor:pointer}[type=checkbox]::-ms-check,[type=radio]::-ms-check{display:none}[type=checkbox]:checked,[type=checkbox]:checked:active,[type=checkbox]:checked:focus,[type=radio]:checked,[type=radio]:checked:active,[type=radio]:checked:focus{--background-color:var(--primary);--border-color:var(--primary);background-image:var(--icon-checkbox);background-position:center;background-size:.75em auto;background-repeat:no-repeat}[type=checkbox]~label,[type=radio]~label{display:inline-block;margin-right:.375em;margin-bottom:0;cursor:pointer}[type=checkbox]:indeterminate{--background-color:var(--primary);--border-color:var(--primary);background-image:var(--icon-minus);background-position:center;background-size:.75em auto;background-repeat:no-repeat}[type=radio]{border-radius:50%}[type=radio]:checked,[type=radio]:checked:active,[type=radio]:checked:focus{--background-color:var(--primary-inverse);border-width:.35em;background-image:none}[type=checkbox][role=switch]{--background-color:var(--switch-background-color);--border-color:var(--switch-background-color);--color:var(--switch-color);width:2.25em;height:1.25em;border:var(--border-width) solid var(--border-color);border-radius:1.25em;background-color:var(--background-color);line-height:1.25em}[type=checkbox][role=switch]:focus{--background-color:var(--switch-background-color);--border-color:var(--switch-background-color)}[type=checkbox][role=switch]:checked{--background-color:var(--switch-checked-background-color);--border-color:var(--switch-checked-background-color)}[type=checkbox][role=switch]:before{display:block;width:calc(1.25em - (var(--border-width) * 2));height:100%;border-radius:50%;background-color:var(--color);content:"";transition:margin .1s ease-in-out}[type=checkbox][role=switch]:checked{background-image:none}[type=checkbox][role=switch]:checked::before{margin-left:calc(1.125em - var(--border-width));-webkit-margin-start:calc(1.125em - var(--border-width));margin-inline-start:calc(1.125em - var(--border-width))}[type=checkbox]:checked[aria-invalid=false],[type=checkbox][aria-invalid=false],[type=checkbox][role=switch]:checked[aria-invalid=false],[type=checkbox][role=switch][aria-invalid=false],[type=radio]:checked[aria-invalid=false],[type=radio][aria-invalid=false]{--border-color:var(--form-element-valid-border-color)}[type=checkbox]:checked[aria-invalid=true],[type=checkbox][aria-invalid=true],[type=checkbox][role=switch]:checked[aria-invalid=true],[type=checkbox][role=switch][aria-invalid=true],[type=radio]:checked[aria-invalid=true],[type=radio][aria-invalid=true]{--border-color:var(--form-element-invalid-border-color)}[type=color]::-webkit-color-swatch-wrapper{padding:0}[type=color]::-moz-focus-inner{padding:0}[type=color]::-webkit-color-swatch{border:0;border-radius:calc(var(--border-radius) * .5)}[type=color]::-moz-color-swatch{border:0;border-radius:calc(var(--border-radius) * .5)}input:not([type=checkbox],[type=radio],[type=range],[type=file]):is([type=date],[type=datetime-local],[type=month],[type=time],[type=week]){--icon-position:0.75rem;--icon-width:1rem;padding-right:calc(var(--icon-width) + var(--icon-position));background-image:var(--icon-date);background-position:center right var(--icon-position);background-size:var(--icon-width) auto;background-repeat:no-repeat}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=time]{background-image:var(--icon-time)}[type=date]::-webkit-calendar-picker-indicator,[type=datetime-local]::-webkit-calendar-picker-indicator,[type=month]::-webkit-calendar-picker-indicator,[type=time]::-webkit-calendar-picker-indicator,[type=week]::-webkit-calendar-picker-indicator{width:var(--icon-width);margin-right:calc(var(--icon-width) * -1);margin-left:var(--icon-position);opacity:0}[dir=rtl] :is([type=date],[type=datetime-local],[type=month],[type=time],[type=week]){text-align:right}[type=file]{--color:var(--muted-color);padding:calc(var(--form-element-spacing-vertical) * .5) 0;border:0;border-radius:0;background:0 0}[type=file]::file-selector-button{--background-color:var(--secondary);--border-color:var(--secondary);--color:var(--secondary-inverse);margin-right:calc(var(--spacing)/ 2);margin-left:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:calc(var(--spacing)/ 2);margin-inline-end:calc(var(--spacing)/ 2);padding:calc(var(--form-element-spacing-vertical) * .5) calc(var(--form-element-spacing-horizontal) * .5);border:var(--border-width) solid var(--border-color);border-radius:var(--border-radius);outline:0;background-color:var(--background-color);box-shadow:var(--box-shadow);color:var(--color);font-weight:var(--font-weight);font-size:1rem;line-height:var(--line-height);text-align:center;cursor:pointer;transition:background-color var(--transition),border-color var(--transition),color var(--transition),box-shadow var(--transition)}[type=file]::file-selector-button:is(:hover,:active,:focus){--background-color:var(--secondary-hover);--border-color:var(--secondary-hover)}[type=file]::-webkit-file-upload-button{--background-color:var(--secondary);--border-color:var(--secondary);--color:var(--secondary-inverse);margin-right:calc(var(--spacing)/ 2);margin-left:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:calc(var(--spacing)/ 2);margin-inline-end:calc(var(--spacing)/ 2);padding:calc(var(--form-element-spacing-vertical) * .5) calc(var(--form-element-spacing-horizontal) * .5);border:var(--border-width) solid var(--border-color);border-radius:var(--border-radius);outline:0;background-color:var(--background-color);box-shadow:var(--box-shadow);color:var(--color);font-weight:var(--font-weight);font-size:1rem;line-height:var(--line-height);text-align:center;cursor:pointer;-webkit-transition:background-color var(--transition),border-color var(--transition),color var(--transition),box-shadow var(--transition);transition:background-color var(--transition),border-color var(--transition),color var(--transition),box-shadow var(--transition)}[type=file]::-webkit-file-upload-button:is(:hover,:active,:focus){--background-color:var(--secondary-hover);--border-color:var(--secondary-hover)}[type=file]::-ms-browse{--background-color:var(--secondary);--border-color:var(--secondary);--color:var(--secondary-inverse);margin-right:calc(var(--spacing)/ 2);margin-left:0;margin-inline-start:0;margin-inline-end:calc(var(--spacing)/ 2);padding:calc(var(--form-element-spacing-vertical) * .5) calc(var(--form-element-spacing-horizontal) * .5);border:var(--border-width) solid var(--border-color);border-radius:var(--border-radius);outline:0;background-color:var(--background-color);box-shadow:var(--box-shadow);color:var(--color);font-weight:var(--font-weight);font-size:1rem;line-height:var(--line-height);text-align:center;cursor:pointer;-ms-transition:background-color var(--transition),border-color var(--transition),color var(--transition),box-shadow var(--transition);transition:background-color var(--transition),border-color var(--transition),color var(--transition),box-shadow var(--transition)}[type=file]::-ms-browse:is(:hover,:active,:focus){--background-color:var(--secondary-hover);--border-color:var(--secondary-hover)}[type=range]{-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;height:1.25rem;background:0 0}[type=range]::-webkit-slider-runnable-track{width:100%;height:.25rem;border-radius:var(--border-radius);background-color:var(--range-border-color);-webkit-transition:background-color var(--transition),box-shadow var(--transition);transition:background-color var(--transition),box-shadow var(--transition)}[type=range]::-moz-range-track{width:100%;height:.25rem;border-radius:var(--border-radius);background-color:var(--range-border-color);-moz-transition:background-color var(--transition),box-shadow var(--transition);transition:background-color var(--transition),box-shadow var(--transition)}[type=range]::-ms-track{width:100%;height:.25rem;border-radius:var(--border-radius);background-color:var(--range-border-color);-ms-transition:background-color var(--transition),box-shadow var(--transition);transition:background-color var(--transition),box-shadow var(--transition)}[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.5rem;border:2px solid var(--range-thumb-border-color);border-radius:50%;background-color:var(--range-thumb-color);cursor:pointer;-webkit-transition:background-color var(--transition),transform var(--transition);transition:background-color var(--transition),transform var(--transition)}[type=range]::-moz-range-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.5rem;border:2px solid var(--range-thumb-border-color);border-radius:50%;background-color:var(--range-thumb-color);cursor:pointer;-moz-transition:background-color var(--transition),transform var(--transition);transition:background-color var(--transition),transform var(--transition)}[type=range]::-ms-thumb{-webkit-appearance:none;width:1.25rem;height:1.25rem;margin-top:-.5rem;border:2px solid var(--range-thumb-border-color);border-radius:50%;background-color:var(--range-thumb-color);cursor:pointer;-ms-transition:background-color var(--transition),transform var(--transition);transition:background-color var(--transition),transform var(--transition)}[type=range]:focus,[type=range]:hover{--range-border-color:var(--range-active-border-color);--range-thumb-color:var(--range-thumb-hover-color)}[type=range]:active{--range-thumb-color:var(--range-thumb-active-color)}[type=range]:active::-webkit-slider-thumb{transform:scale(1.25)}[type=range]:active::-moz-range-thumb{transform:scale(1.25)}[type=range]:active::-ms-thumb{transform:scale(1.25)}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search]{-webkit-padding-start:calc(var(--form-element-spacing-horizontal) + 1.75rem);padding-inline-start:calc(var(--form-element-spacing-horizontal) + 1.75rem);border-radius:5rem;background-image:var(--icon-search);background-position:center left 1.125rem;background-size:1rem auto;background-repeat:no-repeat}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid]{-webkit-padding-start:calc(var(--form-element-spacing-horizontal) + 1.75rem)!important;padding-inline-start:calc(var(--form-element-spacing-horizontal) + 1.75rem)!important;background-position:center left 1.125rem,center right .75rem}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid=false]{background-image:var(--icon-search),var(--icon-valid)}input:not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid=true]{background-image:var(--icon-search),var(--icon-invalid)}[type=search]::-webkit-search-cancel-button{-webkit-appearance:none;display:none}[dir=rtl] :where(input):not([type=checkbox],[type=radio],[type=range],[type=file])[type=search]{background-position:center right 1.125rem}[dir=rtl] :where(input):not([type=checkbox],[type=radio],[type=range],[type=file])[type=search][aria-invalid]{background-position:center right 1.125rem,center left .75rem}:where(table){width:100%;border-collapse:collapse;border-spacing:0;text-indent:0}td,th{padding:calc(var(--spacing)/ 2) var(--spacing);border-bottom:var(--border-width) solid var(--table-border-color);color:var(--color);font-weight:var(--font-weight);font-size:var(--font-size);text-align:left;text-align:start}tfoot td,tfoot th{border-top:var(--border-width) solid var(--table-border-color);border-bottom:0}table[role=grid] tbody tr:nth-child(odd){background-color:var(--table-row-stripped-background-color)}code,kbd,pre,samp{font-size:.875em;font-family:var(--font-family)}pre{-ms-overflow-style:scrollbar;overflow:auto}code,kbd,pre{border-radius:var(--border-radius);background:var(--code-background-color);color:var(--code-color);font-weight:var(--font-weight);line-height:initial}code,kbd{display:inline-block;padding:.375rem .5rem}pre{display:block;margin-bottom:var(--spacing);overflow-x:auto}pre>code{display:block;padding:var(--spacing);background:0 0;font-size:14px;line-height:var(--line-height)}code b{color:var(--code-tag-color);font-weight:var(--font-weight)}code i{color:var(--code-property-color);font-style:normal}code u{color:var(--code-value-color);text-decoration:none}code em{color:var(--code-comment-color);font-style:normal}kbd{background-color:var(--code-kbd-background-color);color:var(--code-kbd-color);vertical-align:baseline}hr{height:0;border:0;border-top:1px solid var(--muted-border-color);color:inherit}[hidden],template{display:none!important}canvas{display:inline-block}details{display:block;margin-bottom:var(--spacing);padding-bottom:var(--spacing);border-bottom:var(--border-width) solid var(--accordion-border-color)}details summary{line-height:1rem;list-style-type:none;cursor:pointer;transition:color var(--transition)}details summary:not([role]){color:var(--accordion-close-summary-color)}details summary::-webkit-details-marker{display:none}details summary::marker{display:none}details summary::-moz-list-bullet{list-style-type:none}details summary::after{display:block;width:1rem;height:1rem;-webkit-margin-start:calc(var(--spacing,1rem) * 0.5);margin-inline-start:calc(var(--spacing,1rem) * .5);float:right;transform:rotate(-90deg);background-image:var(--icon-chevron);background-position:right center;background-size:1rem auto;background-repeat:no-repeat;content:"";transition:transform var(--transition)}details summary:focus{outline:0}details summary:focus:not([role=button]){color:var(--accordion-active-summary-color)}details summary[role=button]{width:100%;text-align:left}details summary[role=button]::after{height:calc(1rem * var(--line-height,1.5));background-image:var(--icon-chevron-button)}details summary[role=button]:not(.outline).contrast::after{background-image:var(--icon-chevron-button-inverse)}details[open]>summary{margin-bottom:calc(var(--spacing))}details[open]>summary:not([role]):not(:focus){color:var(--accordion-open-summary-color)}details[open]>summary::after{transform:rotate(0)}[dir=rtl] details summary{text-align:right}[dir=rtl] details summary::after{float:left;background-position:left center}article{margin:var(--block-spacing-vertical) 0;padding:var(--block-spacing-vertical) var(--block-spacing-horizontal);border-radius:var(--border-radius);background:var(--card-background-color);box-shadow:var(--card-box-shadow)}article>footer,article>header{margin-right:calc(var(--block-spacing-horizontal) * -1);margin-left:calc(var(--block-spacing-horizontal) * -1);padding:calc(var(--block-spacing-vertical) * .66) var(--block-spacing-horizontal);background-color:var(--card-sectionning-background-color)}article>header{margin-top:calc(var(--block-spacing-vertical) * -1);margin-bottom:var(--block-spacing-vertical);border-bottom:var(--border-width) solid var(--card-border-color);border-top-right-radius:var(--border-radius);border-top-left-radius:var(--border-radius)}article>footer{margin-top:var(--block-spacing-vertical);margin-bottom:calc(var(--block-spacing-vertical) * -1);border-top:var(--border-width) solid var(--card-border-color);border-bottom-right-radius:var(--border-radius);border-bottom-left-radius:var(--border-radius)}:root{--scrollbar-width:0px}dialog{display:flex;z-index:999;position:fixed;top:0;right:0;bottom:0;left:0;align-items:center;justify-content:center;width:inherit;min-width:100%;height:inherit;min-height:100%;padding:var(--spacing);border:0;-webkit-backdrop-filter:var(--modal-overlay-backdrop-filter);backdrop-filter:var(--modal-overlay-backdrop-filter);background-color:var(--modal-overlay-background-color);color:var(--color)}dialog article{max-height:calc(100vh - var(--spacing) * 2);overflow:auto}@media (min-width:576px){dialog article{max-width:510px}}@media (min-width:768px){dialog article{max-width:700px}}dialog article>footer,dialog article>header{padding:calc(var(--block-spacing-vertical) * .5) var(--block-spacing-horizontal)}dialog article>header .close{margin:0;margin-left:var(--spacing);float:right}dialog article>footer{text-align:right}dialog article>footer [role=button]{margin-bottom:0}dialog article>footer [role=button]:not(:first-of-type){margin-left:calc(var(--spacing) * .5)}dialog article p:last-of-type{margin:0}dialog article .close{display:block;width:1rem;height:1rem;margin-top:calc(var(--block-spacing-vertical) * -.5);margin-bottom:var(--typography-spacing-vertical);margin-left:auto;background-image:var(--icon-close);background-position:center;background-size:auto 1rem;background-repeat:no-repeat;opacity:.5;transition:opacity var(--transition)}dialog article .close:is([aria-current],:hover,:active,:focus){opacity:1}dialog:not([open]),dialog[open=false]{display:none}.modal-is-open{padding-right:var(--scrollbar-width,0);overflow:hidden;pointer-events:none;touch-action:none}.modal-is-open dialog{pointer-events:auto}:where(.modal-is-opening,.modal-is-closing) dialog,:where(.modal-is-opening,.modal-is-closing) dialog>article{animation-duration:.2s;animation-timing-function:ease-in-out;animation-fill-mode:both}:where(.modal-is-opening,.modal-is-closing) dialog{animation-duration:.8s;animation-name:modal-overlay}:where(.modal-is-opening,.modal-is-closing) dialog>article{animation-delay:.2s;animation-name:modal}.modal-is-closing dialog,.modal-is-closing dialog>article{animation-delay:0s;animation-direction:reverse}@keyframes modal-overlay{from{-webkit-backdrop-filter:none;backdrop-filter:none;background-color:transparent}}@keyframes modal{from{transform:translateY(-100%);opacity:0}}:where(nav li)::before{float:left;content:"​"}nav,nav ul{display:flex}nav{justify-content:space-between}nav ol,nav ul{align-items:center;margin-bottom:0;padding:0;list-style:none}nav ol:first-of-type,nav ul:first-of-type{margin-left:calc(var(--nav-element-spacing-horizontal) * -1)}nav ol:last-of-type,nav ul:last-of-type{margin-right:calc(var(--nav-element-spacing-horizontal) * -1)}nav li{display:inline-block;margin:0;padding:var(--nav-element-spacing-vertical) var(--nav-element-spacing-horizontal)}nav li>*{--spacing:0}nav :where(a,[role=link]){display:inline-block;margin:calc(var(--nav-link-spacing-vertical) * -1) calc(var(--nav-link-spacing-horizontal) * -1);padding:var(--nav-link-spacing-vertical) var(--nav-link-spacing-horizontal);border-radius:var(--border-radius);text-decoration:none}nav :where(a,[role=link]):is([aria-current],:hover,:active,:focus){text-decoration:none}nav[aria-label=breadcrumb]{align-items:center;justify-content:start}nav[aria-label=breadcrumb] ul li:not(:first-child){-webkit-margin-start:var(--nav-link-spacing-horizontal);margin-inline-start:var(--nav-link-spacing-horizontal)}nav[aria-label=breadcrumb] ul li:not(:last-child) ::after{position:absolute;width:calc(var(--nav-link-spacing-horizontal) * 2);-webkit-margin-start:calc(var(--nav-link-spacing-horizontal)/ 2);margin-inline-start:calc(var(--nav-link-spacing-horizontal)/ 2);content:"/";color:var(--muted-color);text-align:center}nav[aria-label=breadcrumb] a[aria-current]{background-color:transparent;color:inherit;text-decoration:none;pointer-events:none}nav [role=button]{margin-right:inherit;margin-left:inherit;padding:var(--nav-link-spacing-vertical) var(--nav-link-spacing-horizontal)}aside li,aside nav,aside ol,aside ul{display:block}aside li{padding:calc(var(--nav-element-spacing-vertical) * .5) var(--nav-element-spacing-horizontal)}aside li a{display:block}aside li [role=button]{margin:inherit}[dir=rtl] nav[aria-label=breadcrumb] ul li:not(:last-child) ::after{content:"\\"}progress{display:inline-block;vertical-align:baseline}progress{-webkit-appearance:none;-moz-appearance:none;display:inline-block;appearance:none;width:100%;height:.5rem;margin-bottom:calc(var(--spacing) * .5);overflow:hidden;border:0;border-radius:var(--border-radius);background-color:var(--progress-background-color);color:var(--progress-color)}progress::-webkit-progress-bar{border-radius:var(--border-radius);background:0 0}progress[value]::-webkit-progress-value{background-color:var(--progress-color)}progress::-moz-progress-bar{background-color:var(--progress-color)}@media (prefers-reduced-motion:no-preference){progress:indeterminate{background:var(--progress-background-color) linear-gradient(to right,var(--progress-color) 30%,var(--progress-background-color) 30%) top left/150% 150% no-repeat;animation:progress-indeterminate 1s linear infinite}progress:indeterminate[value]::-webkit-progress-value{background-color:transparent}progress:indeterminate::-moz-progress-bar{background-color:transparent}}@media (prefers-reduced-motion:no-preference){[dir=rtl] progress:indeterminate{animation-direction:reverse}}@keyframes progress-indeterminate{0%{background-position:200% 0}100%{background-position:-200% 0}}details[role=list],li[role=list]{position:relative}details[role=list] summary+ul,li[role=list]>ul{display:flex;z-index:99;position:absolute;top:auto;right:0;left:0;flex-direction:column;margin:0;padding:0;border:var(--border-width) solid var(--dropdown-border-color);border-radius:var(--border-radius);border-top-right-radius:0;border-top-left-radius:0;background-color:var(--dropdown-background-color);box-shadow:var(--card-box-shadow);color:var(--dropdown-color);white-space:nowrap}details[role=list] summary+ul li,li[role=list]>ul li{width:100%;margin-bottom:0;padding:calc(var(--form-element-spacing-vertical) * .5) var(--form-element-spacing-horizontal);list-style:none}details[role=list] summary+ul li:first-of-type,li[role=list]>ul li:first-of-type{margin-top:calc(var(--form-element-spacing-vertical) * .5)}details[role=list] summary+ul li:last-of-type,li[role=list]>ul li:last-of-type{margin-bottom:calc(var(--form-element-spacing-vertical) * .5)}details[role=list] summary+ul li a,li[role=list]>ul li a{display:block;margin:calc(var(--form-element-spacing-vertical) * -.5) calc(var(--form-element-spacing-horizontal) * -1);padding:calc(var(--form-element-spacing-vertical) * .5) var(--form-element-spacing-horizontal);overflow:hidden;color:var(--dropdown-color);text-decoration:none;text-overflow:ellipsis}details[role=list] summary+ul li a:hover,li[role=list]>ul li a:hover{background-color:var(--dropdown-hover-background-color)}details[role=list] summary::after,li[role=list]>a::after{display:block;width:1rem;height:calc(1rem * var(--line-height,1.5));-webkit-margin-start:0.5rem;margin-inline-start:.5rem;float:right;transform:rotate(0);background-position:right center;background-size:1rem auto;background-repeat:no-repeat;content:""}details[role=list]{padding:0;border-bottom:none}details[role=list] summary{margin-bottom:0}details[role=list] summary:not([role]){height:calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2);padding:var(--form-element-spacing-vertical) var(--form-element-spacing-horizontal);border:var(--border-width) solid var(--form-element-border-color);border-radius:var(--border-radius);background-color:var(--form-element-background-color);color:var(--form-element-placeholder-color);line-height:inherit;cursor:pointer;transition:background-color var(--transition),border-color var(--transition),color var(--transition),box-shadow var(--transition)}details[role=list] summary:not([role]):active,details[role=list] summary:not([role]):focus{border-color:var(--form-element-active-border-color);background-color:var(--form-element-active-background-color)}details[role=list] summary:not([role]):focus{box-shadow:0 0 0 var(--outline-width) var(--form-element-focus-color)}details[role=list][open] summary{border-bottom-right-radius:0;border-bottom-left-radius:0}details[role=list][open] summary::before{display:block;z-index:1;position:fixed;top:0;right:0;bottom:0;left:0;background:0 0;content:"";cursor:default}nav details[role=list] summary,nav li[role=list] a{display:flex;direction:ltr}nav details[role=list] summary+ul,nav li[role=list]>ul{min-width:-moz-fit-content;min-width:fit-content;border-radius:var(--border-radius)}nav details[role=list] summary+ul li a,nav li[role=list]>ul li a{border-radius:0}nav details[role=list] summary,nav details[role=list] summary:not([role]){height:auto;padding:var(--nav-link-spacing-vertical) var(--nav-link-spacing-horizontal)}nav details[role=list][open] summary{border-radius:var(--border-radius)}nav details[role=list] summary+ul{margin-top:var(--outline-width);-webkit-margin-start:0;margin-inline-start:0}nav details[role=list] summary[role=link]{margin-bottom:calc(var(--nav-link-spacing-vertical) * -1);line-height:var(--line-height)}nav details[role=list] summary[role=link]+ul{margin-top:calc(var(--nav-link-spacing-vertical) + var(--outline-width));-webkit-margin-start:calc(var(--nav-link-spacing-horizontal) * -1);margin-inline-start:calc(var(--nav-link-spacing-horizontal) * -1)}li[role=list] a:active~ul,li[role=list] a:focus~ul,li[role=list]:hover>ul{display:flex}li[role=list]>ul{display:none;margin-top:calc(var(--nav-link-spacing-vertical) + var(--outline-width));-webkit-margin-start:calc(var(--nav-element-spacing-horizontal) - var(--nav-link-spacing-horizontal));margin-inline-start:calc(var(--nav-element-spacing-horizontal) - var(--nav-link-spacing-horizontal))}li[role=list]>a::after{background-image:var(--icon-chevron)}label>details[role=list]{margin-top:calc(var(--spacing) * .25);margin-bottom:var(--spacing)}[aria-busy=true]{cursor:progress}[aria-busy=true]:not(input,select,textarea)::before{display:inline-block;width:1em;height:1em;border:.1875em solid currentColor;border-radius:1em;border-right-color:transparent;content:"";vertical-align:text-bottom;vertical-align:-.125em;animation:spinner .75s linear infinite;opacity:var(--loading-spinner-opacity)}[aria-busy=true]:not(input,select,textarea):not(:empty)::before{margin-right:calc(var(--spacing) * .5);margin-left:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:calc(var(--spacing) * .5);margin-inline-end:calc(var(--spacing) * .5)}[aria-busy=true]:not(input,select,textarea):empty{text-align:center}a[aria-busy=true],button[aria-busy=true],input[type=button][aria-busy=true],input[type=reset][aria-busy=true],input[type=submit][aria-busy=true]{pointer-events:none}@keyframes spinner{to{transform:rotate(360deg)}}[data-tooltip]{position:relative}[data-tooltip]:not(a,button,input){border-bottom:1px dotted;text-decoration:none;cursor:help}[data-tooltip]::after,[data-tooltip]::before,[data-tooltip][data-placement=top]::after,[data-tooltip][data-placement=top]::before{display:block;z-index:99;position:absolute;bottom:100%;left:50%;padding:.25rem .5rem;overflow:hidden;transform:translate(-50%,-.25rem);border-radius:var(--border-radius);background:var(--tooltip-background-color);content:attr(data-tooltip);color:var(--tooltip-color);font-style:normal;font-weight:var(--font-weight);font-size:.875rem;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;opacity:0;pointer-events:none}[data-tooltip]::after,[data-tooltip][data-placement=top]::after{padding:0;transform:translate(-50%,0);border-top:.3rem solid;border-right:.3rem solid transparent;border-left:.3rem solid transparent;border-radius:0;background-color:transparent;content:"";color:var(--tooltip-background-color)}[data-tooltip][data-placement=bottom]::after,[data-tooltip][data-placement=bottom]::before{top:100%;bottom:auto;transform:translate(-50%,.25rem)}[data-tooltip][data-placement=bottom]:after{transform:translate(-50%,-.3rem);border:.3rem solid transparent;border-bottom:.3rem solid}[data-tooltip][data-placement=left]::after,[data-tooltip][data-placement=left]::before{top:50%;right:100%;bottom:auto;left:auto;transform:translate(-.25rem,-50%)}[data-tooltip][data-placement=left]:after{transform:translate(.3rem,-50%);border:.3rem solid transparent;border-left:.3rem solid}[data-tooltip][data-placement=right]::after,[data-tooltip][data-placement=right]::before{top:50%;right:auto;bottom:auto;left:100%;transform:translate(.25rem,-50%)}[data-tooltip][data-placement=right]:after{transform:translate(-.3rem,-50%);border:.3rem solid transparent;border-right:.3rem solid}[data-tooltip]:focus::after,[data-tooltip]:focus::before,[data-tooltip]:hover::after,[data-tooltip]:hover::before{opacity:1}@media (hover:hover) and (pointer:fine){[data-tooltip]:hover::after,[data-tooltip]:hover::before,[data-tooltip][data-placement=bottom]:focus::after,[data-tooltip][data-placement=bottom]:focus::before,[data-tooltip][data-placement=bottom]:hover [data-tooltip]:focus::after,[data-tooltip][data-placement=bottom]:hover [data-tooltip]:focus::before{animation-duration:.2s;animation-name:tooltip-slide-top}[data-tooltip]:hover::after,[data-tooltip][data-placement=bottom]:focus::after,[data-tooltip][data-placement=bottom]:hover [data-tooltip]:focus::after{animation-name:tooltip-caret-slide-top}[data-tooltip][data-placement=bottom]:focus::after,[data-tooltip][data-placement=bottom]:focus::before,[data-tooltip][data-placement=bottom]:hover::after,[data-tooltip][data-placement=bottom]:hover::before{animation-duration:.2s;animation-name:tooltip-slide-bottom}[data-tooltip][data-placement=bottom]:focus::after,[data-tooltip][data-placement=bottom]:hover::after{animation-name:tooltip-caret-slide-bottom}[data-tooltip][data-placement=left]:focus::after,[data-tooltip][data-placement=left]:focus::before,[data-tooltip][data-placement=left]:hover::after,[data-tooltip][data-placement=left]:hover::before{animation-duration:.2s;animation-name:tooltip-slide-left}[data-tooltip][data-placement=left]:focus::after,[data-tooltip][data-placement=left]:hover::after{animation-name:tooltip-caret-slide-left}[data-tooltip][data-placement=right]:focus::after,[data-tooltip][data-placement=right]:focus::before,[data-tooltip][data-placement=right]:hover::after,[data-tooltip][data-placement=right]:hover::before{animation-duration:.2s;animation-name:tooltip-slide-right}[data-tooltip][data-placement=right]:focus::after,[data-tooltip][data-placement=right]:hover::after{animation-name:tooltip-caret-slide-right}}@keyframes tooltip-slide-top{from{transform:translate(-50%,.75rem);opacity:0}to{transform:translate(-50%,-.25rem);opacity:1}}@keyframes tooltip-caret-slide-top{from{opacity:0}50%{transform:translate(-50%,-.25rem);opacity:0}to{transform:translate(-50%,0);opacity:1}}@keyframes tooltip-slide-bottom{from{transform:translate(-50%,-.75rem);opacity:0}to{transform:translate(-50%,.25rem);opacity:1}}@keyframes tooltip-caret-slide-bottom{from{opacity:0}50%{transform:translate(-50%,-.5rem);opacity:0}to{transform:translate(-50%,-.3rem);opacity:1}}@keyframes tooltip-slide-left{from{transform:translate(.75rem,-50%);opacity:0}to{transform:translate(-.25rem,-50%);opacity:1}}@keyframes tooltip-caret-slide-left{from{opacity:0}50%{transform:translate(.05rem,-50%);opacity:0}to{transform:translate(.3rem,-50%);opacity:1}}@keyframes tooltip-slide-right{from{transform:translate(-.75rem,-50%);opacity:0}to{transform:translate(.25rem,-50%);opacity:1}}@keyframes tooltip-caret-slide-right{from{opacity:0}50%{transform:translate(-.05rem,-50%);opacity:0}to{transform:translate(-.3rem,-50%);opacity:1}}[aria-controls]{cursor:pointer}[aria-disabled=true],[disabled]{cursor:not-allowed}[aria-hidden=false][hidden]{display:initial}[aria-hidden=false][hidden]:not(:focus){clip:rect(0,0,0,0);position:absolute}[tabindex],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation}[dir=rtl]{direction:rtl}@media (prefers-reduced-motion:reduce){:not([aria-busy=true]),:not([aria-busy=true])::after,:not([aria-busy=true])::before{background-attachment:initial!important;animation-duration:1ms!important;animation-delay:-1ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-delay:0s!important;transition-duration:0s!important}} +/*# sourceMappingURL=pico.min.css.map */ \ No newline at end of file diff --git a/view/frontend/quickcreation.php b/view/frontend/quickcreation.php index 3c433a9..81beeeb 100644 --- a/view/frontend/quickcreation.php +++ b/view/frontend/quickcreation.php @@ -109,11 +109,12 @@ $title = $langs->trans('QuickCreation'); $help_url = 'FR:Module_EasyCRM'; +$moreCSS = ['/easycrm/css/pico.min.css']; $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; -saturne_header(1, '', $title, $help_url); +saturne_header(1, '', $title, $help_url, '', 0, 0, [], $moreCSS); if (empty($permissiontoaddproject)) { accessforbidden($langs->trans('NotEnoughPermissions'), 0); From 18c92ff98691cfd57596465dceedac241c85afd4 Mon Sep 17 00:00:00 2001 From: eoxia-amandine Date: Fri, 24 Nov 2023 16:03:37 +0100 Subject: [PATCH 09/39] #175 [QuickCreation] add: quickcreation project frontend step 1 view --- ...crm_project_quickcreation_frontend.tpl.php | 154 +++++++++--------- view/frontend/quickcreation.php | 2 +- 2 files changed, 76 insertions(+), 80 deletions(-) diff --git a/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php b/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php index a98fd30..5ccce96 100644 --- a/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php +++ b/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php @@ -1,94 +1,90 @@ trans('QuickProjectCreation'), '', 'project'); - - print dol_get_fiche_head(); - - print ''; - - $defaultref = ''; - $modele = empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON; +if ( !permissiontoaddproject) { + exit; +} - // Search template files - $file = ''; - $classname = ''; - $filefound = 0; - $dirmodels = array_merge(['/'], $conf->modules_parts['models']); - foreach ($dirmodels as $reldir) { - $file = dol_buildpath($reldir . 'core/modules/project/' . $modele . '.php'); - if (file_exists($file)) { - $filefound = 1; - $classname = $modele; - break; - } +$defaultref = ''; +$modele = empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON; + +// Search template files +$file = ''; +$classname = ''; +$filefound = 0; +$dirmodels = array_merge(['/'], $conf->modules_parts['models']); +foreach ($dirmodels as $reldir) { + $file = dol_buildpath($reldir . 'core/modules/project/' . $modele . '.php'); + if (file_exists($file)) { + $filefound = 1; + $classname = $modele; + break; } +} - if ($filefound) { - $result = dol_include_once($reldir . 'core/modules/project/' . $modele . '.php'); - $modProject = new $classname(); +if ($filefound) { + $result = dol_include_once($reldir . 'core/modules/project/' . $modele . '.php'); + $modProject = new $classname(); - $defaultref = $modProject->getNextValue($thirdparty, $project); - } + $defaultref = $modProject->getNextValue($thirdparty, $project); +} - if (is_numeric($defaultref) && $defaultref <= 0) { - $defaultref = ''; - } +if (is_numeric($defaultref) && $defaultref <= 0) { + $defaultref = ''; +} - // Ref - $suggestedref = (GETPOST('ref') ? GETPOST('ref') : $defaultref); - print ''; +// Ref +$suggestedref = (GETPOST('ref') ? GETPOST('ref') : $defaultref); +print ''; - // Label - if ($conf->global->EASYCRM_PROJECT_LABEL_VISIBLE > 0) { - print ''; - print ''; - print ''; - } - // Description - if (isModEnabled('fckeditor')) { - print ''; - print ''; - } - print ''; -// // Other attributes. -// if ($conf->global->EASYCRM_PROJECT_EXTRAFIELDS_VISIBLE > 0) { -// $object = $project; -// $extrafields->fetch_name_optionals_label($object->table_element); -// include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; -// $object = ''; -// } - - // Categories - if (isModEnabled('categorie') && $conf->global->EASYCRM_PROJECT_CATEGORIES_VISIBLE > 0) { - print ''; - } - - print '
' . $langs->trans('Description') . ''; - $dolEditor = new DolEditor('description', GETPOST('description', 'restricthtml'), '', 90, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%'); - $dolEditor->Create(); - print '
' . $langs->trans('Categories') . ''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); - print img_picto('', 'category', 'class="pictofixedwidth"') . $form->multiselectarray('categories_project', $cate_arbo, GETPOST('categories_project', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx'); - print '
'; +
+ + + + + + + + + global->EASYCRM_PROJECT_CATEGORIES_VISIBLE > 0) { ?> + + + + + + +
- print dol_get_fiche_end(); -} + + +dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; -saturne_header(1, '', $title, $help_url, '', 0, 0, [], $moreCSS); +saturne_header(1, '', $title, $help_url, '', 0, 0, [], $moreCSS, '', 'quickcreation-frontend'); if (empty($permissiontoaddproject)) { accessforbidden($langs->trans('NotEnoughPermissions'), 0); From c4f57182e4c616286d7ea39e3206e11a21ce9227 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Fri, 24 Nov 2023 16:04:47 +0100 Subject: [PATCH 10/39] #175 [QuickCreation] add: remove form button --- view/frontend/quickcreation.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/view/frontend/quickcreation.php b/view/frontend/quickcreation.php index 998dc61..a5f0e3b 100644 --- a/view/frontend/quickcreation.php +++ b/view/frontend/quickcreation.php @@ -130,8 +130,6 @@ require_once __DIR__ . '/../../core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php'; -print $form->buttonsSaveCancel('Create'); - print ''; // End of page From 0a69de47e39cbcbc43574a41d6378d037cfe9570 Mon Sep 17 00:00:00 2001 From: eoxia-amandine Date: Fri, 24 Nov 2023 16:07:39 +0100 Subject: [PATCH 11/39] #175 [QuickCreation] fix: label textarea --- .../frontend/easycrm_project_quickcreation_frontend.tpl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php b/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php index 5ccce96..16b4f7c 100644 --- a/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php +++ b/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php @@ -1,7 +1,7 @@ From d6b6af36935a7ed1cff0e3eab26e3a5b7f7b1b1f Mon Sep 17 00:00:00 2001 From: eoxia-amandine Date: Fri, 24 Nov 2023 16:40:57 +0100 Subject: [PATCH 12/39] #175 [QuickCreation] add: modal file --- core/tpl/frontend/easycrm_media_editor_frontend.tpl.php | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 core/tpl/frontend/easycrm_media_editor_frontend.tpl.php diff --git a/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php b/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php new file mode 100644 index 0000000..53bdc5b --- /dev/null +++ b/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php @@ -0,0 +1,8 @@ + Date: Tue, 28 Nov 2023 19:41:06 +0100 Subject: [PATCH 13/39] #175 [QuickCreation] add: media editor modal --- .../easycrm_media_editor_frontend.tpl.php | 42 +++++++++++++++++-- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php b/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php index 53bdc5b..ae242fb 100644 --- a/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php +++ b/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php @@ -1,8 +1,42 @@ -// File start + + From bf326b141a706deb7751e6a794ebceead3df2b0e Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Tue, 28 Nov 2023 19:41:29 +0100 Subject: [PATCH 14/39] #175 [JS] add: media editor js action --- js/easycrm.min.js | 2 +- js/modules/quickcreation.js | 233 ++++++++++++++++++++++++++++++++++++ 2 files changed, 234 insertions(+), 1 deletion(-) create mode 100644 js/modules/quickcreation.js diff --git a/js/easycrm.min.js b/js/easycrm.min.js index 9b7c7c6..d7c4b9a 100644 --- a/js/easycrm.min.js +++ b/js/easycrm.min.js @@ -1 +1 @@ -"use strict";window.easycrm||(window.easycrm={},window.easycrm.scriptsLoaded=!1),window.easycrm.scriptsLoaded||(window.easycrm.init=function(){window.easycrm.load_list_script()},window.easycrm.load_list_script=function(){if(!window.easycrm.scriptsLoaded){let e=void 0,s=void 0;for(e in window.easycrm)for(s in window.easycrm[e].init&&window.easycrm[e].init(),window.easycrm[e])window.easycrm[e]&&window.easycrm[e][s]&&window.easycrm[e][s].init&&window.easycrm[e][s].init();window.easycrm.scriptsLoaded=!0}},window.easycrm.refresh=function(){let e=void 0,s=void 0;for(e in window.easycrm)for(s in window.easycrm[e].refresh&&window.easycrm[e].refresh(),window.easycrm[e])window.easycrm[e]&&window.easycrm[e][s]&&window.easycrm[e][s].refresh&&window.easycrm[e][s].refresh()},$(document).ready(window.easycrm.init)),window.easycrm.address={},window.easycrm.address.init=function(){window.easycrm.address.event()},window.easycrm.address.event=function(){$(document).on("click",'[name="favorite_address"]',window.easycrm.address.toggleAddressFavorite)},window.easycrm.address.toggleAddressFavorite=function(){var e=$(this).attr("value");let s=$(this);var r=window.saturne.toolbox.getToken();let i="?";document.URL.match(/\?/)&&(i="&"),$.ajax({url:document.URL+i+"action=toggle_favorite&favorite_id="+e+"&token="+r,type:"POST",processData:!1,contentType:!1,success:function(){var e=$(".fas.fa-star");s.hasClass("far")&&(s.removeClass("far"),s.addClass("fas")),e.removeClass("fas").addClass("far")},error:function(){}})}; \ No newline at end of file +"use strict";window.easycrm||(window.easycrm={},window.easycrm.scriptsLoaded=!1),window.easycrm.scriptsLoaded||(window.easycrm.init=function(){window.easycrm.load_list_script()},window.easycrm.load_list_script=function(){if(!window.easycrm.scriptsLoaded){let a=void 0,e=void 0;for(a in window.easycrm)for(e in window.easycrm[a].init&&window.easycrm[a].init(),window.easycrm[a])window.easycrm[a]&&window.easycrm[a][e]&&window.easycrm[a][e].init&&window.easycrm[a][e].init();window.easycrm.scriptsLoaded=!0}},window.easycrm.refresh=function(){let a=void 0,e=void 0;for(a in window.easycrm)for(e in window.easycrm[a].refresh&&window.easycrm[a].refresh(),window.easycrm[a])window.easycrm[a]&&window.easycrm[a][e]&&window.easycrm[a][e].refresh&&window.easycrm[a][e].refresh()},$(document).ready(window.easycrm.init)),window.easycrm.address={},window.easycrm.address.init=function(){window.easycrm.address.event()},window.easycrm.address.event=function(){$(document).on("click",'[name="favorite_address"]',window.easycrm.address.toggleAddressFavorite)},window.easycrm.address.toggleAddressFavorite=function(){var a=$(this).attr("value");let e=$(this);var i=window.saturne.toolbox.getToken();let n="?";document.URL.match(/\?/)&&(n="&"),$.ajax({url:document.URL+n+"action=toggle_favorite&favorite_id="+a+"&token="+i,type:"POST",processData:!1,contentType:!1,success:function(){var a=$(".fas.fa-star");e.hasClass("far")&&(e.removeClass("far"),e.addClass("fas")),a.removeClass("fas").addClass("far")},error:function(){}})},window.easycrm.quickcreation={},window.easycrm.quickcreation.canvas,window.easycrm.quickcreation.rotation=0,window.easycrm.quickcreation.img,window.easycrm.quickcreation.init=function(){window.easycrm.quickcreation.event()},window.easycrm.quickcreation.event=function(){$(document).on("change","#upload-image",window.easycrm.quickcreation.uploadImage),$(document).on("click",".image-rotate-left",function(){window.easycrm.quickcreation.rotateImage(-90)}),$(document).on("click",".image-rotate-right",function(){window.easycrm.quickcreation.rotateImage(90)}),$(document).on("click",".image-undo",window.easycrm.quickcreation.undoLastDraw),$(document).on("click",".image-erase",window.easycrm.quickcreation.clearCanvas),$(document).on("click",".image-validate",window.easycrm.quickcreation.createImg)},window.easycrm.quickcreation.uploadImage=function(){var a;this.files&&this.files[0]&&((a=new FileReader).onload=function(a){$(document).find(".modal-upload-image").addClass("modal-active"),window.easycrm.quickcreation.drawImageOnCanvas(a)},a.readAsDataURL(this.files[0]))},window.easycrm.quickcreation.rotateImage=function(a){window.easycrm.quickcreation.rotation+=a,$("#canvas").css("transform","rotate("+window.easycrm.quickcreation.rotation+"deg)")},window.easycrm.quickcreation.undoLastDraw=function(){var a=$(this).closest(".modal-upload-image").find("canvas"),e=a[0].signaturePad.toData();e&&(e.pop(),a[0].signaturePad.fromData(e),window.easycrm.quickcreation.drawImageOnCanvas(window.easycrm.quickcreation.img))},window.easycrm.quickcreation.clearCanvas=function(){$(this).closest(".modal-upload-image").find("canvas")[0].signaturePad.clear(),window.easycrm.quickcreation.drawImageOnCanvas(window.easycrm.quickcreation.img)},window.easycrm.quickcreation.drawImageOnCanvas=function(a){var e=Math.max(window.devicePixelRatio||1,1);window.easycrm.quickcreation.canvas=document.querySelector("#modal-upload-image0 canvas"),window.easycrm.quickcreation.canvas.signaturePad=new SignaturePad(window.easycrm.quickcreation.canvas,{penColor:"rgb(175, 175, 175)"}),window.easycrm.quickcreation.canvas.width=200*e,window.easycrm.quickcreation.canvas.height=200*e,window.easycrm.quickcreation.canvas.getContext("2d");let i=window.easycrm.quickcreation.canvas.getContext("2d");window.easycrm.quickcreation.canvas.signaturePad.clear();var n=new Image;n.src=a.target.result,window.easycrm.quickcreation.img=a,n.onload=function(){i.drawImage(n,0,0,window.easycrm.quickcreation.canvas.width,window.easycrm.quickcreation.canvas.height)},window.easycrm.quickcreation.rotation=0},window.easycrm.quickcreation.createImg=function(){var a=$(this).closest(".wpeo-modal").find("canvas")[0].toDataURL("image/png",.5),e=window.saturne.toolbox.getToken(),i=window.saturne.toolbox.getQuerySeparator(document.URL),i=document.URL+i+"action=add_img&token="+e;$.ajax({url:i,type:"POST",processData:!1,contentType:"application/octet-stream",data:JSON.stringify({img:a}),success:function(a){$(".wpeo-modal").removeClass("modal-active"),$(".project-container .linked-medias-list").replaceWith($(a).find(".project-container .linked-medias-list"))},error:function(){}})}; \ No newline at end of file diff --git a/js/modules/quickcreation.js b/js/modules/quickcreation.js new file mode 100644 index 0000000..0d7212d --- /dev/null +++ b/js/modules/quickcreation.js @@ -0,0 +1,233 @@ +/* Copyright (C) 2021-2023 EVARISK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Library javascript to enable Browser notifications + */ + +/** + * \file js/quickcreation.js + * \ingroup easycrm + * \brief JavaScript quickcreation file for module EasyCRM + */ + +/** + * Init quickcreation JS + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + * + * @type {Object} + */ +window.easycrm.quickcreation = {}; + +/** + * Init quickcreation canvas + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + */ +window.easycrm.quickcreation.canvas; + +/** + * Init rotation value of img on canvas + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + */ +window.easycrm.quickcreation.rotation = 0; + +/** + * Init img in canvas + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + */ +window.easycrm.quickcreation.img; + +/** + * QuickCreation init + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + * + * @returns {void} + */ +window.easycrm.quickcreation.init = function() { + window.easycrm.quickcreation.event(); +}; + +/** + * QuickCreation event + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + * + * @returns {void} + */ +window.easycrm.quickcreation.event = function() { + $(document).on('change', '#upload-image', window.easycrm.quickcreation.uploadImage); + $(document).on('click', '.image-rotate-left', function() { window.easycrm.quickcreation.rotateImage(-90); }); + $(document).on('click', '.image-rotate-right', function() { window.easycrm.quickcreation.rotateImage(90); }); + $(document).on('click', '.image-undo', window.easycrm.quickcreation.undoLastDraw); + $(document).on('click', '.image-erase', window.easycrm.quickcreation.clearCanvas); + $(document).on('click', '.image-validate', window.easycrm.quickcreation.createImg); +}; + +window.easycrm.quickcreation.uploadImage = function() { + if (this.files && this.files[0]) { + var reader = new FileReader(); + + reader.onload = function(event) { + $(document).find('.modal-upload-image').addClass('modal-active'); + window.easycrm.quickcreation.drawImageOnCanvas(event); + }; + + reader.readAsDataURL(this.files[0]); + } +}; + +/** + * Rotate image action + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + * + * @returns {void} + */ +window.easycrm.quickcreation.rotateImage = function(degrees) { + window.easycrm.quickcreation.rotation += degrees; + $('#canvas').css('transform', 'rotate(' + window.easycrm.quickcreation.rotation + 'deg)'); +}; + +/** + * Undo last drawing action + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + * + * @return {void} + */ +window.easycrm.quickcreation.undoLastDraw = function() { + let canvas = $(this).closest('.modal-upload-image').find('canvas'); + var data = canvas[0].signaturePad.toData(); + if (data) { + data.pop(); // remove the last dot or line + canvas[0].signaturePad.fromData(data); + // Redraw the image on the canvas + window.easycrm.quickcreation.drawImageOnCanvas(window.easycrm.quickcreation.img); + } +}; + +/** + * Clear canvas action + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + * + * @return {void} + */ +window.easycrm.quickcreation.clearCanvas = function() { + let canvas = $(this).closest('.modal-upload-image').find('canvas'); + canvas[0].signaturePad.clear(); + window.easycrm.quickcreation.drawImageOnCanvas(window.easycrm.quickcreation.img); +}; + +/** + * Draw img on canvas action + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + * + * @return {void} + */ +window.easycrm.quickcreation.drawImageOnCanvas = function(event) { + let ratio = Math.max(window.devicePixelRatio || 1, 1); + window.easycrm.quickcreation.canvas = document.querySelector('#modal-upload-image0 canvas'); + + window.easycrm.quickcreation.canvas.signaturePad = new SignaturePad(window.easycrm.quickcreation.canvas, { + penColor: 'rgb(175, 175, 175)' + }); + + window.easycrm.quickcreation.canvas.width = 200 * ratio; + window.easycrm.quickcreation.canvas.height = 200 * ratio; + window.easycrm.quickcreation.canvas.getContext('2d'); + let context = window.easycrm.quickcreation.canvas.getContext('2d'); + window.easycrm.quickcreation.canvas.signaturePad.clear(); + + // Draw the image on the canvas + var img = new Image(); + img.src = event.target.result; + window.easycrm.quickcreation.img = event; + + img.onload = function() { + context.drawImage(img, 0, 0, window.easycrm.quickcreation.canvas.width, window.easycrm.quickcreation.canvas.height); + }; + + window.easycrm.quickcreation.rotation = 0; // Reset rotation when a new image is selected +}; + +/** + * create img action + * + * @memberof EasyCRM_QuickCreation + * + * @since 1.3.0 + * @version 1.3.0 + * + * @return {void} + */ +window.easycrm.quickcreation.createImg = function() { + let canvas = $(this).closest('.wpeo-modal').find('canvas')[0]; + let img = canvas.toDataURL('image/png', 0.5); + + let token = window.saturne.toolbox.getToken(); + let querySeparator = window.saturne.toolbox.getQuerySeparator(document.URL); + + let url = document.URL + querySeparator + 'action=add_img&token=' + token; + $.ajax({ + url: url, + type: 'POST', + processData: false, + contentType: 'application/octet-stream', + data: JSON.stringify({ + img: img, + }), + success: function(resp) { + $('.wpeo-modal').removeClass('modal-active'); + $('.project-container .linked-medias-list').replaceWith($(resp).find('.project-container .linked-medias-list')); + }, + error: function () {} + }); +}; From b36fdfb9950e824cced42f66f2445cef5830d110 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Tue, 28 Nov 2023 19:42:23 +0100 Subject: [PATCH 15/39] #175 [JS] add: improve quickcreation project frontend --- .../easycrm_media_editor_frontend.tpl.php | 4 +- ...crm_project_quickcreation_frontend.tpl.php | 81 ++++--------- ...crm_quickcreation_actions_frontend.tpl.php | 113 ++++++++++++++++++ js/easycrm.min.js | 2 +- js/modules/quickcreation.js | 16 +-- view/frontend/quickcreation.php | 9 +- 6 files changed, 154 insertions(+), 71 deletions(-) create mode 100644 core/tpl/frontend/easycrm_quickcreation_actions_frontend.tpl.php diff --git a/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php b/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php index ae242fb..9fbcd0e 100644 --- a/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php +++ b/core/tpl/frontend/easycrm_media_editor_frontend.tpl.php @@ -12,10 +12,10 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ -// Quick add project/task -if ( !$permissiontoaddproject) { +/** + * \file core/tpl/actions/easycrm_project_quickcreation_frontend.tpl.php + * \ingroup easycrm + * \brief Template page for quick creation project frontend + */ + +/** + * The following vars must be defined : + * Global : $conf, $langs + * Objects : $form, $project + * Variable : $permissionToAddProject + */ + +// Protection to avoid direct call of template +if (!$permissionToAddProject) { exit; } -require_once __DIR__ . '/easycrm_media_editor_frontend.tpl.php'; +require_once __DIR__ . '/easycrm_media_editor_frontend.tpl.php'; ?> -// File start -?> +
@@ -38,14 +65,14 @@ - +
diff --git a/core/tpl/frontend/easycrm_quickcreation_actions_frontend.tpl.php b/core/tpl/frontend/easycrm_quickcreation_actions_frontend.tpl.php index 33aebcd..fe8c153 100644 --- a/core/tpl/frontend/easycrm_quickcreation_actions_frontend.tpl.php +++ b/core/tpl/frontend/easycrm_quickcreation_actions_frontend.tpl.php @@ -1,11 +1,45 @@ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file core/tpl/frontend/easycrm_quickcreation_actions_frontend.tpl.php + * \ingroup easycrm + * \brief Template page for quick creation action frontend + */ + +/** + * The following vars must be defined : + * Global : $conf, $langs, $user + * Parameters : $action + * Objects : $project, $task + * Variable : $error, $permissionToAddProject + */ + +// Protection to avoid direct call of template +if (!$permissionToAddProject) { + exit; +} if ($action == 'add_img') { $data = json_decode(file_get_contents('php://input'), true); $encodedImage = explode(',', $data['img'])[1]; $decodedImage = base64_decode($encodedImage); - $uploadDir = $conf->easycrm->multidir_output[$conf->entity] . '/project/tmp/0/project_photos/'; + $uploadDir = $conf->easycrm->multidir_output[$conf->entity] . '/project/tmp/0/project_photos/'; if (!dol_is_dir($uploadDir)) { dol_mkdir($uploadDir); } @@ -18,96 +52,81 @@ } if ($action == 'add') { - if (!empty(GETPOST('title'))) { - $db->begin(); - - $numberingModules = [ - 'project' => $conf->global->PROJECT_ADDON - ]; - - list ($projectRef) = saturne_require_objects_mod($numberingModules, $moduleNameLowerCase); - - $project->ref = $projectRef->getNextValue(null, $project); - $project->title = GETPOST('title'); - $project->opp_status = getDolGlobalInt('EASYCRM_PROJECT_OPPORTUNITY_STATUS_VALUE'); - $project->opp_amount = getDolGlobalInt('EASYCRM_PROJECT_OPPORTUNITY_AMOUNT_VALUE'); - $project->date_c = dol_now(); - $project->date_start = dol_now(); - $project->statut = 1; - $project->usage_opportunity = 1; - $project->usage_task = 1; - - $projectID = $project->create($user); - if ($projectID > 0) { - // Category association - $categories = GETPOST('categories_project', 'array'); - if (count($categories) > 0) { - $result = $project->setCategories($categories); - if ($result < 0) { - setEventMessages($project->error, $project->errors, 'errors'); - $error++; - } + $numberingModules = [ + 'project' => $conf->global->PROJECT_ADDON, + 'project/task' => $conf->global->PROJECT_TASK_ADDON, + ]; + + list ($refProjectMod, $refTaskMod) = saturne_require_objects_mod($numberingModules); + + $project->ref = $refProjectMod->getNextValue(null, $project); + $project->title = GETPOST('title'); + $project->opp_status = getDolGlobalInt('EASYCRM_PROJECT_OPPORTUNITY_STATUS_VALUE'); + $project->opp_amount = getDolGlobalInt('EASYCRM_PROJECT_OPPORTUNITY_AMOUNT_VALUE'); + $project->date_c = dol_now(); + $project->date_start = dol_now(); + $project->statut = 1; + $project->usage_opportunity = 1; + $project->usage_task = 1; + + $projectID = $project->create($user); + if ($projectID > 0) { + // Category association + $categories = GETPOST('categories_project', 'array'); + if (count($categories) > 0) { + $result = $project->setCategories($categories); + if ($result < 0) { + setEventMessages($project->error, $project->errors, 'errors'); + $error++; } + } - $pathToProjectImg = $conf->project->multidir_output[$conf->entity] . '/' . $project->ref; - $pathToTmpImg = $conf->easycrm->multidir_output[$conf->entity] . '/project/tmp/0/project_photos/'; - $imgList = dol_dir_list($pathToTmpImg, 'files'); - if (!empty($imgList)) { - foreach ($imgList as $img) { - if (!dol_is_dir($pathToProjectImg)) { - dol_mkdir($pathToProjectImg); - } - - $fullPath = $pathToProjectImg . '/' . $img['name']; - dol_copy($img['fullname'], $fullPath); - - vignette($fullPath, $conf->global->EASYCRM_MEDIA_MAX_WIDTH_MINI, $conf->global->EASYCRM_MEDIA_MAX_HEIGHT_MINI, '_mini'); - vignette($fullPath, $conf->global->EASYCRM_MEDIA_MAX_WIDTH_SMALL, $conf->global->EASYCRM_MEDIA_MAX_HEIGHT_SMALL); - vignette($fullPath, $conf->global->EASYCRM_MEDIA_MAX_WIDTH_MEDIUM, $conf->global->EASYCRM_MEDIA_MAX_HEIGHT_MEDIUM, '_medium'); - vignette($fullPath, $conf->global->EASYCRM_MEDIA_MAX_WIDTH_LARGE, $conf->global->EASYCRM_MEDIA_MAX_HEIGHT_LARGE, '_large'); - unlink($img['fullname']); + $pathToProjectImg = $conf->project->multidir_output[$conf->entity] . '/' . $project->ref; + $pathToTmpImg = $conf->easycrm->multidir_output[$conf->entity] . '/project/tmp/0/project_photos/'; + $imgList = dol_dir_list($pathToTmpImg, 'files'); + if (!empty($imgList)) { + foreach ($imgList as $img) { + if (!dol_is_dir($pathToProjectImg)) { + dol_mkdir($pathToProjectImg); } - } - - $project->add_contact($user->id, 'PROJECTLEADER', 'internal'); - $defaultref = ''; - $obj = empty($conf->global->PROJECT_TASK_ADDON) ? 'mod_task_simple' : $conf->global->PROJECT_TASK_ADDON; + $fullPath = $pathToProjectImg . '/' . $img['name']; + dol_copy($img['fullname'], $fullPath); - if (!empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT . '/core/modules/project/task/' . $conf->global->PROJECT_TASK_ADDON . '.php')) { - require_once DOL_DOCUMENT_ROOT . '/core/modules/project/task/' . $conf->global->PROJECT_TASK_ADDON . '.php'; - $modTask = new $obj(); - $defaultref = $modTask->getNextValue($thirdparty, $task); + vignette($fullPath, $conf->global->EASYCRM_MEDIA_MAX_WIDTH_MINI, $conf->global->EASYCRM_MEDIA_MAX_HEIGHT_MINI, '_mini'); + vignette($fullPath, $conf->global->EASYCRM_MEDIA_MAX_WIDTH_SMALL, $conf->global->EASYCRM_MEDIA_MAX_HEIGHT_SMALL); + vignette($fullPath, $conf->global->EASYCRM_MEDIA_MAX_WIDTH_MEDIUM, $conf->global->EASYCRM_MEDIA_MAX_HEIGHT_MEDIUM, '_medium'); + vignette($fullPath, $conf->global->EASYCRM_MEDIA_MAX_WIDTH_LARGE, $conf->global->EASYCRM_MEDIA_MAX_HEIGHT_LARGE, '_large'); + unlink($img['fullname']); } + } - $task->fk_project = $projectID; - $task->ref = $defaultref; - $task->label = (!empty($conf->global->EASYCRM_TASK_LABEL_VALUE) ? $conf->global->EASYCRM_TASK_LABEL_VALUE : $langs->trans('CommercialFollowUp')) . ' - ' . $project->title; - $task->date_c = dol_now(); - - $taskID = $task->create($user); - if ($taskID > 0) { - $task->add_contact($user->id, 'TASKEXECUTIVE', 'internal'); - $project->array_options['commtask'] = $taskID; - $project->update($user); - } else { - setEventMessages($task->error, $task->errors, 'errors'); - $error++; - } + $project->add_contact($user->id, 'PROJECTLEADER', 'internal'); + + $task->fk_project = $projectID; + $task->ref = $refTaskMod->getNextValue(null, $task); + $task->label = (!empty($conf->global->EASYCRM_TASK_LABEL_VALUE) ? $conf->global->EASYCRM_TASK_LABEL_VALUE : $langs->trans('CommercialFollowUp')) . ' - ' . $project->title; + $task->date_c = dol_now(); + + $taskID = $task->create($user); + if ($taskID > 0) { + $task->add_contact($user->id, 'TASKEXECUTIVE', 'internal'); + $project->array_options['commtask'] = $taskID; + $project->update($user); } else { - $langs->load('errors'); - setEventMessages($project->error, $project->errors, 'errors'); + setEventMessages($task->error, $task->errors, 'errors'); $error++; } + } else { + $langs->load('errors'); + setEventMessages($project->error, $project->errors, 'errors'); + $error++; } if (!$error) { - $db->commit(); header('Location: ' . $_SERVER["PHP_SELF"]); exit; } else { - $db->rollback(); - unset($_POST['ref']); $action = ''; } } diff --git a/view/frontend/quickcreation.php b/view/frontend/quickcreation.php index 42ee4fa..b854831 100644 --- a/view/frontend/quickcreation.php +++ b/view/frontend/quickcreation.php @@ -18,7 +18,7 @@ /** * \file view/frontend/quickcreation.php * \ingroup easycrm - * \brief Page to quick creation project on frontend view + * \brief Page to quick creation on frontend view */ // Load EasyCRM environment @@ -30,83 +30,64 @@ die('Include of easycrm main fails'); } -// Libraries +// Load Dolibarr libraries if (isModEnabled('project')) { - require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; - require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; } -if (isModEnabled('fckeditor')) { - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -} if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; } // Global variables definitions -global $conf, $db, $hookmanager, $langs, $mysoc, $user; +global $conf, $db, $hookmanager, $langs, $user; // Load translation files required by the page -saturne_load_langs(['categories', 'projects']); +saturne_load_langs(['projects']); // Get parameters $action = GETPOST('action', 'aZ09'); -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'quickcretion'; // To manage different context of search -$cancel = GETPOST('cancel', 'aZ09'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'quickcretion_frontend'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $subaction = GETPOST('subaction', 'alpha'); // Initialize technical objects -$extrafields = new ExtraFields($db); if (isModEnabled('project')) { $project = new Project($db); $task = new Task($db); } -if (isModEnabled('categorie')) { - $category = new Categorie($db); -} // Initialize view objects $form = new Form($db); -if (isModEnabled('project')) { - $formproject = new FormProjets($db); -} -$hookmanager->initHooks(['easycrm_quickcreation']); // Note that conf->hooks_modules contains array - -$date_start = dol_mktime(0, 0, 0, GETPOST('projectstartmonth', 'int'), GETPOST('projectstartday', 'int'), GETPOST('projectstartyear', 'int')); +$hookmanager->initHooks(['easycrm_quickcreation_frontend']); // Note that conf->hooks_modules contains array // Security check - Protection if external user -$permissiontoread = $user->rights->easycrm->read; -$permissiontoaddproject = $user->rights->projet->creer; -saturne_check_access($permissiontoread); +$permissionToRead = $user->rights->easycrm->read; +$permissionToAddProject = $user->rights->projet->creer; +saturne_check_access($permissionToRead); /* * Actions */ $parameters = []; -$reshook = $hookmanager->executeHooks('doActions', $parameters, $project, $action); // Note that $action and $project may have been modified by some hooks -if ($reshook < 0) { +$resHook = $hookmanager->executeHooks('doActions', $parameters, $project, $action); // Note that $action and $project may have been modified by some hooks +if ($resHook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -if (empty($reshook)) { +if (empty($resHook)) { $error = 0; - if ($cancel) { - header('Location: ' . dol_buildpath('/easycrm/easycrmindex.php', 1)); - exit; - } - require_once __DIR__ . '/../../core/tpl/frontend/easycrm_quickcreation_actions_frontend.tpl.php'; + // Actions add_img, add + require_once __DIR__ . '/../../core/tpl/frontend/easycrm_quickcreation_actions_frontend.tpl.php'; } /* * View */ - $title = $langs->trans('QuickCreation'); $help_url = 'FR:Module_EasyCRM'; $moreJS = ['/custom/saturne/js/includes/signature-pad.min.js']; @@ -115,9 +96,9 @@ $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; -saturne_header(1, '', $title, $help_url, '', 0, 0, $moreJS, $moreCSS, '', 'quickcreation-frontend'); +saturne_header(0, '', $title, $help_url, '', 0, 0, $moreJS, $moreCSS, '', 'quickcreation-frontend'); -if (empty($permissiontoaddproject)) { +if (empty($permissionToAddProject)) { accessforbidden($langs->trans('NotEnoughPermissions'), 0); exit; } From d44e48ef03756edf597b91d4ae5c45bc7cfb4272 Mon Sep 17 00:00:00 2001 From: Nicolas Domenech Date: Mon, 4 Dec 2023 20:56:19 +0100 Subject: [PATCH 18/39] #182 [QuickCreation] fix: frontend fix on JS/trad/actions --- ...crm_project_quickcreation_frontend.tpl.php | 5 +-- ...crm_quickcreation_actions_frontend.tpl.php | 34 +++++++++++++++---- js/easycrm.min.js | 2 +- js/modules/quickcreation.js | 2 +- langs/fr_FR/easycrm.lang | 3 ++ 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php b/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php index 29e946a..920a6cb 100644 --- a/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php +++ b/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php @@ -52,7 +52,7 @@ global->EASYCRM_PROJECT_DESCRIPTION_VISIBLE > 0) : ?> @@ -67,9 +67,10 @@ -