diff --git a/.gitignore b/.gitignore index 70479d0..5e011c3 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ *.back /.editorconfig /.gitattributes +node_modules diff --git a/admin/setup.php b/admin/setup.php index 4cb39b3..89cd1a1 100644 --- a/admin/setup.php +++ b/admin/setup.php @@ -52,681 +52,187 @@ global $langs, $user; + // Libraries -require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; -require_once '../lib/dolimeet.lib.php'; -//require_once "../class/myclass.class.php"; +require_once DOL_DOCUMENT_ROOT . "/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT . "/core/class/html.formprojet.class.php"; + +require_once __DIR__ . '/../lib/dolimeet.lib.php'; + +$action = GETPOST('action', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); +$value = GETPOST('value', 'alpha'); // Translations $langs->loadLangs(array("admin", "dolimeet@dolimeet")); -// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('dolimeetsetup', 'globalsetup')); - // Access control -if (!$user->admin) { - accessforbidden(); -} +if ( ! $user->admin) accessforbidden(); // Parameters -$action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php - -$value = GETPOST('value', 'alpha'); -$label = GETPOST('label', 'alpha'); -$scandir = GETPOST('scan_dir', 'alpha'); -$type = 'myobject'; - -$arrayofparameters = array( - 'DOLIMEET_MYPARAM1'=>array('type'=>'string', 'css'=>'minwidth500' ,'enabled'=>1), - 'DOLIMEET_MYPARAM2'=>array('type'=>'textarea','enabled'=>1), - //'DOLIMEET_MYPARAM3'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1), - //'DOLIMEET_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1), - //'DOLIMEET_MYPARAM5'=>array('type'=>'yesno', 'enabled'=>1), - //'DOLIMEET_MYPARAM5'=>array('type'=>'thirdparty_type', 'enabled'=>1), - //'DOLIMEET_MYPARAM6'=>array('type'=>'securekey', 'enabled'=>1), - //'DOLIMEET_MYPARAM7'=>array('type'=>'product', 'enabled'=>1), -); - -$error = 0; -$setupnotempty = 0; - -// Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only -$useFormSetup = 0; -// Convert arrayofparameter into a formSetup object -if ($useFormSetup && (float) DOL_VERSION >= 15) { - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php'; - $formSetup = new FormSetup($db); - - // you can use the param convertor - $formSetup->addItemsFromParamsArray($arrayofparameters); - - // or use the new system see exemple as follow (or use both because you can ;-) ) - - /* - // Hôte - $item = $formSetup->newItem('NO_PARAM_JUST_TEXT'); - $item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST']; - $item->cssClass = 'minwidth500'; - - // Setup conf DOLIMEET_MYPARAM1 as a simple string input - $item = $formSetup->newItem('DOLIMEET_MYPARAM1'); - - // Setup conf DOLIMEET_MYPARAM1 as a simple textarea input but we replace the text of field title - $item = $formSetup->newItem('DOLIMEET_MYPARAM2'); - $item->nameText = $item->getNameText().' more html text '; - - // Setup conf DOLIMEET_MYPARAM3 - $item = $formSetup->newItem('DOLIMEET_MYPARAM3'); - $item->setAsThirdpartyType(); - - // Setup conf DOLIMEET_MYPARAM4 : exemple of quick define write style - $formSetup->newItem('DOLIMEET_MYPARAM4')->setAsYesNo(); - - // Setup conf DOLIMEET_MYPARAM5 - $formSetup->newItem('DOLIMEET_MYPARAM5')->setAsEmailTemplate('thirdparty'); - - // Setup conf DOLIMEET_MYPARAM6 - $formSetup->newItem('DOLIMEET_MYPARAM6')->setAsSecureKey()->enabled = 0; // disabled - - // Setup conf DOLIMEET_MYPARAM7 - $formSetup->newItem('DOLIMEET_MYPARAM7')->setAsProduct(); - */ - - $setupnotempty = count($formSetup->items); -} - - -$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); - /* * Actions */ -include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; - -if ($action == 'updateMask') { - $maskconst = GETPOST('maskconst', 'alpha'); - $maskvalue = GETPOST('maskvalue', 'alpha'); - - if ($maskconst) { - $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); - if (!($res > 0)) { - $error++; - } - } - - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } -} elseif ($action == 'specimen') { - $modele = GETPOST('module', 'alpha'); - $tmpobjectkey = GETPOST('object'); - - $tmpobject = new $tmpobjectkey($db); - $tmpobject->initAsSpecimen(); - - // Search template files - $file = ''; $classname = ''; $filefound = 0; - $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); - foreach ($dirmodels as $reldir) { - $file = dol_buildpath($reldir."core/modules/dolimeet/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0); - if (file_exists($file)) { - $filefound = 1; - $classname = "pdf_".$modele; - break; - } - } - - if ($filefound) { - require_once $file; - - $module = new $classname($db); - - if ($module->write_file($tmpobject, $langs) > 0) { - header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf"); - return; - } else { - setEventMessages($module->error, null, 'errors'); - dol_syslog($module->error, LOG_ERR); - } - } else { - setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors'); - dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); - } -} elseif ($action == 'setmod') { - // TODO Check if numbering module chosen can be activated by calling method canBeActivated - $tmpobjectkey = GETPOST('object'); - if (!empty($tmpobjectkey)) { - $constforval = 'DOLIMEET_'.strtoupper($tmpobjectkey)."_ADDON"; - dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity); - } -} elseif ($action == 'set') { - // Activate a model - $ret = addDocumentModel($value, $type, $label, $scandir); -} elseif ($action == 'del') { - $ret = delDocumentModel($value, $type); - if ($ret > 0) { - $tmpobjectkey = GETPOST('object'); - if (!empty($tmpobjectkey)) { - $constforval = 'DOLIMEET_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; - if ($conf->global->$constforval == "$value") { - dolibarr_del_const($db, $constforval, $conf->entity); - } - } - } -} elseif ($action == 'setdoc') { - // Set or unset default model - $tmpobjectkey = GETPOST('object'); - if (!empty($tmpobjectkey)) { - $constforval = 'DOLIMEET_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; - if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) { - // The constant that was read before the new set - // We therefore requires a variable to have a coherent view - $conf->global->$constforval = $value; - } - - // We disable/enable the document template (into llx_document_model table) - $ret = delDocumentModel($value, $type); - if ($ret > 0) { - $ret = addDocumentModel($value, $type, $label, $scandir); - } - } -} elseif ($action == 'unsetdoc') { - $tmpobjectkey = GETPOST('object'); - if (!empty($tmpobjectkey)) { - $constforval = 'DOLIMEET_'.strtoupper($tmpobjectkey).'_ADDON_PDF'; - dolibarr_del_const($db, $constforval, $conf->entity); - } -} - - - /* * View */ -$form = new Form($db); +if ( ! empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } $help_url = ''; -$page_name = "DoliMeetSetup"; +$title = $langs->trans("DoliMeetSettings"); -llxHeader('', $langs->trans($page_name), $help_url); +$morejs = array("/dolimeet/js/dolimeet.js.php"); +$morecss = array("/dolimeet/css/dolimeet.css"); + +llxHeader('', $title, $help_url, '', '', '', $morejs, $morecss); // Subheader -$linkback = ''.$langs->trans("BackToModuleList").''; +$linkback = '' . $langs->trans("BackToModuleList") . ''; -print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup'); +print load_fiche_titre($title, $linkback, 'dolimeet32px@dolimeet'); // Configuration header $head = dolimeetAdminPrepareHead(); -print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "dolimeet@dolimeet"); - -// Setup page goes here -echo ''.$langs->trans("DoliMeetSetupPage").'

'; - - -if ($action == 'edit') { - if ($useFormSetup && (float) DOL_VERSION >= 15) { - print $formSetup->generateOutput(true); - } else { - print '
'; - print ''; - print ''; - - print ''; - print ''; - - foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { - $setupnotempty++; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); - print ''.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1, 'info', '', 0, 3, 'tootips'.$constname).''; - print ''; - - if ($val['type'] == 'textarea') { - print '\n"; - } elseif ($val['type']== 'html') { - require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; - $doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); - $doleditor->Create(); - } elseif ($val['type'] == 'yesno') { - print $form->selectyesno($constname, $conf->global->{$constname}, 1); - } elseif (preg_match('/emailtemplate:/', $val['type'])) { - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - - $tmp = explode(':', $val['type']); - $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, 1); // We set lang=null to get in priority record with no lang - //$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, ''); - $arrayofmessagename = array(); - if (is_array($formmail->lines_model)) { - foreach ($formmail->lines_model as $modelmail) { - //var_dump($modelmail); - $moreonlabel = ''; - if (!empty($arrayofmessagename[$modelmail->label])) { - $moreonlabel = ' (' . $langs->trans("SeveralLangugeVariatFound") . ')'; - } - // The 'label' is the key that is unique if we exclude the language - $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)) . $moreonlabel; +print dol_get_fiche_head($head, 'settings', '', -1, "dolimeet@dolimeet"); + + +// RISKS + +print load_fiche_titre(' ' . $langs->trans('SessionConfig'), '', ''); +print '
'; + + +print load_fiche_titre($langs->trans("SessionNumberingModule"), '', ''); + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +clearstatcache(); + +$dir = dol_buildpath("/custom/dolimeet/core/modules/dolimeet/"); +if (is_dir($dir)) { + $handle = opendir($dir); + if (is_resource($handle)) { + while (($file = readdir($handle)) !== false ) { + if ( ! is_dir($dir . $file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) { + $filebis = $file; + + $classname = preg_replace('/\.php$/', '', $file); + $classname = preg_replace('/\-.*$/', '', $classname); + + if ( ! class_exists($classname) && is_readable($dir . $filebis) && (preg_match('/mod_/', $filebis) || preg_match('/mod_/', $classname)) && substr($filebis, dol_strlen($filebis) - 3, 3) == 'php') { + // Charging the numbering class + require_once $dir . $filebis; + + $module = new $classname($db); + + if ($module->isEnabled()) { + print ''; + + // Show example of numbering module + print '' . "\n"; + + print ''; - } - } - print '
' . $langs->trans("Name") . '' . $langs->trans("Description") . '' . $langs->trans("Example") . '' . $langs->trans("Status") . '' . $langs->trans("ShortInfo") . '
'; + print $langs->trans($module->name); + print "\n"; + print $module->info(); + print ''; + $tmp = $module->getExample(); + if (preg_match('/^Error/', $tmp)) print '
' . $langs->trans($tmp) . '
'; + elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); + else print $tmp; + print '
'; + $numbering_module = 'DOLIMEET_' . strtoupper($module->name) . '_ADDON'; + if ($conf->global->$numbering_module == $file || $conf->global->$numbering_module . '.php' == $file) { + print img_picto($langs->trans("Activated"), 'switch_on'); + } else { + print '' . img_picto($langs->trans("Disabled"), 'switch_off') . ''; } - } - print $form->selectarray($constname, $arrayofmessagename, $conf->global->{$constname}, 'None', 0, 0, '', 0, 0, 0, '', '', 1); - } elseif (preg_match('/category:/', $val['type'])) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; - $formother = new FormOther($db); - - $tmp = explode(':', $val['type']); - print img_picto('', 'category', 'class="pictofixedwidth"'); - print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort')); - } elseif (preg_match('/thirdparty_type/', $val['type'])) { - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; - $formcompany = new FormCompany($db); - print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname); - } elseif ($val['type'] == 'securekey') { - print ''; - if (!empty($conf->use_javascript_ajax)) { - print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"'); - } - if (!empty($conf->use_javascript_ajax)) { - print "\n".''; - } - } elseif ($val['type'] == 'product') { - if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { - $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); - $form->select_produits($selected, $constname, '', 0); - } - } else { - print ''; - } - print '
'; - - print '
'; - print ''; - print '
'; - - print ''; - } - - print '
'; -} else { - if ($useFormSetup && (float) DOL_VERSION >= 15) { - if (!empty($formSetup->items)) { - print $formSetup->generateOutput(); - } - } else { - if (!empty($arrayofparameters)) { - print ''; - print ''; - - foreach ($arrayofparameters as $constname => $val) { - if ($val['enabled']==1) { - $setupnotempty++; - print ''; + + // Example for listing risks action + $htmltooltip = ''; + $htmltooltip .= '' . $langs->trans("Version") . ': ' . $module->getVersion() . '
'; + $nextval = $module->getNextValue($object_document); + if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval + $htmltooltip .= $langs->trans("NextValue") . ': '; + if ($nextval) { + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') + $nextval = $langs->trans($nextval); + $htmltooltip .= $nextval . '
'; + } else { + $htmltooltip .= $langs->trans($module->error) . '
'; } - print '
    ' . implode(' ', $toprint) . '
'; - } - } elseif (preg_match('/thirdparty_type/', $val['type'])) { - if ($conf->global->{$constname}==2) { - print $langs->trans("Prospect"); - } elseif ($conf->global->{$constname}==3) { - print $langs->trans("ProspectCustomer"); - } elseif ($conf->global->{$constname}==1) { - print $langs->trans("Customer"); - } elseif ($conf->global->{$constname}==0) { - print $langs->trans("NorProspectNorCustomer"); - } - } elseif ($val['type'] == 'product') { - $product = new Product($db); - $resprod = $product->fetch($conf->global->{$constname}); - if ($resprod > 0) { - print $product->ref; - } elseif ($resprod < 0) { - setEventMessages(null, $object->errors, "errors"); } - } else { - print $conf->global->{$constname}; - } - print ''; - } - } - - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; - $tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : ''); - print $form->textwithpicto($langs->trans($constname), $tooltiphelp); - print ''; - - if ($val['type'] == 'textarea') { - print dol_nl2br($conf->global->{$constname}); - } elseif ($val['type']== 'html') { - print $conf->global->{$constname}; - } elseif ($val['type'] == 'yesno') { - print ajax_constantonoff($constname); - } elseif (preg_match('/emailtemplate:/', $val['type'])) { - include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; - $formmail = new FormMail($db); - - $tmp = explode(':', $val['type']); - - $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs, $conf->global->{$constname}); - if ($template<0) { - setEventMessages(null, $formmail->errors, 'errors'); - } - print $langs->trans($template->label); - } elseif (preg_match('/category:/', $val['type'])) { - $c = new Categorie($db); - $result = $c->fetch($conf->global->{$constname}); - if ($result < 0) { - setEventMessages(null, $c->errors, 'errors'); - } elseif ($result > 0 ) { - $ways = $c->print_all_ways(' >> ', 'none', 0, 1); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formated text - $toprint = array(); - foreach ($ways as $way) { - $toprint[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '
  • '; + print '
    '; - } - } - if ($setupnotempty) { - print '
    '; - print ''.$langs->trans("Modify").''; - print '
    '; - } else { - print '
    '.$langs->trans("NothingToSetup"); - } -} - - -$moduledir = 'dolimeet'; -$myTmpObjects = array(); -$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0); - - -foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { - if ($myTmpObjectKey == 'MyObject') { - continue; - } - if ($myTmpObjectArray['includerefgeneration']) { - /* - * Orders Numbering model - */ - $setupnotempty++; - - print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', ''); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''."\n"; - - clearstatcache(); - - foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/".$moduledir); - - if (is_dir($dir)) { - $handle = opendir($dir); - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') { - $file = substr($file, 0, dol_strlen($file) - 4); - - require_once $dir.'/'.$file.'.php'; - - $module = new $file($db); - - // Show modules according to features level - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { - continue; - } - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { - continue; - } - - if ($module->isEnabled()) { - dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php'); - - print ''; - - // Show example of numbering model - print ''."\n"; - - print ''; - - $mytmpinstance = new $myTmpObjectKey($db); - $mytmpinstance->initAsSpecimen(); - - // Info - $htmltooltip = ''; - $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
    '; - - $nextval = $module->getNextValue($mytmpinstance); - if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval - $htmltooltip .= ''.$langs->trans("NextValue").': '; - if ($nextval) { - if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { - $nextval = $langs->trans($nextval); - } - $htmltooltip .= $nextval.'
    '; - } else { - $htmltooltip .= $langs->trans($module->error).'
    '; - } - } - - print ''; - - print "\n"; - } + print ''; + print "\n"; } - closedir($handle); } } } - print "
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Status").''.$langs->trans("ShortInfo").'
    '.$module->name."\n"; - print $module->info(); - print ''; - $tmp = $module->getExample(); - if (preg_match('/^Error/', $tmp)) { - $langs->load("errors"); - print '
    '.$langs->trans($tmp).'
    '; - } elseif ($tmp == 'NotConfigured') { - print $langs->trans($tmp); - } else { - print $tmp; - } - print '
    '; - $constforvar = 'DOLIMEET_'.strtoupper($myTmpObjectKey).'_ADDON'; - if ($conf->global->$constforvar == $file) { - print img_picto($langs->trans("Activated"), 'switch_on'); - } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; - } - print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print '
    '; + print $form->textwithpicto('', $htmltooltip, 1, 0); + if ($conf->global->$numbering_module . '.php' == $file) { // If module is the one used, we show existing errors + if ( ! empty($module->error)) dol_htmloutput_mesg($module->error, '', 'error', 1); } + print '

    \n"; + closedir($handle); } - - if ($myTmpObjectArray['includedocgeneration']) { - /* - * Document templates generators - */ - $setupnotempty++; - $type = strtolower($myTmpObjectKey); - - print load_fiche_titre($langs->trans("DocumentModules", $myTmpObjectKey), '', ''); - - // Load array def with activated templates - $def = array(); - $sql = "SELECT nom"; - $sql .= " FROM ".MAIN_DB_PREFIX."document_model"; - $sql .= " WHERE type = '".$db->escape($type)."'"; - $sql .= " AND entity = ".$conf->entity; - $resql = $db->query($sql); - if ($resql) { - $i = 0; - $num_rows = $db->num_rows($resql); - while ($i < $num_rows) { - $array = $db->fetch_array($resql); - array_push($def, $array[0]); - $i++; - } - } else { - dol_print_error($db); - } - - print "\n"; - print "\n"; - print ''; - print ''; - print '\n"; - print '\n"; - print ''; - print ''; - print "\n"; - - clearstatcache(); - - foreach ($dirmodels as $reldir) { - foreach (array('', '/doc') as $valdir) { - $realpath = $reldir."core/modules/".$moduledir.$valdir; - $dir = dol_buildpath($realpath); - - if (is_dir($dir)) { - $handle = opendir($dir); - if (is_resource($handle)) { - while (($file = readdir($handle)) !== false) { - $filelist[] = $file; - } - closedir($handle); - arsort($filelist); - - foreach ($filelist as $file) { - if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { - if (file_exists($dir.'/'.$file)) { - $name = substr($file, 4, dol_strlen($file) - 16); - $classname = substr($file, 0, dol_strlen($file) - 12); - - require_once $dir.'/'.$file; - $module = new $classname($db); - - $modulequalified = 1; - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { - $modulequalified = 0; - } - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { - $modulequalified = 0; - } - - if ($modulequalified) { - print ''; - - // Active - if (in_array($name, $def)) { - print ''; - } else { - print '"; - } - - // Default - print ''; - - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip .= '
    '.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); - if ($module->type == 'pdf') { - $htmltooltip .= '
    '.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; - } - $htmltooltip .= '
    '.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file; - - $htmltooltip .= '

    '.$langs->trans("FeaturesSupported").':'; - $htmltooltip .= '
    '.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); - $htmltooltip .= '
    '.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); - - print ''; - - // Preview - print ''; - - print "\n"; - } - } - } - } - } - } - } - } - - print '
    '.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."'.$langs->trans("Default")."'.$langs->trans("ShortInfo").''.$langs->trans("Preview").'
    '; - print (empty($module->name) ? $name : $module->name); - print "\n"; - if (method_exists($module, 'info')) { - print $module->info($langs); - } else { - print $module->description; - } - print ''."\n"; - print ''; - print img_picto($langs->trans("Enabled"), 'switch_on'); - print ''; - print ''."\n"; - print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; - print "'; - $constforvar = 'DOLIMEET_'.strtoupper($myTmpObjectKey).'_ADDON'; - if ($conf->global->$constforvar == $name) { - //print img_picto($langs->trans("Default"), 'on'); - // Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset - print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; - } else { - print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; - } - print ''; - print $form->textwithpicto('', $htmltooltip, 1, 0); - print ''; - if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"), 'pdf').''; - } else { - print img_object($langs->trans("PreviewNotAvailable"), 'generic'); - } - print '
    '; - } -} - -if (empty($setupnotempty)) { - print '
    '.$langs->trans("NothingToSetup"); } -// Page end -print dol_get_fiche_end(); +print '
    '; + +print load_fiche_titre($langs->trans("SessionTypes"), '', ''); + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +print ''; + +print ''; +print ''; + +print ''; + +print ''; +print ''; + +print ''; + +print ''; +print ''; -llxFooter(); $db->close(); +llxFooter(); diff --git a/class/actions_dolimeet.class.php b/class/actions_dolimeet.class.php new file mode 100644 index 0000000..60b11ab --- /dev/null +++ b/class/actions_dolimeet.class.php @@ -0,0 +1,231 @@ + + * + * 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 class/actions_dolimeet.class.php + * \ingroup dolimeet + * \brief DoliMeet hook overload. + */ + +/** + * Class ActionsDolimeet + */ +class ActionsDolimeet +{ + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string Error code (or message) + */ + public $error = ''; + + /** + * @var array Errors + */ + public $errors = array(); + + + /** + * @var array Hook results. Propagated to $hookmanager->resArray for later reuse + */ + public $results = array(); + + /** + * @var string String displayed by executeHook() immediately after return + */ + public $resprints; + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + } + + /** + * Overloading the constructCategory function : replacing the parent's function with the one below + * + * @param array $parameters Hook metadatas (context, etc...) + * @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...) + * @return int < 0 on error, 0 on success, 1 to replace standard code + */ + public function constructCategory($parameters, &$object) + { + $error = 0; // Error counter + + if (in_array($parameters['currentcontext'], array('category', 'somecontext2'))) { // do something only for the context 'somecontext1' or 'somecontext2' + $tags = array( + 'meeting' => array( + 'id' => 1050, + 'code' => 'meeting', + 'obj_class' => 'Meeting', + 'obj_table' => 'dolimeet_session', + ), + 'trainingsession' => array( + 'id' => 1051, + 'code' => 'trainingsession', + 'obj_class' => 'TrainingSession', + 'obj_table' => 'dolimeet_session', + ), + 'audit' => array( + 'id' => 1052, + 'code' => 'audit', + 'obj_class' => 'Audit', + 'obj_table' => 'dolimeet_session', + ), + ); + } + + if (!$error) { + $this->results = $tags; + return 0; // or return 1 to replace standard code + } else { + $this->errors[] = 'Error message'; + return -1; + } + } + + /** + * Overloading the doActions function : replacing the parent's function with the one below + * + * @param Hook $parameters metadatas (context, etc...) + * @param $object current object + * @param $action + * @return int < 0 on error, 0 on success, 1 to replace standard code + */ + public function completeListOfReferent($parameters, $object, $action) + { + global $db, $conf, $langs; + + + + if (true) { + $this->results = array('myreturn' => 999); + $this->resprints = 'A text to show'; + return 0; // or return 1 to replace standard code + } else { + $this->errors[] = 'Error message'; + return -1; + } + } + + /** + * Overloading the printCommonFooter function : replacing the parent's function with the one below + * + * @param array $parameters Hook metadatas (context, etc...) + * @return int < 0 on error, 0 on success, 1 to replace standard code + */ + public function printCommonFooter($parameters) + { + global $langs, $db, $conf; + $error = 0; // Error counter + + /* print_r($parameters); print_r($object); echo "action: " . $action; */ + if ($parameters['currentcontext'] == 'projectOverview') { + require_once DOL_DOCUMENT_ROOT . '/custom/dolimeet/class/session.class.php'; + + $session = new Session($db); + $linkedSessions = $session->fetchAll('','','','',array("fk_project" => GETPOST('id'))); + + $outputline = '
    ' . $langs->trans("Name") . '' . $langs->trans("Description") . '' . $langs->trans("Status") . '
    '; +print $langs->trans('Meeting'); +print ""; +print $langs->trans('EnableMeetingDescription'); +print ''; +print ajax_constantonoff('DOLIMEET_MEETING_MENU_ENABLED'); +print '
    '; +print $langs->trans('TrainingSession'); +print ""; +print $langs->trans('EnableTrainingSessionDescription'); +print ''; +print ajax_constantonoff('DOLIMEET_TRAININGSESSION_MENU_ENABLED'); +print '
    '; +print $langs->trans('Audit'); +print ""; +print $langs->trans('EnableAuditDescription'); +print ''; +print ajax_constantonoff('DOLIMEET_AUDIT_MENU_ENABLED'); +print '
    '. $langs->transnoentities('DoliMeetObjects') .'
    '; + $outputline .= '
    '; + $outputline .= ''; + $outputline .= ' '; + $outputline .= ' '; + $outputline .= ' '; + $outputline .= ''; + + if (!empty($linkedSessions)) { + foreach($linkedSessions as $linkedSession) { + $outputline .= ''; + $outputline .= ''; + $outputline .= ''; + $outputline .= ''; + $outputline .= ''; + } + } + $outputline .= '
    '. $langs->transnoentities('ObjectType') .''. $langs->transnoentities('Object') .''. $langs->transnoentities('Date') .'
    '; + $outputline .= $langs->trans(ucfirst($linkedSession->type)); + $outputline .= ''; + $outputline .= $linkedSession->getNomUrl(); + $outputline .= ''; + $outputline .= dol_print_date($linkedSession->date_start, 'dayhour') . ' - ' . dol_print_date($linkedSession->date_end, 'dayhour'); + $outputline .= '
    '; + ?> + + global->MAIN_INFO_SOCIETE_TRAINING_ORGANIZATION_NUMBER .'">'; + ?> + + '; + } + + if (!$error) { + $this->results = array('myreturn' => 999); + return 0; // or return 1 to replace standard code + } else { + $this->errors[] = 'Error message'; + return -1; + } + } + + + /** + * Overloading the doActions function : replacing the parent's function with the one below + * + * @param Hook $parameters metadatas (context, etc...) + * @param $object current object + * @param $action + * @return int < 0 on error, 0 on success, 1 to replace standard code + */ + public function doActions($parameters, $object, $action) + { + global $db, $conf; + + /* print_r($parameters); print_r($object); echo "action: " . $action; */ + if ($parameters['currentcontext'] == 'admincompany') { // do something only for the context 'somecontext1' or 'somecontext2' + if ($action == 'update') { + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TRAINING_ORGANIZATION_NUMBER", GETPOST("MAIN_INFO_SOCIETE_TRAINING_ORGANIZATION_NUMBER"), 'chaine', 0, '', $conf->entity); + } + } + } + +} diff --git a/class/audit.class.php b/class/audit.class.php new file mode 100644 index 0000000..0564953 --- /dev/null +++ b/class/audit.class.php @@ -0,0 +1,208 @@ + + * + * 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 class/audit.class.php + * \ingroup dolimeet + * \brief This file is a CRUD class file for Document (Create/Read/Update/Delete) + */ + +// Put here all includes required by your class file +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +require_once __DIR__ . '/dolimeetsignature.class.php'; +require_once __DIR__ . '/session.class.php'; + +/** + * Class for Audit + */ +class Audit extends Session +{ + /** + * @var string ID of module. + */ + public $module = 'dolimeet'; + + /** + * @var string ID to identify managed object. + */ + public $element = 'audit'; + + /** + * @var string String with name of icon for document. Must be the part after the 'object_' into object_document.png + */ + public $picto = 'audit@dolimeet'; + + /** + * @var int Does this object support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table + */ + public $ismultientitymanaged = 1; + + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs; + + $this->db = $db; + $this->type = 'audit'; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } + } +} + +/** + * Class AuditSignature + */ + +class AuditSignature extends DolimeetSignature +{ + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + + public $object_type = 'audit'; + + /** + * @var array Context element object + */ + public $context = array(); + + /** + * @var string String with name of icon for document. Must be the part after the 'object_' into object_document.png + */ + public $picto = 'audit@dolimeet'; + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs; + + $this->db = $db; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } + } + + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @param $auditid + * @return mixed New object created, <0 if KO + * @throws Exception + */ + public function createFromClone(User $user, $fromid, $auditid) + { + $error = 0; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $object = new self($this->db); + + $this->db->begin(); + + // Load source object + $object->fetchCommon($fromid); + + // Reset some properties + unset($object->id); + unset($object->fk_user_creat); + unset($object->import_key); + unset($object->signature); + unset($object->signature_date); + unset($object->last_email_sent_date); + + // Clear fields + if (property_exists($object, 'date_creation')) { + $object->date_creation = dol_now(); + } + if (property_exists($object, 'fk_object')) { + $object->fk_object = $auditid; + } + if (property_exists($object, 'status')) { + $object->status = 1; + } + if (property_exists($object, 'signature_url')) { + $object->signature_url = generate_random_id(16); + } + + // Create clone + $object->context['createfromclone'] = 'createfromclone'; + $result = $object->createCommon($user); + unset($object->context['createfromclone']); + + // End + if ( ! $error) { + $this->db->commit(); + return $result; + } else { + $this->db->rollback(); + return -1; + } + } +} diff --git a/class/dolimeetsignature.class.php b/class/dolimeetsignature.class.php new file mode 100644 index 0000000..7e0f266 --- /dev/null +++ b/class/dolimeetsignature.class.php @@ -0,0 +1,633 @@ + + * + * 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 class/digirisksignature.class.php + * \ingroup dolimeet + * \brief This file is a CRUD class file for DolimeetSignature (Create/Read/Update/Delete) + */ + +// Put here all includes required by your class file +require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/ticket.lib.php'; + +/** + * Class for DolimeetSignature + */ +class DolimeetSignature extends CommonObject +{ + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string[] Array of error strings + */ + public $errors = array(); + + /** + * @var string ID of module. + */ + public $module = 'dolimeet'; + + /** + * @var string ID to identify managed object. + */ + public $element = 'object_signature'; + + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + public $table_element = 'dolimeet_object_signature'; + + /** + * @var int Does this object support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table + */ + public $ismultientitymanaged = 1; + + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 0; + + /** + * @var string String with name of icon for digirisksignature. Must be the part after the 'object_' into object_digirisksignature.png + */ + public $picto = 'object_signature@dolimeet'; + + /** + * @var string Label status of const. + */ + public $labelStatus; + + /** + * @var string Label status short of const. + */ + public $labelStatusShort; + + const STATUS_DELETED = 0; + const STATUS_REGISTERED = 1; + const STATUS_SIGNATURE_REQUEST = 2; + const STATUS_PENDING_SIGNATURE = 3; + const STATUS_DENIED = 4; + const STATUS_SIGNED = 5; + const STATUS_UNSIGNED = 6; + const STATUS_ABSENT = 7; + const STATUS_JUSTIFIED_ABSENT = 8; + + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'comment' => "Id"), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => -1,), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 20, 'notnull' => 1, 'visible' => -2,), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 30, 'notnull' => 0, 'visible' => -2,), + 'import_key' => array('type' => 'integer', 'label' => 'ImportId', 'enabled' => '1', 'position' => 40, 'notnull' => 1, 'visible' => -2,), + 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => '1', 'position' => 50, 'notnull' => 0, 'visible' => 1, 'index' => 1,), + 'role' => array('type' => 'varchar(255)', 'label' => 'Role', 'enabled' => '1', 'position' => 60, 'notnull' => 0, 'visible' => 3,), + 'firstname' => array('type' => 'varchar(255)', 'label' => 'Firstname', 'enabled' => '1', 'position' => 70, 'notnull' => 0, 'visible' => 3,), + 'lastname' => array('type' => 'varchar(255)', 'label' => 'Lastname', 'enabled' => '1', 'position' => 80, 'notnull' => 0, 'visible' => 3,), + 'email' => array('type' => 'varchar(255)', 'label' => 'Email', 'enabled' => '1', 'position' => 90, 'notnull' => 0, 'visible' => 3,), + 'phone' => array('type' => 'varchar(255)', 'label' => 'Phone', 'enabled' => '1', 'position' => 100, 'notnull' => 0, 'visible' => 3,), + 'society_name' => array('type' => 'varchar(255)', 'label' => 'SocietyName', 'enabled' => '1', 'position' => 110, 'notnull' => 0, 'visible' => 3,), + 'signature_date' => array('type' => 'datetime', 'label' => 'SignatureDate', 'enabled' => '1', 'position' => 120, 'notnull' => 0, 'visible' => 3,), + 'signature_location' => array('type' => 'varchar(255)', 'label' => 'SignatureLocation', 'enabled' => '1', 'position' => 125, 'notnull' => 0, 'visible' => 3,), + 'signature_comment' => array('type' => 'varchar(255)', 'label' => 'SignatureComment', 'enabled' => '1', 'position' => 130, 'notnull' => 0, 'visible' => 3,), + 'element_id' => array('type' => 'integer', 'label' => 'ElementType', 'enabled' => '1', 'position' => 140, 'notnull' => 1, 'visible' => 1,), + 'element_type' => array('type' => 'varchar(50)', 'label' => 'ElementType', 'enabled' => '1', 'position' => 150, 'notnull' => 0, 'visible' => 1,), + 'signature' => array('type' => 'varchar(255)', 'label' => 'Signature', 'enabled' => '1', 'position' => 160, 'notnull' => 0, 'visible' => 3,), + 'stamp' => array('type' => 'varchar(255)', 'label' => 'Stamp', 'enabled' => '1', 'position' => 165, 'notnull' => 0, 'visible' => 3,), + 'signature_url' => array('type' => 'varchar(50)', 'label' => 'SignatureUrl', 'enabled' => '1', 'position' => 170, 'notnull' => 0, 'visible' => 1, 'default' => null,), + 'transaction_url' => array('type' => 'varchar(50)', 'label' => 'TransactionUrl', 'enabled' => '1', 'position' => 180, 'notnull' => 0, 'visible' => 1,'default' => null,), + 'last_email_sent_date' => array('type' => 'datetime', 'label' => 'LastEmailSentDate', 'enabled' => '1', 'position' => 190, 'notnull' => 0, 'visible' => 3,), + 'object_type' => array('type' => 'varchar(255)', 'label' => 'object_type', 'enabled' => '1', 'position' => 195, 'notnull' => 0, 'visible' => 0,), + 'fk_object' => array('type' => 'integer', 'label' => 'FKObject', 'enabled' => '1', 'position' => 200, 'notnull' => 1, 'visible' => 0,), + ); + + public $rowid; + public $entity; + public $date_creation; + public $tms; + public $import_key; + public $status; + public $role; + public $firstname; + public $lastname; + public $email; + public $phone; + public $society_name; + public $signature_date; + public $signature_location; + public $signature_comment; + public $element_id; + public $element_type; + public $signature; + public $stamp; + public $signature_url; + public $transaction_url; + public $last_email_sent_date; + public $object_type; + public $fk_object; + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs; + + $this->db = $db; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + + // Example to show how to set values of fields definition dynamically + /*if ($user->rights->dolimeet->digirisksignature->read) { + $this->fields['myfield']['visible'] = 1; + $this->fields['myfield']['noteditable'] = 0; + }*/ + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if ( ! empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } + } + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + public function create(User $user, $notrigger = false) + { + $result = $this->createCommon($user, $notrigger); + if ($result > 0) { + $this->call_trigger('SESSION_ADDATTENDANT',$user); + } + return $result; + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @param string $morewhere More SQL filters (' AND ...') + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = null, $morewhere = '') + { + return $this->fetchCommon($id, $ref, $morewhere); + } + + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) + * @param string $filtermode Filter mode (AND or OR) + * @param string $old_table_element + * @return array|int int <0 if KO, array of pages if OK + * @throws Exception + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND', $old_table_element = '') + { + dol_syslog(__METHOD__, LOG_DEBUG); + + $records = array(); + + $sql = 'SELECT '; + if (dol_strlen($old_table_element) > 0) { + unset($this->fields['signature_location']); + unset($this->fields['object_type']); + } + $sql .= $this->getFieldList(); + + if (dol_strlen($old_table_element)) { + $sql .= ' FROM ' . MAIN_DB_PREFIX . $old_table_element . ' as t'; + } else { + $sql .= ' FROM ' . MAIN_DB_PREFIX . $this->table_element . ' as t'; + } if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= ' WHERE t.entity IN (' . getEntity($this->table_element) . ')'; + else $sql .= ' WHERE 1 = 1'; + // Manage filter + $sqlwhere = array(); + if (count($filter) > 0) { + foreach ($filter as $key => $value) { + if ($key == 't.rowid') { + $sqlwhere[] = $key . '=' . $value; + } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\''; + } elseif ($key == 'customsql') { + $sqlwhere[] = $value; + } elseif (strpos($value, '%') === false) { + $sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')'; + } else { + $sqlwhere[] = $key . ' LIKE \'%' . $this->db->escape($value) . '%\''; + } + } + } + if (count($sqlwhere) > 0) { + $sql .= ' AND (' . implode(' ' . $filtermode . ' ', $sqlwhere) . ')'; + } + + if ( ! empty($sortfield)) { + $sql .= $this->db->order($sortfield, $sortorder); + } + if ( ! empty($limit)) { + $sql .= ' ' . $this->db->plimit($limit, $offset); + } + $resql = $this->db->query($sql); + + if ($resql) { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < ($limit ? min($limit, $num) : $num)) { + $obj = $this->db->fetch_object($resql); + + $record = new self($this->db); + $record->setVarsFromFetchObj($obj); + + $records[$record->id] = $record; + + $i++; + } + $this->db->free($resql); + + return $records; + } else { + $this->errors[] = 'Error ' . $this->db->lasterror(); + dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); + + return -1; + } + } + + /** + * Update object into database + * + * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function update(User $user, $notrigger = false) + { + return $this->updateCommon($user, $notrigger); + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) + { + return $this->deleteCommon($user, $notrigger); + } + + /** + * Set registered status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, >0 if OK + */ + public function setRegistered($user, $notrigger = 0) + { + return $this->setStatusCommon($user, self::STATUS_REGISTERED, $notrigger, 'DOLIMEETSIGNATURE_REGISTERED'); + } + + /** + * Set pending status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, >0 if OK + */ + public function setPending($user, $notrigger = 0) + { + return $this->setStatusCommon($user, self::STATUS_PENDING_SIGNATURE, $notrigger, 'DOLIMEETSIGNATURE_PENDING_SIGNATURE'); + } + + /** + * Set signed status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, >0 if OK + */ + public function setSigned($user, $notrigger = 0) + { + return $this->setStatusCommon($user, self::STATUS_SIGNED, $notrigger, 'DOLIMEETSIGNATURE_SIGNED'); + } + + /** + * Set absent status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, >0 if OK + */ + public function setAbsent($user, $notrigger = 0) + { + return $this->setStatusCommon($user, self::STATUS_ABSENT, $notrigger, 'DOLIMEETSIGNATURE_ABSENT'); + } + + /** + * Set deleted status + * + * @param User $user Object user that modify + * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers + * @return int <0 if KO, >0 if OK + */ + public function setDeleted($user, $notrigger = 0) + { + return $this->setStatusCommon($user, self::STATUS_DELETED, $notrigger, 'DOLIMEETSIGNATURE_DELETED'); + } + + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) + { + return $this->LibStatut($this->status, $mode); + } + + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) + { + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { + global $langs; + $this->labelStatus[self::STATUS_DELETED] = $langs->transnoentities('Deleted'); + $this->labelStatus[self::STATUS_REGISTERED] = $langs->transnoentities('Registered'); + $this->labelStatus[self::STATUS_SIGNATURE_REQUEST] = $langs->transnoentities('SignatureRequest'); + $this->labelStatus[self::STATUS_PENDING_SIGNATURE] = $langs->transnoentities('PendingSignature'); + $this->labelStatus[self::STATUS_DENIED] = $langs->transnoentities('Denied'); + $this->labelStatus[self::STATUS_SIGNED] = $langs->transnoentities('Signed'); + $this->labelStatus[self::STATUS_UNSIGNED] = $langs->transnoentities('Unsigned'); + $this->labelStatus[self::STATUS_ABSENT] = $langs->transnoentities('Absent'); + $this->labelStatus[self::STATUS_JUSTIFIED_ABSENT] = $langs->transnoentities('JustifiedAbsent'); + } + + $statusType = 'status' . $status; + if ($status == self::STATUS_SIGNED) $statusType = 'status4'; + if ($status == self::STATUS_ABSENT) $statusType = 'status8'; + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); + } + + /** + * Create signatory in database + * + * @param int $fk_object ID of object linked + * @param $object_type + * @param string $element_type Type of resource + * @param array $element_ids Id of resource + * @param string $role Role of resource + * @param int $noupdate Update previous signatories + * @return int + * @throws Exception + */ + public function setSignatory($fk_object, $object_type, $element_type, $element_ids, $role = "", $noupdate = 0) + { + global $conf, $user; + + $society = new Societe($this->db); + $result = 0; + if ( ! empty($element_ids) && $element_ids > 0) { + if ( ! $noupdate) { + $this->deletePreviousSignatories($role, $fk_object, $object_type); + } + foreach ($element_ids as $element_id) { + if ($element_id > 0) { + $signatory_data = ''; + if ($element_type == 'user') { + $signatory_data = new User($this->db); + + $signatory_data->fetch($element_id); + + if ($signatory_data->socid > 0) { + $society->fetch($signatory_data->socid); + $this->society_name = $society->name; + } else { + $this->society_name = $conf->global->MAIN_INFO_SOCIETE_NOM; + } + + $this->phone = $signatory_data->user_mobile; + } elseif ($element_type == 'socpeople') { + $signatory_data = new Contact($this->db); + + $signatory_data->fetch($element_id); + if (!is_object($signatory_data)) { + $signatory_data = new StdClass(); + } + + $society->fetch($signatory_data->socid); + + $this->society_name = $society->name; + $this->phone = $signatory_data->phone_mobile; + } + + $this->status = self::STATUS_REGISTERED; + + $this->firstname = $signatory_data->firstname; + $this->lastname = $signatory_data->lastname; + $this->email = $signatory_data->email; + $this->role = $role; + + $this->element_type = $element_type; + $this->element_id = $element_id; + + $this->signature_url = generate_random_id(16); + + $this->fk_object = $fk_object; + + $result = $this->create($user, false); + if ($result > 0) { + if ($role == 'PP_EXT_SOCIETY_INTERVENANTS' || $role == 'FP_EXT_SOCIETY_INTERVENANTS') { + $this->call_trigger(strtoupper(get_class($this)) . '_ADDATTENDANT', $user); + } + } + } + } + } + if ($result > 0 ) { + return 1; + } else { + return 0; + } + } + + /** + * Fetch signatory from database + * + * @param string $role Role of resource + * @param int $fk_object ID of object linked + * @param string $object_type ID of object linked + * @return array|int + * @throws Exception + */ + public function fetchSignatory($role, $fk_object, $object_type) + { + $filter = array('customsql' => 'fk_object=' . $fk_object . ' AND status!=0 AND object_type="' . $object_type . '"'); + if (strlen($role)) { + $filter['customsql'] .= ' AND role = "' . $role . '"'; + return $this->fetchAll('', '', 0, 0, $filter, 'AND'); + } else { + $signatories = $this->fetchAll('', '', 0, 0, $filter, 'AND'); + if ( ! empty($signatories) && $signatories > 0) { + $signatoriesArray = array(); + foreach ($signatories as $signatory) { + $signatoriesArray[$signatory->role][$signatory->id] = $signatory; + } + return $signatoriesArray; + } else { + return 0; + } + } + } + + /** + * Fetch signatories in database with parent ID + * + * @param $fk_object + * @param $object_type + * @param string $morefilter + * @return array|integer + * @throws Exception + */ + public function fetchSignatories($fk_object, $object_type, $morefilter = '1 = 1') + { + $filter = array('customsql' => 'fk_object=' . $fk_object . ' AND ' . $morefilter . ' AND object_type="' . $object_type . '"' . ' AND status > 0'); + return $this->fetchAll('', '', 0, 0, $filter, 'AND'); + } + + /** + * Check if signatories signed + * + * @param $fk_object + * @param $object_type + * @return int + * @throws Exception + */ + public function checkSignatoriesSignatures($fk_object, $object_type) + { + $morefilter = 'status != 0'; + + $signatories = $this->fetchSignatories($fk_object, $object_type, $morefilter); + + if ( ! empty($signatories) && $signatories > 0) { + foreach ($signatories as $signatory) { + if ($signatory->status == 5 || $signatory->status == 7) { + continue; + } else { + return 0; + } + } + return 1; + } else { + return -1; + } + } + + /** + * Delete signatories signatures + * + * @param $fk_object + * @param $object_type + * @return int + * @throws Exception + */ + public function deleteSignatoriesSignatures($fk_object, $object_type) + { + global $user; + + $signatories = $this->fetchSignatories($fk_object, $object_type); + + if ( ! empty($signatories) && $signatories > 0) { + foreach ($signatories as $signatory) { + if (dol_strlen($signatory->signature)) { + $signatory->signature = ''; + $signatory->signature_date = ''; + $signatory->status = 1; + $signatory->update($user); + } + } + return 1; + } else { + return -1; + } + } + + /** + * Set previous signatories status to 0 + * + * @param string $role Role of resource + * @param int $fk_object ID of object linked + * @param string $object_type type of object linked + * @return int + * @throws Exception + */ + public function deletePreviousSignatories($role, $fk_object, $object_type) + { + global $user; + $filter = array('customsql' => ' role="' . $role . '" AND fk_object=' . $fk_object . ' AND status=1 AND object_type="' . $object_type . '"'); + $signatoriesToDelete = $this->fetchAll('', '', 0, 0, $filter, 'AND'); + + if ( ! empty($signatoriesToDelete) && $signatoriesToDelete > 0) { + foreach ($signatoriesToDelete as $signatoryToDelete) { + $signatoryToDelete->setDeleted($user, true); + } + return 1; + } else { + return -1; + } + } +} diff --git a/class/meeting.class.php b/class/meeting.class.php index 206f34d..e336781 100644 --- a/class/meeting.class.php +++ b/class/meeting.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2021 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 @@ -23,11 +23,13 @@ // Put here all includes required by your class file require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +require_once __DIR__ . '/dolimeetsignature.class.php'; +require_once __DIR__ . '/session.class.php'; /** * Class for Meeting */ -class Meeting extends CommonObject +class Meeting extends Session { /** * @var string ID of module. @@ -39,11 +41,6 @@ class Meeting extends CommonObject */ public $element = 'meeting'; - /** - * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. - */ - public $table_element = 'dolimeet_meeting'; - /** * @var int Does this object support multicompany module ? * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table @@ -58,102 +55,22 @@ class Meeting extends CommonObject /** * @var string String with name of icon for document. Must be the part after the 'object_' into object_document.png */ - public $picto = 'dolimeet32px@dolimeet'; - - const STATUS_DELETED = -1; - const STATUS_PENDING_SIGNATURE = 0; - const STATUS_SIGNED = 1; - const STATUS_LOCKED = 2; - const STATUS_SENT_BY_LETTER = 3; - const STATUS_SENT_BY_MAIL = 4; - const STATUS_RECEIVED_BY_MAIL_AND_SIGNED = 5; - const STATUS_RECEIVED_BY_LETTER_AND_SIGNED = 6; - - /** - * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') - * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" - * 'label' the translation key. - * 'picto' is code of a picto to show before value in forms - * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) - * 'position' is the sort order of field. - * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). - * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) - * 'noteditable' says if field is not editable (1 or 0) - * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. - * 'index' if we want an index in database. - * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). - * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. - * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). - * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' - * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. - * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record - * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. - * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' - * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. - * 'comment' is not used. You can store here any text of your choice. It is not used by application. - * - * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. - */ - - /** - * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. - */ - public $fields=array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), - 'ref_ext' => array('type'=>'varchar(128)', 'label'=>'RefExt', 'enabled'=>'1', 'position'=>20, 'notnull'=>0, 'visible'=>0,), - 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'comment'=>"label of object"), - 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>0,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>40, 'notnull'=>1, 'visible'=>2,), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>0,), - 'import_key' => array('type'=>'integer', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>0,), - 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>70, 'notnull'=>1, 'default' => 0, 'visible'=>2, 'index'=>1,), - 'note_public' => array('type'=>'textarea', 'label'=>'PublicNote', 'enabled'=>'1', 'position'=>80, 'notnull'=>0, 'visible'=>0,), - 'note_private' => array('type'=>'textarea', 'label'=>'PrivateNote', 'enabled'=>'1', 'position'=>90, 'notnull'=>0, 'visible'=>0,), - 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'PdfModel', 'enabled'=>'1', 'position'=>100, 'notnull'=>0, 'visible'=>0,), - 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>110, 'notnull'=>0, 'visible'=>0,), - 'content' => array('type'=>'textarea', 'label'=>'Content', 'enabled'=>'1', 'position'=>120, 'notnull'=>1, 'visible'=>3,), - 'document_url' => array('type'=>'varchar(255)', 'label'=>'DocumentUrl', 'enabled'=>'1', 'position'=>150, 'notnull'=>0, 'visible'=>0,), - 'fk_project' => array('type'=>'integer', 'label'=>'Project', 'enabled'=>'1', 'position'=>175, 'notnull'=>1, 'visible'=>1,), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>180, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>190, 'notnull'=>-1, 'visible'=>0,), - ); - - public $rowid; - public $ref; - public $ref_ext; - public $entity; - public $date_creation; - public $tms; - public $status; - public $import_key; - public $note_public; - public $note_private; - public $last_main_doc; - public $model_pdf; - public $content; - public $document_url; - public $fk_project; - public $fk_user_creat; - public $fk_user_modif; - public $label; + public $picto = 'meeting@dolimeet'; /** * Constructor * * @param DoliDb $db Database handler */ - public function __construct(DoliDB $db) { + public function __construct(DoliDB $db) + { global $conf, $langs; $this->db = $db; + $this->type = 'meeting'; - if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { - $this->fields['rowid']['visible'] = 0; - } - if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { - $this->fields['entity']['enabled'] = 0; - } + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; // Unset fields that are disabled foreach ($this->fields as $key => $val) { @@ -165,7 +82,7 @@ public function __construct(DoliDB $db) { // Translate some data of arrayofkeyval if (is_object($langs)) { foreach ($this->fields as $key => $val) { - if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + if (is_array($val['arrayofkeyval'])) { foreach ($val['arrayofkeyval'] as $key2 => $val2) { $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); } @@ -173,383 +90,119 @@ public function __construct(DoliDB $db) { } } } +} - /** - * Create object into database - * - * @param User $user User that creates - * @param bool $notrigger false=launch triggers after, true=disable triggers - * @return int <0 if KO, Id of created object if OK - */ - public function create(User $user, $notrigger = false) { - return $this->createCommon($user, $notrigger); - } - - /** - * Load object in memory from the database - * - * @param int $id Id object - * @param string $ref Ref - * @return int <0 if KO, 0 if not found, >0 if OK - */ - public function fetch($id, $ref = null) { - $result = $this->fetchCommon($id, $ref); - return $result; - } +/** + * Class MeetingSignature + */ +class MeetingSignature extends DolimeetSignature +{ /** - * Load list of objects in memory from the database. - * - * @param string $sortorder Sort Order - * @param string $sortfield Sort field - * @param int $limit limit - * @param int $offset Offset - * @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) - * @param string $filtermode Filter mode (AND or OR) - * @return array|int int <0 if KO, array of pages if OK + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. */ - public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { - global $conf; - dol_syslog(__METHOD__, LOG_DEBUG); - - $records = array(); - - $sql = 'SELECT '; - $sql .= $this->getFieldList('t'); - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; - if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { - $sql .= ' WHERE t.entity IN ('.getEntity($this->table_element).')'; - } else { - $sql .= ' WHERE 1 = 1'; - } - // Manage filter - $sqlwhere = array(); - if (count($filter) > 0) { - foreach ($filter as $key => $value) { - if ($key == 't.rowid') { - $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { - $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; - } elseif ($key == 'customsql') { - $sqlwhere[] = $value; - } elseif (strpos($value, '%') === false) { - $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; - } else { - $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; - } - } - } - if (count($sqlwhere) > 0) { - $sql .= ' AND ('.implode(' '.$filtermode.' ', $sqlwhere).')'; - } - - if (!empty($sortfield)) { - $sql .= $this->db->order($sortfield, $sortorder); - } - if (!empty($limit)) { - $sql .= ' '.$this->db->plimit($limit, $offset); - } - - $resql = $this->db->query($sql); - if ($resql) { - $num = $this->db->num_rows($resql); - $i = 0; - while ($i < ($limit ? min($limit, $num) : $num)) { - $obj = $this->db->fetch_object($resql); - - $record = new self($this->db); - $record->setVarsFromFetchObj($obj); - - $records[$record->id] = $record; - - $i++; - } - $this->db->free($resql); - - return $records; - } else { - $this->errors[] = 'Error '.$this->db->lasterror(); - dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); - - return -1; - } - } + public $object_type = 'meeting'; /** - * Update object into database - * - * @param User $user User that modifies - * @param bool $notrigger false=launch triggers after, true=disable triggers - * @return int <0 if KO, >0 if OK + * @var array Context element object */ - public function update(User $user, $notrigger = false) { - return $this->updateCommon($user, $notrigger); - } + public $context = array(); /** - * Delete object in database - * - * @param User $user User that deletes - * @param bool $notrigger false=launch triggers after, true=disable triggers - * @return int <0 if KO, >0 if OK + * @var string String with name of icon for document. Must be the part after the 'object_' into object_document.png */ - public function delete(User $user, $notrigger = false) { - $this->setStatusCommon($user, 0); - $this->call_trigger('MEETING_DELETE', $user); - } + public $picto = 'meeting@dolimeet'; /** - * Return a link to the object card (with optionaly the picto) + * Constructor * - * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) - * @param string $option On what the link point to ('nolink', ...) - * @param int $notooltip 1=Disable tooltip - * @param string $morecss Add more css on link - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking - * @return string String with URL + * @param DoliDb $db Database handler */ - public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { - global $conf, $langs, $hookmanager; - - if (!empty($conf->dol_no_mouse_hover)) { - $notooltip = 1; // Force disable tooltips - } - - $result = ''; - - $label = img_picto('', $this->picto).' '.$langs->trans("Meeting").''; - if (isset($this->status)) { - $label .= ' '.$this->getLibStatut(5); - } - $label .= '
    '; - $label .= ''.$langs->trans('Ref').': '.$this->ref; + public function __construct(DoliDB $db) + { + global $conf, $langs; - $url = dol_buildpath('/dolimeet/meeting_card.php', 1).'?id='.$this->id; + $this->db = $db; - if ($option != 'nolink') { - // Add param to save lastsearch_values or not - $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); - if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { - $add_save_lastsearch_values = 1; - } - if ($add_save_lastsearch_values) { - $url .= '&save_lastsearch_values=1'; - } - } + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; - $linkclose = ''; - if (empty($notooltip)) { - if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $label = $langs->trans("ShowMeeting"); - $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; - } else { - $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); - } - - if ($option == 'nolink') { - $linkstart = ''; - if ($option == 'nolink') { - $linkend = ''; - } else { - $linkend = ''; - } - - $result .= $linkstart; - if (empty($this->showphoto_on_popup)) { - if ($withpicto) { - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); - } - } else { - if ($withpicto) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - - list($class, $module) = explode('@', $this->picto); - $upload_dir = $conf->$module->multidir_output[$conf->entity]."/$class/".dol_sanitizeFileName($this->ref); - $filearray = dol_dir_list($upload_dir, "files"); - $filename = $filearray[0]['name']; - if (!empty($filename)) { - $pospoint = strpos($filearray[0]['name'], '.'); - - $pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint); - if (empty($conf->global->{strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS'})) { - $result .= '
    No photo
    '; - } else { - $result .= '
    No photo
    '; + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); } - - $result .= ''; - } else { - $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1); } } } - - if ($withpicto != 2) { - $result .= $this->ref; - } - - $result .= $linkend; - //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); - - global $action, $hookmanager; - $hookmanager->initHooks(array('documentdao')); - $parameters = array('id'=>$this->id, 'getnomurl'=>$result); - $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - if ($reshook > 0) { - $result = $hookmanager->resPrint; - } else { - $result .= $hookmanager->resPrint; - } - - return $result; } /** - * Return the label of the status + * Clone an object into another one * - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @param $meetingid + * @return mixed New object created, <0 if KO + * @throws Exception */ - public function getLibStatut($mode = 0) { - return $this->LibStatut($this->status, $mode); - } - - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps - /** - * Return the status - * - * @param int $status Id status - * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto - * @return string Label of status - */ - public function LibStatut($status, $mode = 0) { - if (empty($this->labelStatus) || empty($this->labelStatusShort)) { - global $langs; - $langs->load("dolimeet@dolimeet"); - $this->labelStatus[self::STATUS_DELETED] = $langs->trans('Deleted'); - $this->labelStatus[self::STATUS_PENDING_SIGNATURE] = $langs->trans('ValidatePendingSignature'); - $this->labelStatus[self::STATUS_SIGNED] = $langs->trans('Signed'); - $this->labelStatus[self::STATUS_LOCKED] = $langs->trans('Locked'); - $this->labelStatus[self::STATUS_SENT_BY_LETTER] = $langs->trans('SentByLetter'); - $this->labelStatus[self::STATUS_SENT_BY_MAIL] = $langs->trans('SentByMail'); - $this->labelStatus[self::STATUS_RECEIVED_BY_MAIL_AND_SIGNED] = $langs->trans('ReceivedAndSignedByMail'); - $this->labelStatus[self::STATUS_RECEIVED_BY_LETTER_AND_SIGNED] = $langs->trans('ReceivedAndSignedByLetter'); - } - - $statusType = 'status' . $status; - if ($status == self::STATUS_DELETED) $statusType = 'status0'; - if ($status == self::STATUS_PENDING_SIGNATURE) $statusType = 'status3'; - if ($status == self::STATUS_LOCKED) $statusType = 'status8'; - if ($status == self::STATUS_SENT_BY_LETTER) $statusType = 'status7'; - if ($status == self::STATUS_SENT_BY_MAIL) $statusType = 'status7'; - if ($status == self::STATUS_RECEIVED_BY_MAIL_AND_SIGNED) $statusType = 'status6'; - if ($status == self::STATUS_RECEIVED_BY_LETTER_AND_SIGNED) $statusType = 'status6'; - - return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); - } - - /** - * Load the info information in the object - * - * @param int $id Id of object - * @return void - */ - public function info($id) + public function createFromClone(User $user, $fromid, $meetingid) { - $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; - $sql .= ' fk_user_creat, fk_user_modif'; - $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; - $sql .= ' WHERE t.rowid = '.((int) $id); - $result = $this->db->query($sql); - if ($result) { - if ($this->db->num_rows($result)) { - $obj = $this->db->fetch_object($result); - $this->id = $obj->rowid; - if ($obj->fk_user_author) { - $cuser = new User($this->db); - $cuser->fetch($obj->fk_user_author); - $this->user_creation = $cuser; - } - - if ($obj->fk_user_valid) { - $vuser = new User($this->db); - $vuser->fetch($obj->fk_user_valid); - $this->user_validation = $vuser; - } + $error = 0; - if ($obj->fk_user_cloture) { - $cluser = new User($this->db); - $cluser->fetch($obj->fk_user_cloture); - $this->user_cloture = $cluser; - } - - $this->date_creation = $this->db->jdate($obj->datec); - $this->date_modification = $this->db->jdate($obj->datem); - $this->date_validation = $this->db->jdate($obj->datev); - } - - $this->db->free($result); - } else { - dol_print_error($this->db); - } - } - - /** - * Initialise object with example values - * Id must be 0 if object instance is a specimen - * - * @return void - */ - public function initAsSpecimen() - { - $this->initAsSpecimenCommon(); - } + dol_syslog(__METHOD__, LOG_DEBUG); - /** - * Create a document onto disk according to template module. - * - * @param string $modele Force template to use ('' to not force) - * @param Translate $outputlangs objet lang a utiliser pour traduction - * @param int $hidedetails Hide details of lines - * @param int $hidedesc Hide description - * @param int $hideref Hide ref - * @param null|array $moreparams Array to provide more information - * @return int 0 if KO, 1 if OK - */ - public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { - global $conf, $langs; + $object = new self($this->db); - $result = 0; - $includedocgeneration = 1; + $this->db->begin(); - $langs->load("dolimeet@dolimeet"); + // Load source object + $object->fetchCommon($fromid); - if (!dol_strlen($modele)) { - $modele = 'standard_document'; + // Reset some properties + unset($object->id); + unset($object->fk_user_creat); + unset($object->import_key); + unset($object->signature); + unset($object->signature_date); + unset($object->last_email_sent_date); - if (!empty($this->model_pdf)) { - $modele = $this->model_pdf; - } elseif (!empty($conf->global->DOLILETTER_ADDON_PDF)) { - $modele = $conf->global->DOLILETTER_ADDON_PDF; - } + // Clear fields + if (property_exists($object, 'date_creation')) { + $object->date_creation = dol_now(); + } + if (property_exists($object, 'fk_object')) { + $object->fk_object = $meetingid; + } + if (property_exists($object, 'status')) { + $object->status = 1; + } + if (property_exists($object, 'signature_url')) { + $object->signature_url = generate_random_id(16); } - $modelpath = "core/modules/dolimeet/doc/"; + // Create clone + $object->context['createfromclone'] = 'createfromclone'; + $result = $object->createCommon($user); + unset($object->context['createfromclone']); - if ($includedocgeneration && !empty($modele)) { - $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + // End + if ( ! $error) { + $this->db->commit(); + return $result; + } else { + $this->db->rollback(); + return -1; } - - return $result; } } - diff --git a/class/openinghours.class.php b/class/openinghours.class.php new file mode 100644 index 0000000..f908524 --- /dev/null +++ b/class/openinghours.class.php @@ -0,0 +1,176 @@ + + * + * 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 class/openinghours.class.php + * \ingroup dolimeet + * \brief This file is a CRUD class file for Openinghours (Create/Read/Update/Delete) + */ + +require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; + +/** + * Class for Openinghours + */ +class Openinghours extends CommonObject +{ + /** + * @var DoliDB Database handler. + */ + public $db; + + /** + * @var string ID to identify managed object. + */ + public $element = 'openinghours'; + + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + public $table_element = 'element_openinghours'; + + /** + * @var int Does this object support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table + */ + public $ismultientitymanaged = 1; + + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + + /** + * @var string String with name of icon for openinghours. Must be the part after the 'object_' into object_openinghours.png + */ + public $picto = 'openinghours@dolimeet'; + + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields = array( + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'comment' => "Id"), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => -1,), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 20, 'notnull' => 1, 'visible' => -2,), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 30, 'notnull' => 0, 'visible' => -2,), + 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => '1', 'position' => 40, 'notnull' => 0, 'visible' => -1,), + 'element_type' => array('type' => 'varchar(50)', 'label' => 'ElementType', 'enabled' => '1', 'position' => 50, 'notnull' => 0, 'visible' => -1,), + 'element_id' => array('type' => 'integer', 'label' => 'ElementID', 'enabled' => '1', 'position' => 60, 'notnull' => 1, 'visible' => -1,), + 'monday' => array('type' => 'varchar(128)', 'label' => 'Day 0', 'enabled' => '1', 'position' => 70, 'notnull' => 0, 'visible' => 1,), + 'tuesday' => array('type' => 'varchar(128)', 'label' => 'Day 1', 'enabled' => '1', 'position' => 80, 'notnull' => 0, 'visible' => 1,), + 'wednesday' => array('type' => 'varchar(128)', 'label' => 'Day 2', 'enabled' => '1', 'position' => 90, 'notnull' => 0, 'visible' => 1,), + 'thursday' => array('type' => 'varchar(128)', 'label' => 'Day 3', 'enabled' => '1', 'position' => 100, 'notnull' => 0, 'visible' => 1,), + 'friday' => array('type' => 'varchar(128)', 'label' => 'Day 4', 'enabled' => '1', 'position' => 110, 'notnull' => 0, 'visible' => 1,), + 'saturday' => array('type' => 'varchar(128)', 'label' => 'Day 5', 'enabled' => '1', 'position' => 120, 'notnull' => 0, 'visible' => 1,), + 'sunday' => array('type' => 'varchar(128)', 'label' => 'Day 6', 'enabled' => '1', 'position' => 130, 'notnull' => 0, 'visible' => 1,), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 140, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',), + ); + + public $rowid; + public $entity; + public $date_creation; + public $tms; + public $status; + public $element_type; + public $element_id; + public $monday; + public $tuesday; + public $wednesday; + public $thursday; + public $friday; + public $saturday; + public $sunday; + public $fk_user_creat; + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs; + + $this->db = $db; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } + } + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK + * @throws Exception + */ + public function create(User $user, $notrigger = false) + { + $sql = "UPDATE " . MAIN_DB_PREFIX . "$this->table_element"; + $sql .= " SET status = 0"; + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) $sql .= ' WHERE entity IN (' . getEntity($this->table_element) . ')'; + else $sql .= ' WHERE 1 = 1'; + $sql .= " AND element_type = " . "'" . $this->element_type . "'"; + $sql .= " AND element_id = " . $this->element_id; + + dol_syslog("admin.lib::create", LOG_DEBUG); + $this->db->query($sql); + return $this->createCommon($user, $notrigger); + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @param string $morewhere More SQL filters (' AND ...') + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = null, $morewhere = '') + { + return $this->fetchCommon($id, $ref, $morewhere); + } + + /** + * Return label of contact status + * + * @return string Label of contact status + */ + public function getLibStatut() + { + return ''; + } +} diff --git a/class/session.class.php b/class/session.class.php new file mode 100644 index 0000000..287bac7 --- /dev/null +++ b/class/session.class.php @@ -0,0 +1,709 @@ + + * + * 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 class/session.class.php + * \ingroup dolimeet + * \brief This file is a CRUD class file for Document (Create/Read/Update/Delete) + */ + +// Put here all includes required by your class file +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +require_once __DIR__ . '/dolimeetsignature.class.php'; + +/** + * Class for Session + */ +class Session extends CommonObject +{ + /** + * @var string ID of module. + */ + public $module = 'dolimeet'; + + /** + * @var string ID to identify managed object. + */ + public $element = 'session'; + + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + public $table_element = 'dolimeet_session'; + + /** + * @var int Does this object support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table + */ + public $ismultientitymanaged = 1; + + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + + const STATUS_DELETED = -1; + const STATUS_PENDING_SIGNATURE = 0; + const STATUS_SIGNED = 1; + const STATUS_LOCKED = 2; + const STATUS_SENT_BY_LETTER = 3; + const STATUS_SENT_BY_MAIL = 4; + const STATUS_RECEIVED_BY_MAIL_AND_SIGNED = 5; + const STATUS_RECEIVED_BY_LETTER_AND_SIGNED = 6; + + /** + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" + * 'label' the translation key. + * 'picto' is code of a picto to show before value in forms + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM) + * 'position' is the sort order of field. + * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'noteditable' says if field is not editable (1 or 0) + * 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created. + * 'index' if we want an index in database. + * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). + * 'searchall' is 1 if we want to search in this field when making a search from the quick search button. + * 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8). + * 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200' + * 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click. + * 'showoncombobox' if value of the field must be visible into the label of the combobox that list record + * 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code. + * 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar' + * 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1. + * 'comment' is not used. You can store here any text of your choice. It is not used by application. + * + * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. + */ + + /** + * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + */ + public $fields=array( + 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"), + 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"), + 'ref_ext' => array('type'=>'varchar(128)', 'label'=>'RefExt', 'enabled'=>'1', 'position'=>20, 'notnull'=>0, 'visible'=>0,), + 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'comment'=>"label of object"), + 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>0,), + 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>40, 'notnull'=>1, 'visible'=>2,), + 'date_start' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>41, 'notnull'=>0, 'visible'=>1,), + 'date_end' => array('type'=>'datetime', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>42, 'notnull'=>0, 'visible'=>1,), + 'duration' => array('type'=>'integer', 'label'=>'Duration', 'enabled'=>'1', 'position'=>45, 'notnull'=>0, 'visible'=>1,), + 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>0,), + 'import_key' => array('type'=>'integer', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>0,), + 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>70, 'notnull'=>1, 'default' => 1, 'visible'=>2, 'index'=>1,), + 'type' => array('type'=>'varchar(128)', 'label'=>'Type', 'enabled'=>'1', 'position'=>70, 'notnull'=>1, 'default' => '', 'visible'=>4, 'index'=>1,), + 'note_public' => array('type'=>'textarea', 'label'=>'PublicNote', 'enabled'=>'1', 'position'=>80, 'notnull'=>0, 'visible'=>0,), + 'note_private' => array('type'=>'textarea', 'label'=>'PrivateNote', 'enabled'=>'1', 'position'=>90, 'notnull'=>0, 'visible'=>0,), + 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'PdfModel', 'enabled'=>'1', 'position'=>100, 'notnull'=>0, 'visible'=>0,), + 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>110, 'notnull'=>0, 'visible'=>0,), + 'content' => array('type'=>'textarea', 'label'=>'Content', 'enabled'=>'1', 'position'=>120, 'notnull'=>1, 'visible'=>3,), + 'document_url' => array('type'=>'varchar(255)', 'label'=>'DocumentUrl', 'enabled'=>'1', 'position'=>150, 'notnull'=>0, 'visible'=>0,), + 'fk_project' => array('type'=>'integer', 'label'=>'Project', 'enabled'=>'1', 'position'=>175, 'notnull'=>1, 'visible'=>1,), + 'fk_contrat' => array('type'=>'integer', 'label'=>'Contract', 'enabled'=>'1', 'position'=>175, 'notnull'=>1, 'visible'=>1,), + 'fk_soc' => array('type'=>'integer', 'label'=>'Thirdparty', 'enabled'=>'1', 'position'=>175, 'notnull'=>1, 'visible'=>0,), + 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>180, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',), + 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>190, 'notnull'=>-1, 'visible'=>0,), + ); + + public $rowid; + public $ref; + public $ref_ext; + public $entity; + public $date_creation; + public $date_start; + public $date_end; + public $duration; + public $tms; + public $status; + public $type; + public $import_key; + public $note_public; + public $note_private; + public $last_main_doc; + public $model_pdf; + public $content; + public $document_url; + public $fk_project; + public $fk_contrat; + public $fk_soc; + public $fk_user_creat; + public $fk_user_modif; + public $label; + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) { + global $conf, $langs; + + $this->db = $db; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) { + $this->fields['rowid']['visible'] = 0; + } + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) { + $this->fields['entity']['enabled'] = 0; + } + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } + } + + /** + * Create object into database + * + * @param User $user User that creates + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, Id of created object if OK + */ + public function create(User $user, $notrigger = false) { + return $this->createCommon($user, $notrigger); + } + + /** + * Load object in memory from the database + * + * @param int $id Id object + * @param string $ref Ref + * @return int <0 if KO, 0 if not found, >0 if OK + */ + public function fetch($id, $ref = null) { + $result = $this->fetchCommon($id, $ref); + return $result; + } + + /** + * Load list of objects in memory from the database. + * + * @param string $sortorder Sort Order + * @param string $sortfield Sort field + * @param int $limit limit + * @param int $offset Offset + * @param array $filter Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) + * @param string $filtermode Filter mode (AND or OR) + * @return array|int int <0 if KO, array of pages if OK + */ + public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') { + global $conf; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $records = array(); + + $sql = 'SELECT '; + $sql .= $this->getFieldList('t'); + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; + if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) { + $sql .= ' WHERE t.entity IN ('.getEntity($this->table_element).')'; + } else { + $sql .= ' WHERE 1 = 1'; + } + // Manage filter + $sqlwhere = array(); + if (count($filter) > 0) { + foreach ($filter as $key => $value) { + if ($key == 't.rowid') { + $sqlwhere[] = $key.'='.$value; + } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; + } elseif ($key == 'customsql') { + $sqlwhere[] = $value; + } elseif (strpos($value, '%') === false) { + $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; + } else { + $sqlwhere[] = $key.' LIKE \'%'.$this->db->escape($value).'%\''; + } + } + } + if (count($sqlwhere) > 0) { + $sql .= ' AND ('.implode(' '.$filtermode.' ', $sqlwhere).')'; + } + + if (!empty($sortfield)) { + $sql .= $this->db->order($sortfield, $sortorder); + } + if (!empty($limit)) { + $sql .= ' '.$this->db->plimit($limit, $offset); + } + + $resql = $this->db->query($sql); + if ($resql) { + $num = $this->db->num_rows($resql); + $i = 0; + while ($i < ($limit ? min($limit, $num) : $num)) { + $obj = $this->db->fetch_object($resql); + + $record = new self($this->db); + $record->setVarsFromFetchObj($obj); + + $records[$record->id] = $record; + + $i++; + } + $this->db->free($resql); + + return $records; + } else { + $this->errors[] = 'Error '.$this->db->lasterror(); + dol_syslog(__METHOD__.' '.join(',', $this->errors), LOG_ERR); + + return -1; + } + } + + /** + * Update object into database + * + * @param User $user User that modifies + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function update(User $user, $notrigger = false) { + return $this->updateCommon($user, $notrigger); + } + + /** + * Delete object in database + * + * @param User $user User that deletes + * @param bool $notrigger false=launch triggers after, true=disable triggers + * @return int <0 if KO, >0 if OK + */ + public function delete(User $user, $notrigger = false) { + $this->setStatusCommon($user, 0); + $this->call_trigger('MEETING_DELETE', $user); + } + + /** + * Return a link to the object card (with optionaly the picto) + * + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL + */ + public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1) { + global $conf, $langs, $hookmanager; + + if (!empty($conf->dol_no_mouse_hover)) { + $notooltip = 1; // Force disable tooltips + } + + $result = ''; + + $picto = ''; + switch ($this->type) { + case 'trainingsession': + $picto = ''; + break; + case 'meeting': + $picto = ''; + break; + case 'audit': + $picto = ''; + break; + } + + $label = $picto .' '.$langs->trans("Session").''; + if (isset($this->status)) { + $label .= ' '.$this->getLibStatut(5); + } + + $label .= '
    '; + $label .= ''.$langs->trans('Ref').': '.$this->ref; + + $url = dol_buildpath('/dolimeet/view/' . $this->type .'/'. $this->type .'_card.php', 1).'?id='.$this->id; + + if ($option != 'nolink') { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) { + $add_save_lastsearch_values = 1; + } + if ($add_save_lastsearch_values) { + $url .= '&save_lastsearch_values=1'; + } + } + + $linkclose = ''; + if (empty($notooltip)) { + if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { + $label = $langs->trans("ShowSession"); + $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; + } else { + $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); + } + + if ($option == 'nolink') { + $linkstart = ''; + if ($option == 'nolink') { + $linkend = ''; + } else { + $linkend = ''; + } + + $result .= $linkstart; + + if ($withpicto) $result .= $picto . ' '; + + if ($withpicto != 2) { + $result .= $this->ref; + } + + $result .= $linkend; + //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + + global $action, $hookmanager; + $hookmanager->initHooks(array('documentdao')); + $parameters = array('id'=>$this->id, 'getnomurl'=>$result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } + + return $result; + } + + /** + * Return the label of the status + * + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function getLibStatut($mode = 0) { + return $this->LibStatut($this->status, $mode); + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Return the status + * + * @param int $status Id status + * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto + * @return string Label of status + */ + public function LibStatut($status, $mode = 0) { + if (empty($this->labelStatus) || empty($this->labelStatusShort)) { + global $langs; + $langs->load("dolimeet@dolimeet"); + $this->labelStatus[self::STATUS_DELETED] = $langs->trans('Deleted'); + $this->labelStatus[self::STATUS_PENDING_SIGNATURE] = $langs->trans('ValidatePendingSignature'); + $this->labelStatus[self::STATUS_SIGNED] = $langs->trans('Signed'); + $this->labelStatus[self::STATUS_LOCKED] = $langs->trans('Locked'); + $this->labelStatus[self::STATUS_SENT_BY_LETTER] = $langs->trans('SentByLetter'); + $this->labelStatus[self::STATUS_SENT_BY_MAIL] = $langs->trans('SentByMail'); + $this->labelStatus[self::STATUS_RECEIVED_BY_MAIL_AND_SIGNED] = $langs->trans('ReceivedAndSignedByMail'); + $this->labelStatus[self::STATUS_RECEIVED_BY_LETTER_AND_SIGNED] = $langs->trans('ReceivedAndSignedByLetter'); + } + + $statusType = 'status' . $status; + if ($status == self::STATUS_DELETED) $statusType = 'status0'; + if ($status == self::STATUS_PENDING_SIGNATURE) $statusType = 'status3'; + if ($status == self::STATUS_LOCKED) $statusType = 'status8'; + if ($status == self::STATUS_SENT_BY_LETTER) $statusType = 'status7'; + if ($status == self::STATUS_SENT_BY_MAIL) $statusType = 'status7'; + if ($status == self::STATUS_RECEIVED_BY_MAIL_AND_SIGNED) $statusType = 'status6'; + if ($status == self::STATUS_RECEIVED_BY_LETTER_AND_SIGNED) $statusType = 'status6'; + + return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); + } + + /** + * Load the info information in the object + * + * @param int $id Id of object + * @return void + */ + public function info($id) + { + $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; + $sql .= ' fk_user_creat, fk_user_modif'; + $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; + $sql .= ' WHERE t.rowid = '.((int) $id); + $result = $this->db->query($sql); + if ($result) { + if ($this->db->num_rows($result)) { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + if ($obj->fk_user_author) { + $cuser = new User($this->db); + $cuser->fetch($obj->fk_user_author); + $this->user_creation = $cuser; + } + + if ($obj->fk_user_valid) { + $vuser = new User($this->db); + $vuser->fetch($obj->fk_user_valid); + $this->user_validation = $vuser; + } + + if ($obj->fk_user_cloture) { + $cluser = new User($this->db); + $cluser->fetch($obj->fk_user_cloture); + $this->user_cloture = $cluser; + } + + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_modification = $this->db->jdate($obj->datem); + $this->date_validation = $this->db->jdate($obj->datev); + } + + $this->db->free($result); + } else { + dol_print_error($this->db); + } + } + + /** + * Initialise object with example values + * Id must be 0 if object instance is a specimen + * + * @return void + */ + public function initAsSpecimen() + { + $this->initAsSpecimenCommon(); + } + + /** + * Sets object to supplied categories. + * + * Deletes object from existing categories not supplied. + * Adds it to non existing supplied categories. + * Existing categories are left untouch. + * + * @param int[]|int $categories Category or categories IDs + * @return void + */ + public function setCategories($categories) + { + return parent::setCategoriesCommon($categories, 'session'); + } + + /** + * Create a document onto disk according to template module. + * + * @param string $modele Force template to use ('' to not force) + * @param Translate $outputlangs objet lang a utiliser pour traduction + * @param int $hidedetails Hide details of lines + * @param int $hidedesc Hide description + * @param int $hideref Hide ref + * @param null|array $moreparams Array to provide more information + * @return int 0 if KO, 1 if OK + */ + public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null) { + global $conf, $langs; + + $result = 0; + $includedocgeneration = 1; + + $langs->load("dolimeet@dolimeet"); + + if (!dol_strlen($modele)) { + $modele = 'standard_document'; + + if (!empty($this->model_pdf)) { + $modele = $this->model_pdf; + } elseif (!empty($conf->global->DOLILETTER_ADDON_PDF)) { + $modele = $conf->global->DOLILETTER_ADDON_PDF; + } + } + + + $modelpath = "custom/dolimeet/core/modules/dolimeet/documents/"; + + if ($includedocgeneration && !empty($modele)) { + $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + } + + return $result; + } + + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @param $options + * @return mixed New object created, <0 if KO + * @throws Exception + */ + public function createFromClone(User $user, $fromid, $options) + { + global $conf, $langs; + $error = 0; + + require_once __DIR__ . '/meeting.class.php'; + require_once __DIR__ . '/trainingsession.class.php'; + require_once __DIR__ . '/audit.class.php'; + + + switch ($this->type) { + case 'meeting': + $signatory = new TrainingSessionSignature($this->db); + break; + case 'trainingsession': + $signatory = new MeetingSignature($this->db); + break; + case 'audit': + $signatory = new AuditSignature($this->db); + break; + } + + $conf_mod = "DOLIMEET_" . strtoupper($this->type) . '_ADDON'; + $refObjectMod = new $conf->global->$conf_mod($this->db); + + dol_syslog(__METHOD__, LOG_DEBUG); + + $object = new self($this->db); + + $this->db->begin(); + + // Load source object + $result = $object->fetchCommon($fromid); + if ($result > 0 && ! empty($object->table_element_line)) { + $object->fetchLines(); + } + + // Load signatory and ressources from source object + $signatories = $signatory->fetchSignatory("", $fromid, $this->type); + + if ( ! empty($signatories) && $signatories > 0) { + foreach ($signatories as $arrayRole) { + foreach ($arrayRole as $signatoryRole) { + $signatoriesID[$signatoryRole->role] = $signatoryRole->id; + if ($signatoryRole->role == strtoupper($this->type) . '_EXTERNAL_ATTENDANT') { + $extintervenant_ids[] = $signatoryRole->id; + } + } + } + } + + // Reset some properties + unset($object->id); + unset($object->fk_user_creat); + unset($object->import_key); + + // Clear fields + if (property_exists($object, 'ref')) { + $object->ref = $refObjectMod->getNextValue($object); + } + if (property_exists($object, 'ref_ext')) { + $object->ref_ext = 'dolimeet_' . $object->ref; + } + if (property_exists($object, 'label')) { + $object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf") . " " . $object->label : $this->fields['label']['default']; + } + if (property_exists($object, 'date_creation')) { + $object->date_creation = dol_now(); + } + if (property_exists($object, 'status')) { + $object->status = 1; + } + + // Create clone + $object->context['createfromclone'] = 'createfromclone'; + $object_id = $object->create($user); + + if ($object_id > 0) { + if (!empty($signatoriesID)) { + $signatory->createFromClone($user, $signatoriesID[strtoupper($this->type) . '_EXTERNAL_ATTENDANT'], $object_id); + $signatory->createFromClone($user, $signatoriesID[strtoupper($this->type) . '_SOCIETY_ATTENDANT'], $object_id); + } + + if ( ! empty($options['schedule'])) { + if ( ! empty($openinghours)) { + $openinghours->element_id = $object_id; + $openinghours->create($user); + } + } + + if ( ! empty($options['attendants'])) { + if ( ! empty($extintervenant_ids) && $extintervenant_ids > 0) { + foreach ($extintervenant_ids as $extintervenant_id) { + $signatory->createFromClone($user, $extintervenant_id, $object_id); + } + } + } + + if ( ! empty($options['preventionplan_risk'])) { + $num = (!empty($object->lines) ? count($object->lines) : 0); + for ($i = 0; $i < $num; $i++) { + $line = $object->lines[$i]; + if (property_exists($line, 'ref')) { + $line->ref = $refPreventionPlanDetMod->getNextValue($line); + } + $line->category = empty($line->category) ? 0 : $line->category; + $line->fk_preventionplan = $object_id; + + $result = $line->insert($user, 1); + if ($result < 0) { + $this->error = $this->db->lasterror(); + $this->db->rollback(); + return -1; + } + } + } + } else { + $error++; + $this->error = $object->error; + $this->errors = $object->errors; + } + + unset($object->context['createfromclone']); + + // End + if ( ! $error) { + $this->db->commit(); + return $object_id; + } else { + $this->db->rollback(); + return -1; + } + } + +} diff --git a/class/trainingsession.class.php b/class/trainingsession.class.php new file mode 100644 index 0000000..ec772b3 --- /dev/null +++ b/class/trainingsession.class.php @@ -0,0 +1,208 @@ + + * + * 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 class/trainingsession.class.php + * \ingroup dolimeet + * \brief This file is a CRUD class file for Document (Create/Read/Update/Delete) + */ + +// Put here all includes required by your class file +require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +require_once __DIR__ . '/dolimeetsignature.class.php'; +require_once __DIR__ . '/session.class.php'; + +/** + * Class for TrainingSession + */ +class TrainingSession extends Session +{ + /** + * @var string ID of module. + */ + public $module = 'dolimeet'; + + /** + * @var string ID to identify managed object. + */ + public $element = 'trainingsession'; + + /** + * @var string String with name of icon for document. Must be the part after the 'object_' into object_document.png + */ + public $picto = 'trainingsession@dolimeet'; + + /** + * @var int Does this object support multicompany module ? + * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table + */ + public $ismultientitymanaged = 1; + + /** + * @var int Does object support extrafields ? 0=No, 1=Yes + */ + public $isextrafieldmanaged = 1; + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs; + + $this->db = $db; + $this->type = 'trainingsession'; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } + } +} + +/** + * Class TrainingSessionSignature + */ + +class TrainingSessionSignature extends DolimeetSignature +{ + /** + * @var string Name of table without prefix where object is stored. This is also the key used for extrafields management. + */ + + public $object_type = 'trainingsession'; + + /** + * @var array Context element object + */ + public $context = array(); + + /** + * @var string String with name of icon for document. Must be the part after the 'object_' into object_document.png + */ + public $picto = 'trainingsession@dolimeet'; + + /** + * Constructor + * + * @param DoliDb $db Database handler + */ + public function __construct(DoliDB $db) + { + global $conf, $langs; + + $this->db = $db; + + if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) $this->fields['rowid']['visible'] = 0; + if (empty($conf->multicompany->enabled) && isset($this->fields['entity'])) $this->fields['entity']['enabled'] = 0; + + // Unset fields that are disabled + foreach ($this->fields as $key => $val) { + if (isset($val['enabled']) && empty($val['enabled'])) { + unset($this->fields[$key]); + } + } + + // Translate some data of arrayofkeyval + if (is_object($langs)) { + foreach ($this->fields as $key => $val) { + if (is_array($val['arrayofkeyval'])) { + foreach ($val['arrayofkeyval'] as $key2 => $val2) { + $this->fields[$key]['arrayofkeyval'][$key2] = $langs->trans($val2); + } + } + } + } + } + + /** + * Clone an object into another one + * + * @param User $user User that creates + * @param int $fromid Id of object to clone + * @param $trainingsessionid + * @return mixed New object created, <0 if KO + * @throws Exception + */ + public function createFromClone(User $user, $fromid, $trainingsessionid) + { + $error = 0; + + dol_syslog(__METHOD__, LOG_DEBUG); + + $object = new self($this->db); + + $this->db->begin(); + + // Load source object + $object->fetchCommon($fromid); + + // Reset some properties + unset($object->id); + unset($object->fk_user_creat); + unset($object->import_key); + unset($object->signature); + unset($object->signature_date); + unset($object->last_email_sent_date); + + // Clear fields + if (property_exists($object, 'date_creation')) { + $object->date_creation = dol_now(); + } + if (property_exists($object, 'fk_object')) { + $object->fk_object = $trainingsessionid; + } + if (property_exists($object, 'status')) { + $object->status = 1; + } + if (property_exists($object, 'signature_url')) { + $object->signature_url = generate_random_id(16); + } + + // Create clone + $object->context['createfromclone'] = 'createfromclone'; + $result = $object->createCommon($user); + unset($object->context['createfromclone']); + + // End + if ( ! $error) { + $this->db->commit(); + return $result; + } else { + $this->db->rollback(); + return -1; + } + } +} diff --git a/core/modules/dolimeet/documents/doc_attendancesheet_odt.modules.php b/core/modules/dolimeet/documents/doc_attendancesheet_odt.modules.php new file mode 100644 index 0000000..d5bd440 --- /dev/null +++ b/core/modules/dolimeet/documents/doc_attendancesheet_odt.modules.php @@ -0,0 +1,468 @@ + + * + * 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 . + * or see https://www.gnu.org/ + */ + +/** + * \file core/modules/dolimeet/attendancesheet/doc_attendancesheet_odt.modules.php + * \ingroup dolimeet + * \brief File of class to build ODT documents for dolimeet + */ + +require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/doc.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + +require_once __DIR__ . '/../modules_session.php'; +/** + * Class to build documents using ODF templates generator + */ +class doc_attendancesheet_odt extends ModelePDFSession +{ + /** + * Issuer + * @var Societe + */ + public $emetteur; + + /** + * @var array Minimum version of PHP required by module. + * e.g.: PHP ≥ 5.5 = array(5, 5) + */ + public $phpmin = array(5, 5); + + /** + * @var string Dolibarr version of the loaded document + */ + public $version = 'dolibarr'; + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + global $langs, $mysoc; + + + // Load translation files required by the page + $langs->loadLangs(array("main", "companies")); + + $this->db = $db; + $this->name = $langs->trans('AttendanceSheetDoliMeetTemplate'); + $this->description = $langs->trans("DocumentModelOdt"); + $this->scandir = 'DOLIMEET_ATTENDANCESHEET_ADDON_ODT_PATH'; // Name of constant that is used to save list of directories to scan + + // Page size for A4 format + $this->type = 'odt'; + $this->page_largeur = 0; + $this->page_hauteur = 0; + $this->format = array($this->page_largeur, $this->page_hauteur); + $this->marge_gauche = 0; + $this->marge_droite = 0; + $this->marge_haute = 0; + $this->marge_basse = 0; + + // Recupere emetteur + $this->emetteur = $mysoc; + if (!$this->emetteur->country_code) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined + } + + /** + * Return description of a module + * + * @param Translate $langs Lang object to use for output + * @return string Description + */ + public function info($langs) + { + global $conf, $langs; + + // Load translation files required by the page + $langs->loadLangs(array("errors", "companies")); + + $texte = $this->description.".
    \n"; + $texte .= '
    '; + $texte .= ''; + $texte .= ''; + $texte .= ''; + $texte .= ''; + + // List of directories area + $texte .= ''; + $texte .= '
    '; + $texttitle = $langs->trans("ListOfDirectories"); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->DOLIMEET_ATTENDANCESHEET_ADDON_ODT_PATH))); + $listoffiles = array(); + foreach ($listofdir as $key=>$tmpdir) + { + $tmpdir = trim($tmpdir); + $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir); + if (!$tmpdir) { + unset($listofdir[$key]); continue; + } + if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); + else + { + $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); + if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); + } + } + + // Scan directories + $nbofiles = count($listoffiles); + if (!empty($conf->global->DOLIMEET_ATTENDANCESHEET_ADDON_ODT_PATH)) + { + $texte .= $langs->trans("DoliMeetNumberOfModelFilesFound").': '; + $texte .= count($listoffiles); + $texte .= ''; + } + + if ($nbofiles) + { + $texte .= ''; + } + + $texte .= '
    '; + $texte .= '
    '; + + return $texte; + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function to build a document on disk using the generic odt module. + * + * @param ControlDocument $object Object source to build document + * @param Translate $outputlangs Lang output object + * @param string $srctemplatepath Full path of source filename for generator using a template file + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref + * @return int 1 if OK, <=0 if KO + */ + public function write_file($objectDocument, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $object) + { + // phpcs:enable + global $user, $langs, $conf, $hookmanager, $action, $mysoc, $db; + + $object = $object['object']; + + if (empty($srctemplatepath)) + { + dol_syslog("doc_attendancesheet_odt::write_file parameter srctemplatepath empty", LOG_WARNING); + return -1; + } + + // Add odtgeneration hook + if (!is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($this->db); + } + $hookmanager->initHooks(array('odtgeneration')); + + if (!is_object($outputlangs)) $outputlangs = $langs; + $outputlangs->charset_output = 'UTF-8'; + + $outputlangs->loadLangs(array("main", "dict", "companies", "dolimeet@dolimeet")); + + + $dir = $conf->dolimeet->multidir_output[isset($conf->entity) ? $conf->entity : 1] . '/'. $object->type .'/'. $object->ref; + + if (!file_exists($dir)) + { + if (dol_mkdir($dir) < 0) + { + $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); + return -1; + } + } + + if (file_exists($dir)) + { + $filename = preg_split('/attendancesheet\//' , $srctemplatepath); + $filename = preg_replace('/template_/','', $filename[1]); + + $date = dol_print_date(dol_now(),'dayxcard'); + + $filename = $date . '_attendancesheet_' . $object->ref . '.odt'; + $filename = str_replace(' ', '_', $filename); + $filename = dol_sanitizeFileName($filename); + + dol_syslog("admin.lib::Insert last main doc", LOG_DEBUG); + $file = $dir.'/'.$filename; + + dol_mkdir($conf->dolimeet->dir_temp); + + // Make substitution + $substitutionarray = array(); + complete_substitutions_array($substitutionarray, $langs, $object); + // Call the ODTSubstitution hook + $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray); + $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + // Open and load template + require_once ODTPHP_PATH.'odf.php'; + try { + $odfHandler = new odf( + $srctemplatepath, + array( + 'PATH_TO_TMP' => $conf->dolimeet->dir_temp, + 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. + 'DELIMITER_LEFT' => '{', + 'DELIMITER_RIGHT' => '}' + ) + ); + } + catch (Exception $e) + { + $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); + return -1; + } + + $tempdir = $conf->dolimeet->multidir_output[isset($object->entity) ? $object->entity : 1] . '/temp/'; + + //Define substitution array + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + $array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs); + //$array_object = $this->get_substitutionarray_object($object, $outputlangs); + $array_soc = $this->get_substitutionarray_mysoc($mysoc, $outputlangs); + $array_soc['mycompany_logo'] = preg_replace('/_small/', '_mini', $array_soc['mycompany_logo']); + + $tmparray = array_merge($substitutionarray, $array_object_from_properties, $array_soc); + complete_substitutions_array($tmparray, $outputlangs, $object); + + $filearray = dol_dir_list($conf->dolimeet->multidir_output[$conf->entity] . '/' . $object->element_type . '/' . $object->ref . '/thumbs/', "files", 0, '', '(\.odt|_preview.*\.png)$', 'position_name', 'desc', 1); + if (count($filearray)) { + $image = array_shift($filearray); + $tmparray['photoDefault'] = $image['fullname']; + }else { + $nophoto = '/public/theme/common/nophoto.png'; + $tmparray['photoDefault'] = DOL_DOCUMENT_ROOT.$nophoto; + } + + $usertmp = new User($db); + $contract = new Contrat($db); + $project = new Project($db); + $signatorytmp = new DolimeetSignature($db); + $signatorytmp = $signatorytmp->fetchSignatory('TRAININGSESSION_SESSION_TRAINER', $object->id, $object->type); + if (is_array($signatorytmp) && !empty($signatorytmp)) { + $signatorytmp = array_shift($signatorytmp); + } + + $contract->fetch($object->fk_contrat); + $project->fetch($object->fk_project); + + $tmparray['mycompany_name'] = $conf->global->MAIN_INFO_SOCIETE_NOM; + $tmparray['Adress'] = $conf->global->MAIN_INFO_SOCIETE_ADDRESS; + $tmparray['declaration_number'] = $conf->global->MAIN_INFO_SOCIETE_TRAINING_ORGANIZATION_NUMBER; + $tmparray['society_phone'] = $conf->global->MAIN_INFO_SOCIETE_TEL; + $tmparray['society_siret'] = $conf->global->MAIN_INFO_SIRET; + $tmparray['society_mail'] = $conf->global->MAIN_INFO_SOCIETE_MAIL; + $tmparray['society_website'] = $conf->global->MAIN_INFO_SOCIETE_WEB; + + $tmparray['CONTRACT'] = $contract->ref; + $tmparray['PROJECT'] = $project->ref; + $tmparray['DATESESSION'] = dol_print_date($object->date_start, 'dayhour'); + $tmparray['DSSESSION'] = dol_print_date($object->date_start, 'dayhour'); + $tmparray['DESESSION'] = dol_print_date($object->date_end, 'dayhour'); + + $duration_hours = floor($object->duration / 60); + $duration_minutes = ($object->duration % 60); + + $tmparray['DURATION'] = $duration_hours . ' ' . $langs->trans('Hour(s)') . ' ' . $duration_minutes . ' ' . $langs->trans('Minute(s)'); + + $tmparray['intervenant_name'] = $signatorytmp->firstname . ' ' . $signatorytmp->lastname; + if (dol_strlen($signatorytmp->signature) > 0) { + $encoded_image = explode(",", $signatorytmp->signature)[1]; + $decoded_image = base64_decode($encoded_image); + file_put_contents($tempdir . "signature.png", $decoded_image); + $tmparray['intervenant_signature'] = $tempdir . "signature.png"; + } else { + $tmparray['intervenant_signature'] = ''; + } + + foreach ($tmparray as $key=>$value) + { + try { + if (($key == 'intervenant_signature' || preg_match('/logo$/', $key)) && is_file($value)) // Image + { + $list = getimagesize($value); + $newWidth = 200; + if ($list[0]) { + $ratio = $newWidth / $list[0]; + $newHeight = $ratio * $list[1]; + dol_imageResizeOrCrop($value, 0, $newWidth, $newHeight); + } + if (file_exists($value)) $odfHandler->setImage($key, $value); + else $odfHandler->setVars($key, $langs->transnoentities('ErrorFileNotFound'), true, 'UTF-8'); + } + else // Text + { + if (empty($value)) { + $odfHandler->setVars($key, $langs->trans('NoData'), true, 'UTF-8'); + } else { + $odfHandler->setVars($key, html_entity_decode($value,ENT_QUOTES | ENT_HTML5), true, 'UTF-8'); + } + } + } + catch (OdfException $e) + { + dol_syslog($e->getMessage(), LOG_INFO); + } + } + + // Replace tags of lines + try + { + $foundtagforlines = 1; + if ($foundtagforlines) { + if ( ! empty( $object ) ) { + $listlines = $odfHandler->setSegment('attendants'); + $signatory = new DolimeetSignature($db); + $signatoriesList = $signatory->fetchSignatories($object->id, $object->type); + if ( ! empty($signatoriesList) && is_array($signatoriesList)) { + $k = 1; + foreach ($signatoriesList as $objectSignatory) { + if ($objectSignatory->role != "TRAININGSESSION_SESSION_TRAINER") { + $tmparray['attendant_number'] = $k; + $tmparray['attendant_lastname'] = $objectSignatory->lastname; + $tmparray['attendant_firstname'] = $objectSignatory->firstname; + if (dol_strlen($objectSignatory->signature) > 0) { + $encoded_image = explode(",", $objectSignatory->signature)[1]; + $decoded_image = base64_decode($encoded_image); + file_put_contents($tempdir . "signature" . $k . ".png", $decoded_image); + $tmparray['attendant_signature'] = $tempdir . "signature" . $k . ".png"; + } else { + $tmparray['attendant_signature'] = ''; + } + foreach ($tmparray as $key=>$value) + { + try { + if ($key == 'attendant_signature' && is_file($value)) { // Image + $list = getimagesize($value); + + $newWidth = 200; + if ($list[0]) { + $ratio = $newWidth / $list[0]; + $newHeight = $ratio * $list[1]; + dol_imageResizeOrCrop($value, 0, $newWidth, $newHeight); + } + $listlines->setImage($key, $value); + } else if (empty($value)) { + $listlines->setVars($key, $langs->trans('NoData'), true, 'UTF-8'); + } else if (!is_array($value)) { + $listlines->setVars($key, html_entity_decode($value, ENT_QUOTES | ENT_HTML5), true, 'UTF-8'); + } + } + catch (OdfException $e) + { + dol_syslog($e->getMessage(), LOG_INFO); + } + } + $listlines->merge(); + dol_delete_file($tempdir . "signature" . $k . ".png"); + $k++; + } + + } + $odfHandler->mergeSegment($listlines); + + } + } + } + + } + catch (OdfException $e) + { + $this->error = $e->getMessage(); + dol_syslog($this->error, LOG_WARNING); + return -1; + } + // Replace labels translated + $tmparray = $outputlangs->get_translations_for_substitutions(); + + foreach ($tmparray as $key=>$value) + { + try { + if ($key == 'attendant_lastname') { + echo '
    '; print_r( $value ); echo '
    '; exit; + + } + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + catch (OdfException $e) + { + dol_syslog($e->getMessage(), LOG_INFO); + } + } + + // Call the beforeODTSave hook + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); + $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + // Write new file + if (!empty($conf->global->MAIN_ODT_AS_PDF)) { + try { + $odfHandler->exportAsAttachedPDF($file); + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); + return -1; + } + } + else { + try { + $odfHandler->saveToDisk($file); + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); + return -1; + } + } + + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); + $reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + if (!empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); + + $odfHandler = null; // Destroy object + + $this->result = array('fullpath'=>$file); + dol_delete_file($tempdir . "signature.png"); + + return 1; // Success + } + else + { + $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); + return -1; + } + + return -1; + } +} diff --git a/core/modules/dolimeet/documents/doc_completioncertificate_odt.modules.php b/core/modules/dolimeet/documents/doc_completioncertificate_odt.modules.php new file mode 100644 index 0000000..31ce66d --- /dev/null +++ b/core/modules/dolimeet/documents/doc_completioncertificate_odt.modules.php @@ -0,0 +1,425 @@ + + * + * 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 . + * or see https://www.gnu.org/ + */ + +/** + * \file core/modules/dolimeet/completioncertificate/doc_completioncertificate_odt.modules.php + * \ingroup dolimeet + * \brief File of class to build ODT documents for dolimeet + */ + +require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/doc.lib.php'; +require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; + +require_once __DIR__ . '/../modules_session.php'; +/** + * Class to build documents using ODF templates generator + */ +class doc_completioncertificate_odt extends ModelePDFSession +{ + /** + * Issuer + * @var Societe + */ + public $emetteur; + + /** + * @var array Minimum version of PHP required by module. + * e.g.: PHP ≥ 5.5 = array(5, 5) + */ + public $phpmin = array(5, 5); + + /** + * @var string Dolibarr version of the loaded document + */ + public $version = 'dolibarr'; + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + global $langs, $mysoc; + + + // Load translation files required by the page + $langs->loadLangs(array("main", "companies")); + + $this->db = $db; + $this->name = $langs->trans('CompletionCertificateDoliMeetTemplate'); + $this->description = $langs->trans("DocumentModelOdt"); + $this->scandir = 'DOLIMEET_COMPLETIONCERTIFICATE_ADDON_ODT_PATH'; // Name of constant that is used to save list of directories to scan + + // Page size for A4 format + $this->type = 'odt'; + $this->page_largeur = 0; + $this->page_hauteur = 0; + $this->format = array($this->page_largeur, $this->page_hauteur); + $this->marge_gauche = 0; + $this->marge_droite = 0; + $this->marge_haute = 0; + $this->marge_basse = 0; + + // Recupere emetteur + $this->emetteur = $mysoc; + if (!$this->emetteur->country_code) $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default if not defined + } + + /** + * Return description of a module + * + * @param Translate $langs Lang object to use for output + * @return string Description + */ + public function info($langs) + { + global $conf, $langs; + + // Load translation files required by the page + $langs->loadLangs(array("errors", "companies")); + + $texte = $this->description.".
    \n"; + $texte .= '
    '; + $texte .= ''; + $texte .= ''; + $texte .= ''; + $texte .= ''; + + // List of directories area + $texte .= ''; + $texte .= '
    '; + $texttitle = $langs->trans("ListOfDirectories"); + $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->DOLIMEET_COMPLETIONCERTIFICATE_ADDON_ODT_PATH))); + $listoffiles = array(); + foreach ($listofdir as $key=>$tmpdir) + { + $tmpdir = trim($tmpdir); + $tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir); + if (!$tmpdir) { + unset($listofdir[$key]); continue; + } + if (!is_dir($tmpdir)) $texttitle .= img_warning($langs->trans("ErrorDirNotFound", $tmpdir), 0); + else + { + $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.(ods|odt)'); + if (count($tmpfiles)) $listoffiles = array_merge($listoffiles, $tmpfiles); + } + } + + // Scan directories + $nbofiles = count($listoffiles); + if (!empty($conf->global->DOLIMEET_COMPLETIONCERTIFICATE_ADDON_ODT_PATH)) + { + $texte .= $langs->trans("DoliSMQNumberOfModelFilesFound").': '; + $texte .= count($listoffiles); + $texte .= ''; + } + + if ($nbofiles) + { + $texte .= ''; + } + + $texte .= '
    '; + $texte .= '
    '; + + return $texte; + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Function to build a document on disk using the generic odt module. + * + * @param ControlDocument $object Object source to build document + * @param Translate $outputlangs Lang output object + * @param string $srctemplatepath Full path of source filename for generator using a template file + * @param int $hidedetails Do not show line details + * @param int $hidedesc Do not show desc + * @param int $hideref Do not show ref + * @return int 1 if OK, <=0 if KO + */ + public function write_file($objectDocument, $outputlangs, $srctemplatepath, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $object) + { + // phpcs:enable + global $user, $langs, $conf, $hookmanager, $action, $mysoc, $db; + + $attendant = $object['attendant']; + $object = $object['object']; + + if (empty($srctemplatepath)) + { + dol_syslog("doc_completioncertificate_odt::write_file parameter srctemplatepath empty", LOG_WARNING); + return -1; + } + + // Add odtgeneration hook + if (!is_object($hookmanager)) + { + include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($this->db); + } + $hookmanager->initHooks(array('odtgeneration')); + + if (!is_object($outputlangs)) $outputlangs = $langs; + $outputlangs->charset_output = 'UTF-8'; + + $outputlangs->loadLangs(array("main", "dict", "companies", "dolimeet@dolimeet")); + + + $dir = $conf->dolimeet->multidir_output[isset($conf->entity) ? $conf->entity : 1] . '/'. $object->type .'/'. $object->ref; + + if (!file_exists($dir)) + { + if (dol_mkdir($dir) < 0) + { + $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); + return -1; + } + } + + if (file_exists($dir)) + { + $filename = preg_split('/completioncertificate\//' , $srctemplatepath); + $filename = preg_replace('/template_/','', $filename[1]); + + $date = dol_print_date(dol_now(),'dayxcard'); + + $filename = $date . '_completioncertificate_' . $object->ref . '_' . $attendant->firstname . $attendant->lastname .'.odt'; + $filename = str_replace(' ', '_', $filename); + $filename = dol_sanitizeFileName($filename); + +// $object->last_main_doc = $filename; +// +// $sql = "UPDATE ".MAIN_DB_PREFIX."dolimeet_control"; +// $sql .= " SET last_main_doc =" .(!empty($filename) ? "'".$this->db->escape($filename)."'" : 'null'); +// $sql .= " WHERE rowid = ".$object->id; + + dol_syslog("admin.lib::Insert last main doc", LOG_DEBUG); +// $this->db->query($sql); + $file = $dir.'/'.$filename; + + dol_mkdir($conf->dolimeet->dir_temp); + + // Make substitution + $substitutionarray = array(); + complete_substitutions_array($substitutionarray, $langs, $object); + // Call the ODTSubstitution hook + $parameters = array('file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$substitutionarray); + $reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + // Open and load template + require_once ODTPHP_PATH.'odf.php'; + try { + $odfHandler = new odf( + $srctemplatepath, + array( + 'PATH_TO_TMP' => $conf->dolimeet->dir_temp, + 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. + 'DELIMITER_LEFT' => '{', + 'DELIMITER_RIGHT' => '}' + ) + ); + } + catch (Exception $e) + { + $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); + return -1; + } + + $tempdir = $conf->dolimeet->multidir_output[isset($object->entity) ? $object->entity : 1] . '/temp/'; + + //Define substitution array + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + $array_object_from_properties = $this->get_substitutionarray_each_var_object($object, $outputlangs); + //$array_object = $this->get_substitutionarray_object($object, $outputlangs); + $array_soc = $this->get_substitutionarray_mysoc($mysoc, $outputlangs); + $array_soc['mycompany_logo'] = preg_replace('/_small/', '_mini', $array_soc['mycompany_logo']); + + $tmparray = array_merge($substitutionarray, $array_object_from_properties, $array_soc); + complete_substitutions_array($tmparray, $outputlangs, $object); + + $filearray = dol_dir_list($conf->dolimeet->multidir_output[$conf->entity] . '/' . $object->element_type . '/' . $object->ref . '/thumbs/', "files", 0, '', '(\.odt|_preview.*\.png)$', 'position_name', 'desc', 1); + if (count($filearray)) { + $image = array_shift($filearray); + $tmparray['photoDefault'] = $image['fullname']; + }else { + $nophoto = '/public/theme/common/nophoto.png'; + $tmparray['photoDefault'] = DOL_DOCUMENT_ROOT.$nophoto; + } + + $usertmp = new User($db); + $contract = new Contrat($db); + $project = new Project($db); + $signatorytmp = new DolimeetSignature($db); + $signatorytmp = $signatorytmp->fetchSignatory('TRAININGSESSION_SESSION_TRAINER', $object->id, $object->type); + if (is_array($signatorytmp) && !empty($signatorytmp)) { + $signatorytmp = array_shift($signatorytmp); + } + + $contract->fetch($object->fk_contrat); + $contract->fetch_optionals(); + + $project->fetch($object->fk_project); + + $trainingsession_type_dict = fetchDictionnary('c_trainingsession_type'); + + $tmparray['mycompany_name'] = $conf->global->MAIN_INFO_SOCIETE_NOM; + + $tmparray['date_start'] = dol_print_date($object->date_start, 'dayhour'); + $tmparray['date_end'] = dol_print_date($object->date_end, 'dayhour'); + $duration_hours = floor($object->duration / 60); + $duration_minutes = $object->duration % 60; + $duration_minutes = $duration_minutes < 10 ? 0 . $duration_minutes : $duration_minutes; + $tmparray['duration'] = $duration_hours . 'h' . $duration_minutes; + + if (is_array($trainingsession_type_dict) && !empty($trainingsession_type_dict)) { + $tmparray['action_nature'] = $langs->trans($trainingsession_type_dict[$contract->array_options['options_trainingsession_type']]->label); + } else { + $tmparray['action_nature'] = ''; + } + + $tmparray['attendant_fullname'] = $attendant->firstname . ' ' . $attendant->lastname; + + if ($attendant->element_type == 'user') { + + $tmparray['attendant_company_name'] = $conf->global->MAIN_INFO_SOCIETE_NOM; + + } else if ($attendant->element_type == 'socpeople') { + $contact = new Contact($db); + $thirdparty = new Societe($db); + $contact->fetch($attendant->element_id); + $thirdparty->fetch($contact->fk_soc); + $tmparray['attendant_company_name'] = $thirdparty->name; + } + + $tmparray['trainingsession_name'] = $contract->array_options['options_label']; + $tmparray['trainingsession_company_name'] = $conf->global->MAIN_INFO_SOCIETE_NOM; + + $tmparray['sessiontrainer_fullname'] = $signatorytmp->firstname . ' ' . $signatorytmp->lastname; + + if (dol_strlen($signatorytmp->signature) > 0) { + $encoded_image = explode(",", $signatorytmp->signature)[1]; + $decoded_image = base64_decode($encoded_image); + file_put_contents($tempdir . "signature.png", $decoded_image); + $tmparray['sessiontrainer_signature'] = $tempdir . "signature.png"; + } else { + $tmparray['sessiontrainer_signature'] = ''; + } + + $tmparray['document_date'] = dol_print_date(dol_now('tzuser'), 'dayhour'); + $tmparray['location'] = $contract->array_options['options_trainingsession_location']; + + foreach ($tmparray as $key=>$value) + { + try { + if (($key == 'sessiontrainer_signature' || preg_match('/logo$/', $key)) && is_file($value)) // Image + { + $list = getimagesize($value); + $newWidth = 200; + if ($list[0]) { + $ratio = $newWidth / $list[0]; + $newHeight = $ratio * $list[1]; + dol_imageResizeOrCrop($value, 0, $newWidth, $newHeight); + } + if (file_exists($value)) $odfHandler->setImage($key, $value); + else $odfHandler->setVars($key, $langs->transnoentities('ErrorFileNotFound'), true, 'UTF-8'); + } + else // Text + { + if (empty($value)) { + $odfHandler->setVars($key, $langs->trans('NoData'), true, 'UTF-8'); + } else { + $odfHandler->setVars($key, html_entity_decode($value,ENT_QUOTES | ENT_HTML5), true, 'UTF-8'); + } + } + } + catch (OdfException $e) + { + dol_syslog($e->getMessage(), LOG_INFO); + } + } + + // Replace labels translated + $tmparray = $outputlangs->get_translations_for_substitutions(); + + foreach ($tmparray as $key=>$value) + { + try { + $odfHandler->setVars($key, $value, true, 'UTF-8'); + } + catch (OdfException $e) + { + dol_syslog($e->getMessage(), LOG_INFO); + } + } + + // Call the beforeODTSave hook + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); + $reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + // Write new file + if (!empty($conf->global->MAIN_ODT_AS_PDF)) { + try { + $odfHandler->exportAsAttachedPDF($file); + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); + return -1; + } + } + else { + try { + $odfHandler->saveToDisk($file); + } catch (Exception $e) { + $this->error = $e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); + return -1; + } + } + + $parameters = array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs, 'substitutionarray'=>&$tmparray); + $reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + + if (!empty($conf->global->MAIN_UMASK)) + @chmod($file, octdec($conf->global->MAIN_UMASK)); + + $odfHandler = null; // Destroy object + + $this->result = array('fullpath'=>$file); + + return 1; // Success + } + else + { + $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); + return -1; + } + + return -1; + } +} diff --git a/core/modules/dolimeet/mod_audit_standard.php b/core/modules/dolimeet/mod_audit_standard.php new file mode 100644 index 0000000..78932c5 --- /dev/null +++ b/core/modules/dolimeet/mod_audit_standard.php @@ -0,0 +1,153 @@ + + * + * 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 htdocs/core/modules/dolimeet/mod_audit_standard.php + * \ingroup dolimeet + * \brief File of class to manage Audit numbering rules standard + */ + +require_once __DIR__ . '/modules_session.php'; + +/** + * Class to manage customer order numbering rules standard + */ +class mod_audit_standard extends ModeleNumRefSession +{ + /** + * Dolibarr version of the loaded audit + * @var string + */ + public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + + public $prefix = 'AU'; + + /** + * @var string Error code (or message) + */ + public $error = ''; + + /** + * @var string name + */ + public $name = 'Audit'; + + /** + * Return description of numbering module + * + * @return string Text with description + */ + public function info() + { + global $langs; + return $langs->trans("SimpleNumRefModelDesc", $this->prefix); + } + + /** + * Return an example of numbering + * + * @return string Example + */ + public function getExample() + { + return $this->prefix."2208-0001"; + } + + /** + * Checks if the numbers already in the database do not + * cause conflicts that would prevent this numbering working. + * + * @param Object $object Object we need next value for + * @return boolean false if conflict, true if ok + */ + public function canBeActivated($object) { + global $conf, $langs, $db; + + $coyymm = ''; $max = ''; + + $posindice = strlen($this->prefix) + 6; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql .= " FROM ".MAIN_DB_PREFIX."dolimeet_session"; + $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."_______-%'"; + if ($object->ismultientitymanaged == 1) { + $sql .= " AND entity = ".$conf->entity; + } elseif ($object->ismultientitymanaged == 2) { + // TODO + } + + $resql = $db->query($sql); + if ($resql) { + $row = $db->fetch_row($resql); + if ($row) { + $coyymm = substr($row[0], 0, 6); $max = $row[0]; + } + } + if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) { + $langs->load("errors"); + $this->error = $langs->trans('ErrorNumRefModel', $max); + return false; + } + + return true; + } + + /** + * Return next free value + * + * @param Object $object Object we need next value for + * @return string Value if KO, <0 if KO + */ + public function getNextValue($object) { + global $db, $conf; + + // first we get the max value + $posindice = strlen($this->prefix) + 6; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql .= " FROM ".MAIN_DB_PREFIX."dolimeet_session"; + $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; + if ($object->ismultientitymanaged == 1) { + $sql .= " AND entity = ".$conf->entity; + } + + $resql = $db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) $max = intval($obj->max); + else $max = 0; + } + else + { + dol_syslog("mod_audit_standard::getNextValue", LOG_DEBUG); + return -1; + } + + $date = empty($object->date_creation) ?dol_now() : $object->date_creation; + + $yymm = strftime("%y%m", $date); + + if ($max >= (pow(10, 4) - 1)) { + $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is + } else { + $num = sprintf("%04s", $max + 1); + } + + dol_syslog("mod_audit_standard::getNextValue return ".$this->prefix.$yymm."-".$num); + return $this->prefix.$yymm."-".$num; + } +} diff --git a/core/modules/dolimeet/mod_meeting_standard.php b/core/modules/dolimeet/mod_meeting_standard.php index a18b752..f59b987 100644 --- a/core/modules/dolimeet/mod_meeting_standard.php +++ b/core/modules/dolimeet/mod_meeting_standard.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2021 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 @@ -22,12 +22,12 @@ * \brief File of class to manage Meeting numbering rules standard */ -require_once __DIR__ . '/modules_meeting.php'; +require_once __DIR__ . '/modules_session.php'; /** * Class to manage customer order numbering rules standard */ -class mod_meeting_standard extends ModeleNumRefMeeting +class mod_meeting_standard extends ModeleNumRefSession { /** * Dolibarr version of the loaded meeting @@ -45,7 +45,7 @@ class mod_meeting_standard extends ModeleNumRefMeeting /** * @var string name */ - public $name = 'Test'; + public $name = 'Meeting'; /** * Return description of numbering module @@ -65,7 +65,7 @@ public function info() */ public function getExample() { - return $this->prefix."1"; + return $this->prefix."2208-0001"; } /** @@ -82,7 +82,7 @@ public function canBeActivated($object) { $posindice = strlen($this->prefix) + 6; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql .= " FROM ".MAIN_DB_PREFIX."dolimeet_meeting"; + $sql .= " FROM ".MAIN_DB_PREFIX."dolimeet_session"; $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."_______-%'"; if ($object->ismultientitymanaged == 1) { $sql .= " AND entity = ".$conf->entity; @@ -116,10 +116,10 @@ public function getNextValue($object) { global $db, $conf; // first we get the max value - $posindice = strlen($this->prefix) + 1; + $posindice = strlen($this->prefix) + 6; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; - $sql .= " FROM ".MAIN_DB_PREFIX."dolimeet_meeting"; - $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."%'"; + $sql .= " FROM ".MAIN_DB_PREFIX."dolimeet_session"; + $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; if ($object->ismultientitymanaged == 1) { $sql .= " AND entity = ".$conf->entity; } @@ -137,10 +137,17 @@ public function getNextValue($object) { return -1; } - if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%s", $max + 1); + $date = empty($object->date_creation) ?dol_now() : $object->date_creation; + + $yymm = strftime("%y%m", $date); + + if ($max >= (pow(10, 4) - 1)) { + $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is + } else { + $num = sprintf("%04s", $max + 1); + } - dol_syslog("mod_meeting_standard::getNextValue return ".$this->prefix.$num); - return $this->prefix.$num; + dol_syslog("mod_meeting_standard::getNextValue return ".$this->prefix.$yymm."-".$num); + return $this->prefix.$yymm."-".$num; } } diff --git a/core/modules/dolimeet/mod_trainingsession_standard.php b/core/modules/dolimeet/mod_trainingsession_standard.php new file mode 100644 index 0000000..59068df --- /dev/null +++ b/core/modules/dolimeet/mod_trainingsession_standard.php @@ -0,0 +1,153 @@ + + * + * 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 htdocs/core/modules/dolimeet/mod_trainingsession_standard.php + * \ingroup dolimeet + * \brief File of class to manage Meeting numbering rules standard + */ + +require_once __DIR__ . '/modules_session.php'; + +/** + * Class to manage customer order numbering rules standard + */ +class mod_trainingsession_standard extends ModeleNumRefSession +{ + /** + * Dolibarr version of the loaded trainingsession + * @var string + */ + public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr' + + public $prefix = 'TS'; + + /** + * @var string Error code (or message) + */ + public $error = ''; + + /** + * @var string name + */ + public $name = 'TrainingSession'; + + /** + * Return description of numbering module + * + * @return string Text with description + */ + public function info() + { + global $langs; + return $langs->trans("SimpleNumRefModelDesc", $this->prefix); + } + + /** + * Return an example of numbering + * + * @return string Example + */ + public function getExample() + { + return $this->prefix."2208-0001"; + } + + /** + * Checks if the numbers already in the database do not + * cause conflicts that would prevent this numbering working. + * + * @param Object $object Object we need next value for + * @return boolean false if conflict, true if ok + */ + public function canBeActivated($object) { + global $conf, $langs, $db; + + $coyymm = ''; $max = ''; + + $posindice = strlen($this->prefix) + 6; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql .= " FROM ".MAIN_DB_PREFIX."dolimeet_session"; + $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."_______-%'"; + if ($object->ismultientitymanaged == 1) { + $sql .= " AND entity = ".$conf->entity; + } elseif ($object->ismultientitymanaged == 2) { + // TODO + } + + $resql = $db->query($sql); + if ($resql) { + $row = $db->fetch_row($resql); + if ($row) { + $coyymm = substr($row[0], 0, 6); $max = $row[0]; + } + } + if ($coyymm && !preg_match('/'.$this->prefix.'[0-9][0-9][0-9][0-9]/i', $coyymm)) { + $langs->load("errors"); + $this->error = $langs->trans('ErrorNumRefModel', $max); + return false; + } + + return true; + } + + /** + * Return next free value + * + * @param Object $object Object we need next value for + * @return string Value if KO, <0 if KO + */ + public function getNextValue($object) { + global $db, $conf; + + // first we get the max value + $posindice = strlen($this->prefix) + 6; + $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; + $sql .= " FROM ".MAIN_DB_PREFIX."dolimeet_session"; + $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; + if ($object->ismultientitymanaged == 1) { + $sql .= " AND entity = ".$conf->entity; + } + + $resql = $db->query($sql); + if ($resql) + { + $obj = $db->fetch_object($resql); + if ($obj) $max = intval($obj->max); + else $max = 0; + } + else + { + dol_syslog("mod_trainingsession_standard::getNextValue", LOG_DEBUG); + return -1; + } + + $date = empty($object->date_creation) ?dol_now() : $object->date_creation; + + $yymm = strftime("%y%m", $date); + + if ($max >= (pow(10, 4) - 1)) { + $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is + } else { + $num = sprintf("%04s", $max + 1); + } + + dol_syslog("mod_trainingsession_standard::getNextValue return ".$this->prefix.$yymm."-".$num); + return $this->prefix.$yymm."-".$num; + } +} diff --git a/core/modules/dolimeet/modules_meeting.php b/core/modules/dolimeet/modules_session.php similarity index 87% rename from core/modules/dolimeet/modules_meeting.php rename to core/modules/dolimeet/modules_session.php index af435e9..9561ed8 100644 --- a/core/modules/dolimeet/modules_meeting.php +++ b/core/modules/dolimeet/modules_session.php @@ -23,17 +23,18 @@ */ /** - * \file htdocs/core/modules/doliletter/modules_meeting.php - * \ingroup doliletter - * \brief File that contains parent class for meeting document models and parent class for meeting numbering models + * \file htdocs/core/modules/dolimeet/modules_session.php + * \ingroup dolimeet + * \brief File that contains parent class for session document models and parent class for session numbering models */ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php'; +require_once DOL_DOCUMENT_ROOT.'/custom/dolimeet/lib/dolimeet_function.lib.php'; /** * Parent class for documents models */ -abstract class ModelePDFMeeting extends CommonDocGenerator +abstract class ModelePDFSession extends CommonDocGenerator { // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -44,16 +45,15 @@ abstract class ModelePDFMeeting extends CommonDocGenerator * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - public static function liste_modeles($db, $maxfilenamelength = 0) + public static function liste_modeles($db, $maxfilenamelength = 0, $type) { // phpcs:enable global $conf; - $type = 'meeting'; $list = array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $list = getListOfModels($db, $type, $maxfilenamelength); + $list = getListOfModelsDolimeet($db, $type, $maxfilenamelength); return $list; } @@ -64,7 +64,7 @@ public static function liste_modeles($db, $maxfilenamelength = 0) /** * Parent class to manage numbering of Meeting */ -abstract class ModeleNumRefMeeting +abstract class ModeleNumRefSession { /** * @var string Error code (or message) @@ -89,7 +89,7 @@ public function isEnabled() public function info() { global $langs; - $langs->load("doliletter@doliletter"); + $langs->load("dolimeet@dolimeet"); return $langs->trans("NoDescription"); } @@ -101,7 +101,7 @@ public function info() public function getExample() { global $langs; - $langs->load("doliletter@doliletter"); + $langs->load("dolimeet@dolimeet"); return $langs->trans("NoExample"); } diff --git a/core/modules/modDoliMeet.class.php b/core/modules/modDoliMeet.class.php index fc61f75..eb7369f 100644 --- a/core/modules/modDoliMeet.class.php +++ b/core/modules/modDoliMeet.class.php @@ -53,10 +53,10 @@ public function __construct($db) $this->editor_url = 'https://www.evarisk.com'; $this->version = '1.0.0'; $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); - $this->picto = 'generic'; + $this->picto = 'dolimeet@dolimeet'; $this->module_parts = array( // Set this to 1 if module has its own trigger directory (core/triggers) - 'triggers' => 0, + 'triggers' => 1, // Set this to 1 if module has its own login method file (core/login) 'login' => 0, // Set this to 1 if module has its own substitution function file (core/substitutions) @@ -83,11 +83,11 @@ public function __construct($db) ), // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context to 'all' 'hooks' => array( - // 'data' => array( - // 'hookcontext1', - // 'hookcontext2', - // ), - // 'entity' => '0', + 'category', + 'categoryindex', + 'projectOverview', + 'printOverviewDetail', + 'admincompany' ), // Set this to 1 if features of module are opened to external users 'moduleforexternal' => 0, @@ -104,7 +104,7 @@ public function __construct($db) // A condition to hide module $this->hidden = false; // List of module class names as string that must be enabled if this module is enabled. Example: array('always1'=>'modModuleToEnable1','always2'=>'modModuleToEnable2', 'FR1'=>'modModuleToEnableFR'...) - $this->depends = array(); + $this->depends = array('modCategorie', 'modContrat', 'modProjet', 'modFckeditor', 'modAgenda'); $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) @@ -128,6 +128,18 @@ public function __construct($db) // ); $this->const = array( 1 => array('DOLIMEET_MEETING_ADDON','chaine', 'mod_meeting_standard','', $conf->entity), + 2 => array('DOLIMEET_MEETING_MENU_ENABLED','integer', 1,'', $conf->entity), + + 3 => array('DOLIMEET_TRAININGSESSION_ADDON','chaine', 'mod_trainingsession_standard','', $conf->entity), + 4 => array('DOLIMEET_TRAININGSESSION_MENU_ENABLED','integer', 1,'', $conf->entity), + + 5 => array('DOLIMEET_AUDIT_ADDON','chaine', 'mod_audit_standard','', $conf->entity), + 6 => array('DOLIMEET_AUDIT_MENU_ENABLED','integer', 1,'', $conf->entity), + + 7 => array('DOLIMEET_ATTENDANCESHEET_ADDON_ODT_PATH', 'chaine', 'DOL_DOCUMENT_ROOT/custom/dolimeet/documents/doctemplates/attendancesheet/', '', 0, 'current'), + 8 => array('DOLIMEET_COMPLETIONCERTIFICATE_ADDON_ODT_PATH', 'chaine', 'DOL_DOCUMENT_ROOT/custom/dolimeet/documents/doctemplates/completioncertificate/', '', 0, 'current'), + + 9 => array('MAIN_INFO_SOCIETE_TRAINING_ORGANIZATION_NUMBER', 'chaine', '', '', 0, 'current') ); // Some keys to add into the overwriting translation tables @@ -142,11 +154,58 @@ public function __construct($db) } // Array to add new pages in new tabs + $langs->load("dolimeet@dolimeet"); + $pictopath = dol_buildpath('/custom/dolimeet/img/dolimeet32px.png', 1); + $picto = img_picto('', $pictopath, '', 1, 0, 0, '', 'pictoDolimeet'); + $this->tabs = array(); + $this->tabs[] = array('data' => 'thirdparty:+sessionList:'.$picto.$langs->trans('DoliMeet').':dolimeet@dolimeet:1:/custom/dolimeet/view/session/session_list.php?fromtype=thirdparty&fromid=__ID__'); // To add a new tab identified by code tabname1 + $this->tabs[] = array('data' => 'user:+sessionList:'.$picto.$langs->trans('DoliMeet').':dolimeet@dolimeet:1:/custom/dolimeet/view/session/session_list.php?fromtype=user&fromid=__ID__'); // To add a new tab identified by code tabname1 + $this->tabs[] = array('data' => 'contact:+sessionList:'.$picto.$langs->trans('DoliMeet').':dolimeet@dolimeet:1:/custom/dolimeet/view/session/session_list.php?fromtype=socpeople&fromid=__ID__'); // To add a new tab identified by code tabname1 + $this->tabs[] = array('data' => 'project:+sessionList:'.$picto.$langs->trans('DoliMeet').':dolimeet@dolimeet:1:/custom/dolimeet/view/session/session_list.php?fromtype=project&fromid=__ID__'); // To add a new tab identified by code tabname1 + $this->tabs[] = array('data' => 'contract:+sessionList:'.$picto.$langs->trans('DoliMeet').':dolimeet@dolimeet:1:/custom/dolimeet/view/session/session_list.php?fromtype=contrat&fromid=__ID__'); // To add a new tab identified by code tabname1 + $this->tabs[] = array('data' => 'contract:+openinghours:'.$picto.$langs->trans('OpeningHours').':dolimeet@dolimeet:1:/custom/dolimeet/view/openinghours_card.php?element_type=contrat&id=__ID__'); // To add a new tab identified by code tabname1 // Dictionaries - $this->dictionaries = array(); - + $this->dictionaries = array( + 'langs' => 'dolimeet@dolimeet', + // List of tables we want to see into dictonnary editor + 'tabname' => array( + MAIN_DB_PREFIX . "c_trainingsession_type" + ), + // Label of tables + 'tablib' => array( + "TrainingSession" + ), + // Request to select fields + 'tabsql' => array( + 'SELECT f.rowid as rowid, f.ref, f.label, f.description, f.active FROM ' . MAIN_DB_PREFIX . 'c_trainingsession_type as f' + ), + // Sort order + 'tabsqlsort' => array( + "label ASC" + ), + // List of fields (result of select to show dictionary) + 'tabfield' => array( + "ref,label,description" + ), + // List of fields (list of fields to edit a record) + 'tabfieldvalue' => array( + "ref,label,description" + ), + // List of fields (list of fields for insert) + 'tabfieldinsert' => array( + "ref,label,description" + ), + // Name of columns with primary key (try to always name it 'rowid') + 'tabrowid' => array( + "rowid" + ), + // Condition to show each dictionary + 'tabcond' => array( + $conf->dolimeet->enabled, + ) + ); // Boxes/Widgets $this->boxes = array( ); @@ -161,21 +220,65 @@ public function __construct($db) // Add here entries to declare new permissions /* BEGIN MODULEBUILDER PERMISSIONS */ $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) - $this->rights[$r][1] = 'Read objects of DoliMeet'; // Permission label + $this->rights[$r][1] = $langs->transnoentities('ReadDoliMeetSession'); // Permission label + $this->rights[$r][4] = 'session'; + $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->dolimeet->session->read) + $r++; + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = $langs->transnoentities('WriteDoliMeetSession'); // Permission label + $this->rights[$r][4] = 'session'; + $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->dolimeet->session->write) + $r++; + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = $langs->transnoentities('DeleteDoliMeetSession'); // Permission label + $this->rights[$r][4] = 'session'; + $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dolimeet->session->delete) + $r++; + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = $langs->transnoentities('ReadDoliMeetMeeting'); // Permission label $this->rights[$r][4] = 'meeting'; $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->dolimeet->meeting->read) $r++; $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) - $this->rights[$r][1] = 'Create/Update objects of DoliMeet'; // Permission label + $this->rights[$r][1] = $langs->transnoentities('WriteDoliMeetMeeting'); // Permission label $this->rights[$r][4] = 'meeting'; $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->dolimeet->meeting->write) $r++; $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) - $this->rights[$r][1] = 'Delete objects of DoliMeet'; // Permission label + $this->rights[$r][1] = $langs->transnoentities('DeleteDoliMeetMeeting'); // Permission label $this->rights[$r][4] = 'meeting'; $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dolimeet->meeting->delete) $r++; - /* END MODULEBUILDER PERMISSIONS */ + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = $langs->transnoentities('ReadDoliMeetTrainingSession'); // Permission label + $this->rights[$r][4] = 'trainingsession'; + $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->dolimeet->trainingsession->read) + $r++; + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = $langs->transnoentities('WriteDoliMeetTrainingSession'); // Permission label + $this->rights[$r][4] = 'trainingsession'; + $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->dolimeet->trainingsession->write) + $r++; + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = $langs->transnoentities('DeleteDoliMeetTrainingSession'); // Permission label + $this->rights[$r][4] = 'trainingsession'; + $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dolimeet->meeting->delete) + $r++; + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = $langs->transnoentities('ReadDoliMeetAudit'); // Permission label + $this->rights[$r][4] = 'audit'; + $this->rights[$r][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->dolimeet->audit->read) + $r++; + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = $langs->transnoentities('WriteDoliMeetAudit'); // Permission label + $this->rights[$r][4] = 'audit'; + $this->rights[$r][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->dolimeet->audit->write) + $r++; + $this->rights[$r][0] = $this->numero . sprintf("%02d", $r + 1); // Permission id (must not be already used) + $this->rights[$r][1] = $langs->transnoentities('DeleteDoliMeetAudit'); // Permission label + $this->rights[$r][4] = 'audit'; + $this->rights[$r][5] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dolimeet->meeting->delete) + $r++; /* END MODULEBUILDER PERMISSIONS */ // Main menu entries to add $this->menu = array(); @@ -203,10 +306,10 @@ public function __construct($db) 'titre'=>' '. $langs->trans('MeetingList'), 'mainmenu'=>'dolimeet', 'leftmenu'=>'meeting_list', - 'url'=>'/dolimeet/meeting_list.php', + 'url'=>'/dolimeet/view/meeting/meeting_list.php', 'langs'=>'dolimeet@dolimeet', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1100+$r, - 'enabled'=>'$conf->dolimeet->enabled', // Define condition to show or hide menu entry. Use '$conf->dolimeet->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'enabled'=>'$conf->dolimeet->enabled && $conf->global->DOLIMEET_MEETING_MENU_ENABLED', // Define condition to show or hide menu entry. Use '$conf->dolimeet->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'perms'=>'1', // Use 'perms'=>'$user->rights->dolimeet->level1->level2' if you want your menu with a permission rules 'target'=>'', 'user'=>0, // 0=Menu for internal users, 1=external users, 2=both @@ -214,17 +317,130 @@ public function __construct($db) $this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=dolimeet,fk_leftmenu=meeting_list', // '' 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 Left menu entry - 'titre'=> ' ' . $langs->trans('MeetingCreate'), + 'titre'=> ' ' . $langs->trans('MeetingCreate'), 'mainmenu'=>'dolimeet', 'leftmenu'=>'meeting_card', - 'url'=>'/dolimeet/meeting_card.php?action=create', + 'url'=>'/dolimeet/view/meeting/meeting_card.php?action=create', 'langs'=>'dolimeet@dolimeet', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. 'position'=>1100+$r, - 'enabled'=>'$conf->dolimeet->enabled', // Define condition to show or hide menu entry. Use '$conf->doliletter->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'enabled'=>'$conf->dolimeet->enabled && $conf->global->DOLIMEET_MEETING_MENU_ENABLED', // Define condition to show or hide menu entry. Use '$conf->dolimeet->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. 'perms'=>'1', // Use 'perms'=>'$user->rights->dolimeet->level1->level2' 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++] = array( + 'fk_menu' => 'fk_mainmenu=dolimeet,fk_leftmenu=meeting_list', + 'type' => 'left', + 'titre' => ' ' . $langs->trans('Categories'), + 'mainmenu' => 'dolimeet', + 'leftmenu' => 'dolimeet_meeting', + 'url' => '/categories/index.php?type=meeting', + 'langs' => 'ticket', + 'position' => 1100 + $r, + 'enabled' => '$conf->dolimeet->enabled && $conf->categorie->enabled && $conf->global->DOLIMEET_MEETING_MENU_ENABLED', + 'perms' => '1', + 'target' => '', + 'user' => 0, + ); + $this->menu[$r++]=array( + 'fk_menu'=>'fk_mainmenu=dolimeet', // '' 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 Left menu entry + 'titre'=>' '. $langs->trans('TrainingSessionList'), + 'mainmenu'=>'dolimeet', + 'leftmenu'=>'trainingsession_list', + 'url'=>'/dolimeet/view/trainingsession/trainingsession_list.php', + 'langs'=>'dolimeet@dolimeet', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1100+$r, + 'enabled'=>'$conf->dolimeet->enabled && $conf->global->DOLIMEET_TRAININGSESSION_MENU_ENABLED', // Define condition to show or hide menu entry. Use '$conf->dolimeet->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'$user->rights->dolimeet->level1->level2' 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++]=array( + 'fk_menu'=>'fk_mainmenu=dolimeet,fk_leftmenu=trainingsession_list', // '' 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 Left menu entry + 'titre'=> ' ' . $langs->trans('TrainingSessionCreate'), + 'mainmenu'=>'dolimeet', + 'leftmenu'=>'trainingsession_card', + 'url'=>'/dolimeet/view/trainingsession/trainingsession_card.php?action=create', + 'langs'=>'dolimeet@dolimeet', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1100+$r, + 'enabled'=>'$conf->dolimeet->enabled && $conf->global->DOLIMEET_TRAININGSESSION_MENU_ENABLED', // Define condition to show or hide menu entry. Use '$conf->dolimeet->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'$user->rights->dolimeet->level1->level2' 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++] = array( + 'fk_menu' => 'fk_mainmenu=dolimeet,fk_leftmenu=trainingsession_list', + 'type' => 'left', + 'titre' => ' ' . $langs->trans('Categories'), + 'mainmenu' => 'dolimeet', + 'leftmenu' => 'dolimeet_trainingsession', + 'url' => '/categories/index.php?type=trainingsession', + 'langs' => 'ticket', + 'position' => 1100 + $r, + 'enabled' => '$conf->dolimeet->enabled && $conf->categorie->enabled && $conf->global->DOLIMEET_TRAININGSESSION_MENU_ENABLED', + 'perms' => '1', + 'target' => '', + 'user' => 0, + ); + $this->menu[$r++]=array( + 'fk_menu'=>'fk_mainmenu=dolimeet', // '' 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 Left menu entry + 'titre'=>' '. $langs->trans('AuditList'), + 'mainmenu'=>'dolimeet', + 'leftmenu'=>'audit_list', + 'url'=>'/dolimeet/view/audit/audit_list.php', + 'langs'=>'dolimeet@dolimeet', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1100+$r, + 'enabled'=>'$conf->dolimeet->enabled && $conf->global->DOLIMEET_AUDIT_MENU_ENABLED', // Define condition to show or hide menu entry. Use '$conf->dolimeet->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'$user->rights->dolimeet->level1->level2' 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++]=array( + 'fk_menu'=>'fk_mainmenu=dolimeet,fk_leftmenu=audit_list', // '' 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 Left menu entry + 'titre'=> ' ' . $langs->trans('AuditCreate'), + 'mainmenu'=>'dolimeet', + 'leftmenu'=>'audit_card', + 'url'=>'/dolimeet/view/audit/audit_card.php?action=create', + 'langs'=>'dolimeet@dolimeet', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1100+$r, + 'enabled'=>'$conf->dolimeet->enabled && $conf->global->DOLIMEET_AUDIT_MENU_ENABLED', // Define condition to show or hide menu entry. Use '$conf->dolimeet->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'$user->rights->dolimeet->level1->level2' 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++] = array( + 'fk_menu' => 'fk_mainmenu=dolimeet,fk_leftmenu=audit_list', + 'type' => 'left', + 'titre' => ' ' . $langs->trans('Categories'), + 'mainmenu' => 'dolimeet', + 'leftmenu' => 'dolimeet_audit', + 'url' => '/categories/index.php?type=audit', + 'langs' => 'ticket', + 'position' => 1100 + $r, + 'enabled' => '$conf->dolimeet->enabled && $conf->categorie->enabled && $conf->global->DOLIMEET_AUDIT_MENU_ENABLED', + 'perms' => '1', + 'target' => '', + 'user' => 0, + ); + $this->menu[$r++] = array( + 'fk_menu' => 'fk_mainmenu=dolimeet', // '' 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 Left menu entry + 'titre' => $langs->trans('ModuleConfiguration'), + 'prefix' => ' ', + 'mainmenu' => 'dolimeet', + 'leftmenu' => 'dolimeetconfig', + 'url' => '/dolimeet/admin/setup.php', + 'langs' => 'dolimeet@dolimeet', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position' => 48520 + $r, + 'enabled' => '$conf->dolimeet->enabled', // Define condition to show or hide menu entry. Use '$conf->dolimeet->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms' => '1', // Use 'perms'=>'$user->rights->dolimeet->level1->level2' if you want your menu with a permission rules + 'target' => '', + 'user' => 0, // 0=Menu for internal users, 1=external users, 2=both + ); /* END MODULEBUILDER TOPMENU */ /* BEGIN MODULEBUILDER LEFTMENU MYOBJECT $this->menu[$r++]=array( @@ -336,19 +552,44 @@ public function init($options = '') global $conf, $langs; //$result = $this->_load_tables('/install/mysql/tables/', 'dolimeet'); - $result = $this->_load_tables('/dolimeet/sql/'); + $sql = array(); + // Load sql sub folders + $sqlFolder = scandir(__DIR__ . '/../../sql'); + foreach ($sqlFolder as $subFolder) { + if ( ! preg_match('/\./', $subFolder)) { + $this->_load_tables('/dolimeet/sql/' . $subFolder . '/'); + } + } + + $this->_load_tables('/dolimeet/sql/'); if ($result < 0) { return -1; // Do not activate module if error 'not allowed' returned when loading module SQL queries (the _load_table run sql with run_sql with the error allowed parameter set to 'default') } + delDocumentModel('attendancesheet_odt', 'trainingsession'); + delDocumentModel('completioncertificate_odt', 'trainingsession'); + + addDocumentModel('attendancesheet_odt', 'trainingsession', 'ODT templates', 'DOLIMEET_ATTENDANCESHEET_ADDON_ODT_PATH'); + addDocumentModel('completioncertificate_odt', 'trainingsession', 'ODT templates', 'DOLIMEET_COMPLETIONCERTIFICATE_ADDON_ODT_PATH'); + // Create extrafields during init - //include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - //$extrafields = new ExtraFields($this->db); - //$result1=$extrafields->addExtraField('dolimeet_myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'dolimeet@dolimeet', '$conf->dolimeet->enabled'); - //$result2=$extrafields->addExtraField('dolimeet_myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'dolimeet@dolimeet', '$conf->dolimeet->enabled'); - //$result3=$extrafields->addExtraField('dolimeet_myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'dolimeet@dolimeet', '$conf->dolimeet->enabled'); - //$result4=$extrafields->addExtraField('dolimeet_myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1,'', 0, 0, '', '', 'dolimeet@dolimeet', '$conf->dolimeet->enabled'); - //$result5=$extrafields->addExtraField('dolimeet_myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'dolimeet@dolimeet', '$conf->dolimeet->enabled'); + include_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; + $extra_fields = new ExtraFields($this->db); + + $extra_fields->update('label', $langs->transnoentities("Label"), 'varchar', '', 'contrat', 0, 0, 1040, '', '', '', 1); + $extra_fields->addExtraField('label', $langs->transnoentities("Label"), 'varchar', 1040, '', 'contrat', 0, 0, '', '', '', '', 1); + + $extra_fields->update('trainingsession_start', $langs->transnoentities("TrainingSessionStart"), 'datetime', '', 'contrat', 0, 0, 1800, '', '', '', 1); + $extra_fields->addExtraField('trainingsession_start', $langs->transnoentities("TrainingSessionStart"), 'datetime', 1040, '', 'contrat', 0, 0, '', '', '', '', 1); + + $extra_fields->update('trainingsession_end', $langs->transnoentities("TrainingSessionEnd"), 'datetime', '', 'contrat', 0, 0, 1810, '', '', '', 1); + $extra_fields->addExtraField('trainingsession_end', $langs->transnoentities("TrainingSessionEnd"), 'datetime', 1040, '', 'contrat', 0, 0, '', '', '', '', 1); + + $extra_fields->update('trainingsession_type', $langs->transnoentities("TrainingSessionType"), 'sellist', '', 'contrat', 0, 0, 1830, 'a:1:{s:7:"options";a:1:{s:34:"c_trainingsession_type:label:rowid";N;}}', '', '', 1); + $extra_fields->addExtraField('trainingsession_type', $langs->transnoentities("TrainingSessionType"), 'sellist', 1830, '', 'contrat', 0, 0, '', 'a:1:{s:7:"options";a:1:{s:34:"c_trainingsession_type:label:rowid";N;}}', '', '', 1); + + $extra_fields->update('trainingsession_location', $langs->transnoentities("TrainingSessionLocation"), 'varchar', '', 'contrat', 0, 0, 1850, '', '', '', 1); + $extra_fields->addExtraField('trainingsession_location', $langs->transnoentities("TrainingSessionLocation"), 'varchar', 1850, '', 'contrat', 0, 0, '', '', '', '', 1); // Permissions $this->remove($options); diff --git a/core/tpl/session/dolimeet_session_agenda.tpl.php b/core/tpl/session/dolimeet_session_agenda.tpl.php new file mode 100644 index 0000000..5d95b3f --- /dev/null +++ b/core/tpl/session/dolimeet_session_agenda.tpl.php @@ -0,0 +1,166 @@ +dolimeet->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array($object->element.'agenda', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { +$upload_dir = $conf->dolimeet->multidir_output[$object->entity]."/".$object->id; +} + +$object_type = $object->element; +$permissiontoread = $user->rights->dolimeet->$object_type->read; +$permissiontoadd = $user->rights->dolimeet->$object_type->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->dolimeet->$object_type->delete || ($permissiontoadd && isset($object->status)); +$permissionnote = $user->rights->dolimeet->$object_type->write; // Used by the include of actions_setnotes.inc.php +$upload_dir = $conf->dolimeet->multidir_output[$conf->entity]; + +// Security check (enable the most restrictive one) +if ($user->socid > 0) accessforbidden(); +if ($user->socid > 0) $socid = $user->socid; +if (empty($conf->dolimeet->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + +/* +* Actions +*/ + +$parameters = array('id'=>$id); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) { +setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +} + +if (empty($reshook)) { +// Cancel +if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { +header("Location: ".$backtopage); +exit; +} + +// Purge search criteria +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers +$actioncode = ''; +$search_agenda_label = ''; +} +} + + + +/* +* View +*/ + +$form = new Form($db); + +if ($object->id > 0) { + $title = $langs->trans("Agenda" . ucfirst($object->element)); + //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; + $help_url = 'EN:Module_Agenda_En'; + llxHeader('', $title, $help_url); + + if (!empty($conf->notification->enabled)) { + $langs->load("mails"); + } + $prepareHead = $object->element . 'PrepareHead'; + $head = $prepareHead($object); + + print dol_get_fiche_head($head, 'agenda', $langs->trans('Agenda'), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + // Project + $project->fetch($object->fk_project); + $morehtmlref = '- ' . $object->label; + $morehtmlref .= '
    '; + $morehtmlref .= $langs->trans('Project') . ' : ' . $project->getNomUrl(1); + $morehtmlref .= ''; + $morehtmlref .= '
    '; + $morehtmlref .= '
    '; + + if ($object->element == 'trainingsession') { + $contract->fetch($object->fk_contrat); + $morehtmlref .= '
    '; + $morehtmlref .= $langs->trans('Contract') . ' : ' . $contract->getNomUrl(1); + $morehtmlref .= ''; + $morehtmlref .= '
    '; + $morehtmlref .= '
    '; + } + + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
    '; + print '
    '; + + $object->info($object->id); + dol_print_object_info($object, 1); + + print '
    '; + + print dol_get_fiche_end(); + + // Actions buttons + + $objthirdparty = $object; + $objcon = new stdClass(); + + $out = '&origin='.urlencode($object->element.'@'.$object->module).'&originid='.urlencode($object->id); + $urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id; + $out .= '&backtopage='.urlencode($urlbacktopage); + $permok = $user->rights->agenda->myactions->create; + if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { + //$out.='trans("AddAnAction"),'filenew'); + //$out.=""; + } + + + print '
    '; + + if (!empty($conf->agenda->enabled)) { + if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + print ''.$langs->trans("AddAction").''; + } else { + print ''.$langs->trans("AddAction").''; + } + } + + print '
    '; + + if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { + $param = '&id='.$object->id.'&socid='.$socid; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { + $param .= '&contextpage='.urlencode($contextpage); + } + if ($limit > 0 && $limit != $conf->liste_limit) { + $param .= '&limit='.urlencode($limit); + } + + // List of all actions + $filters = array(); + $filters['search_agenda_label'] = $search_agenda_label; + + // TODO Replace this with same code than into list.php + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder, $object->module); + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/core/tpl/session/dolimeet_session_attendants.tpl.php b/core/tpl/session/dolimeet_session_attendants.tpl.php new file mode 100644 index 0000000..ac136ce --- /dev/null +++ b/core/tpl/session/dolimeet_session_attendants.tpl.php @@ -0,0 +1,544 @@ +fetch($id); + +$hookmanager->initHooks(array($object->element.'signature', 'globalcard')); // Note that conf->hooks_modules contains array + +//Security check +$object_type = $object->element; +$permissiontoread = $user->rights->dolimeet->$object_type->read; +$permissiontoadd = $user->rights->dolimeet->$object_type->write; +$permissiontodelete = $user->rights->dolimeet->$object_type->delete; + +if ( ! $permissiontoread) accessforbidden(); + +/* +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($backtopage) || ($cancel && empty($id))) { + if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { + $backtopage = dol_buildpath('/dolimeet/view/'. $object->element .'/' . $object->element .'_attendants.php', 1) . '?id=' . ($object->id > 0 ? $object->id : '__ID__'); + } +} + +// Action to add internal attendant +if ($action == 'addSocietyAttendant') { + $error = 0; + $object->fetch($id); + $attendant_id = GETPOST('user_attendant'); + + if ( ! $error) { + $role = strtoupper(GETPOST('attendantRole')); + $result = $signatory->setSignatory($object->id, $object->element, 'user', array($attendant_id), strtoupper($object->element).'_' . $role, $role == 'SESSION_TRAINER' ? 0 : 1); + if ($result > 0) { + $usertmp = $user; + $usertmp->fetch($attendant_id); + setEventMessages($langs->trans('AddAttendantMessage') . ' ' . $usertmp->firstname . ' ' . $usertmp->lastname, array()); + // Creation attendant OK + $urltogo = str_replace('__ID__', $result, $backtopage); + $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $id, $urltogo); // New method to autoselect project after a New on another form object creation + header("Location: " . $urltogo); + exit; + } else { + // Creation attendant KO + if ( ! empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); + else setEventMessages($object->error, null, 'errors'); + } + } +} + +// Action to add external attendant +if ($action == 'addExternalAttendant') { + $error = 0; + $object->fetch($id); + $extintervenant_id = GETPOST('external_attendant'); + + if ( ! $error) { + $result = $signatory->setSignatory($object->id, $object->element, 'socpeople', array($extintervenant_id), strtoupper($object->element).'_EXTERNAL_ATTENDANT', 1); + if ($result > 0) { + $contact->fetch($extintervenant_id); + setEventMessages($langs->trans('AddAttendantMessage') . ' ' . $contact->firstname . ' ' . $contact->lastname, array()); + // Creation attendant OK + $urltogo = str_replace('__ID__', $result, $backtopage); + $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $id, $urltogo); // New method to autoselect project after a New on another form object creation + header("Location: " . $urltogo); + exit; + } else { + // Creation attendant KO + if ( ! empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); + else setEventMessages($object->error, null, 'errors'); + } + } +} + +// Action to add record +if ($action == 'addSignature') { + $signatoryID = GETPOST('signatoryID'); + $data = json_decode(file_get_contents('php://input'), true); + + $signatory->fetch($signatoryID); + $signatory->signature = $data['signature']; + $signatory->signature_date = dol_now('tzuser'); + + if ( ! $error) { + $result = $signatory->update($user, false); + + if ($result > 0) { + // Creation signature OK + $signatory->setSigned($user, 0); + setEventMessages($langs->trans('SignatureEvent') . ' ' . $contact->firstname . ' ' . $contact->lastname, array()); + $urltogo = str_replace('__ID__', $result, $backtopage); + $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $id, $urltogo); // New method to autoselect project after a New on another form object creation + header("Location: " . $urltogo); + exit; + } else { + // Creation signature KO + if ( ! empty($signatory->errors)) setEventMessages(null, $signatory->errors, 'errors'); + else setEventMessages($signatory->error, null, 'errors'); + } + } +} + +// Action to set status STATUS_ABSENT +if ($action == 'setAbsent') { + $signatoryID = GETPOST('signatoryID'); + + $signatory->fetch($signatoryID); + + if ( ! $error) { + $result = $signatory->setAbsent($user, 0); + if ($result > 0) { + // set absent OK + setEventMessages($langs->trans('Attendant') . ' ' . $signatory->firstname . ' ' . $signatory->lastname . ' ' . $langs->trans('SetAbsentAttendant'), array()); + $urltogo = str_replace('__ID__', $result, $backtopage); + $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $id, $urltogo); // New method to autoselect project after a New on another form object creation + header("Location: " . $urltogo); + exit; + } else { + // set absent KO + if ( ! empty($signatory->errors)) setEventMessages(null, $signatory->errors, 'errors'); + else setEventMessages($signatory->error, null, 'errors'); + } + } +} + +// Action to send Email +if ($action == 'send') { + $signatoryID = GETPOST('signatoryID'); + $signatory->fetch($signatoryID); + + if ( ! $error) { + $langs->load('mails'); + + if (!dol_strlen($signatory->email)) { + if ($signatory->element_type == 'user') { + $usertmp = $user; + $usertmp->fetch($signatory->element_id); + if (dol_strlen($usertmp->email)) { + $signatory->email = $usertmp->email; + $signatory->update($user, true); + } + } else if ($signatory->element_type == 'socpeople') { + $contact->fetch($signatory->element_id); + if (dol_strlen($contact->email)) { + $signatory->email = $contact->email; + $signatory->update($user, true); + } + } + } + + $sendto = $signatory->email; + + if (dol_strlen($sendto) && ( ! empty($conf->global->MAIN_MAIL_EMAIL_FROM))) { + require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; + + $from = $conf->global->MAIN_MAIL_EMAIL_FROM; + $url = dol_buildpath('/custom/dolimeet/public/signature/add_signature.php?track_id=' . $signatory->signature_url . '&type=' . $object->element, 3); + + $message = $langs->trans('SignatureEmailMessage') . ' ' . $url; + $subject = $langs->trans('SignatureEmailSubject') . ' ' . $object->ref; + + // Create form object + // Send mail (substitutionarray must be done just before this) + $mailfile = new CMailFile($subject, $sendto, $from, $message, array(), array(), array(), "", "", 0, -1, '', '', '', '', 'mail'); + + if ($mailfile->error) { + setEventMessages($mailfile->error, $mailfile->errors, 'errors'); + } else { + if ( ! empty($conf->global->MAIN_MAIL_SMTPS_ID)) { + $result = $mailfile->sendfile(); + if ($result) { + $signatory->last_email_sent_date = dol_now('tzuser'); + $signatory->update($user, true); + $signatory->setPending($user, false); + setEventMessages($langs->trans('SendEmailAt') . ' ' . $signatory->email, array()); + // This avoid sending mail twice if going out and then back to page + header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); + exit; + } else { + $langs->load("other"); + $mesg = '
    '; + if ($mailfile->error) { + $mesg .= $langs->transnoentities('ErrorFailedToSendMail', dol_escape_htmltag($from), dol_escape_htmltag($sendto)); + $mesg .= '
    ' . $mailfile->error; + } else { + $mesg .= $langs->transnoentities('ErrorFailedToSendMail', dol_escape_htmltag($from), dol_escape_htmltag($sendto)); + } + $mesg .= '
    '; + setEventMessages($mesg, null, 'warnings'); + } + } else { + setEventMessages($langs->trans('ErrorSetupEmail'), '', 'errors'); + } + } + } else { + $langs->load("errors"); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("MailTo")), null, 'warnings'); + dol_syslog('Try to send email with no recipient defined', LOG_WARNING); + } + } else { + // Mail sent KO + if ( ! empty($signatory->errors)) setEventMessages(null, $signatory->errors, 'errors'); + else setEventMessages($signatory->error, null, 'errors'); + } +} + +// Action to delete attendant +if ($action == 'deleteAttendant') { + $signatoryToDeleteID = GETPOST('signatoryID'); + $signatory->fetch($signatoryToDeleteID); + + if ( ! $error) { + $result = $signatory->setDeleted($user, 0); + if ($result > 0) { + setEventMessages($langs->trans('DeleteAttendantMessage') . ' ' . $signatory->firstname . ' ' . $signatory->lastname, array()); + // Deletion attendant OK + $urltogo = str_replace('__ID__', $result, $backtopage); + $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $id, $urltogo); // New method to autoselect project after a New on another form object creation + header("Location: " . $urltogo); + exit; + } else { + // Deletion attendant KO + if ( ! empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); + else setEventMessages($object->error, null, 'errors'); + } + } else { + $action = 'create'; + } +} + +/* + * View + */ + +$formcompany = new FormCompany($db); +$title = $langs->trans(ucfirst($object->element)."Attendants"); +$help_url = ''; +$morejs = array("/dolimeet/js/signature-pad.min.js", "/dolimeet/js/dolimeet.js.php"); +$morecss = array("/dolimeet/css/dolimeet.css"); + +llxHeader('', $title, $help_url, '', '', '', $morejs, $morecss); + +if ( ! empty($object->id)) $res = $object->fetch_optionals(); + +// Object card +// ------------------------------------------------------------ + +$prepareHead = $object->element . 'PrepareHead'; +$head = $prepareHead($object); +print dol_get_fiche_head($head, 'attendants', $langs->trans(ucfirst($object->element)), -1, $object->picto); + +$width = 80; $cssclass = 'photoref'; +dol_strlen($object->label) ? $morehtmlref = '' . ' - ' . $object->label . '' : ''; +$morehtmlref .= '
    '; + +// Project +$project->fetch($object->fk_project); +$morehtmlref = '- ' . $object->label; +$morehtmlref .= '
    '; +$morehtmlref .= $langs->trans('Project') . ' : ' . $project->getNomUrl(1); +$morehtmlref .= ''; +$morehtmlref .= '
    '; +$morehtmlref .= '
    '; + +if ($object->element == 'trainingsession') { + $contract->fetch($object->fk_contrat); + $morehtmlref .= '
    '; + $morehtmlref .= $langs->trans('Contract') . ' : ' . $contract->getNomUrl(1); + $morehtmlref .= ''; + $morehtmlref .= '
    '; + $morehtmlref .= '
    '; +} + +//$morehtmlleft = '
    '.digirisk_show_photos('dolimeet', $conf->dolimeet->multidir_output[$entity].'/'.$object->element_type, 'small', 5, 0, 0, 0, $width,0, 0, 0, 0, $object->element_type, $object).'
    '; + +dol_banner_tab($object, 'ref', '', 0, 'ref', 'ref', $morehtmlref, '', 0, $morehtmlleft); + +print dol_get_fiche_end(); ?> + +status == 1 ) : ?> + + +trans('DisclaimerSignatureTitle') ?> +trans(ucfirst($object->element)."MustBeValidatedToSign") ?> + +element ?>element ?>trans("GoToValidate") ?> + + + + + +trans('AddSignatureSuccess') ?> +trans("AddSignatureSuccessText") . GETPOST('signature_id')?> + +checkSignatoriesSignatures($object->id, $object->element)) { +// print '' . $langs->trans("GoToLock") . ''; +// } +// ?> + + +fetchSignatory(strtoupper($object->element).'_SOCIETY_ATTENDANT', $object->id, $object->element); + $society_trainer = $signatory->fetchSignatory(strtoupper($object->element).'_SESSION_TRAINER', $object->id, $object->element); + + $society_intervenants = array_merge($society_intervenants, $society_trainer); + + print load_fiche_titre($langs->trans("Attendants"), '', ''); + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $already_added_users = array(); + $j = 1; + if (is_array($society_intervenants) && ! empty($society_intervenants) && $society_intervenants > 0) { + foreach ($society_intervenants as $element) { + $usertmp = $user; + $usertmp->fetch($element->element_id); + print ''; + print ''; + if ($element->signature != $langs->transnoentities("FileGenerated") && $permissiontoadd) { + print ''; + } + print ''; + $already_added_users[$element->element_id] = $element->element_id; + $j++; + } + } else { + print ''; + } + + if ($permissiontoadd) { + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($backtopageforcancel) print ''; + + //Intervenants extérieurs + print ''; + print ''; + print ''; + print '
    ' . $langs->trans("Name") . '' . $langs->trans("Role") . '' . $langs->trans("SignatureLink") . '' . $langs->trans("SendMailDate") . '' . $langs->trans("SignatureDate") . '' . $langs->trans("Status") . '' . $langs->trans("ActionsSignature") . '' . $langs->trans("Signature") . '
    '; + print $usertmp->getNomUrl(1); + print ''; + print $langs->trans($element->role); + print ''; +// if ($object->status == 2) { + $signatureUrl = dol_buildpath('/custom/dolimeet/public/signature/add_signature.php?track_id=' . $element->signature_url . '&type=' . $object->element, 3); + print ''; +// } else { +// print '-'; +// } + + print ''; + print dol_print_date($element->last_email_sent_date, 'dayhour'); + print ''; + print dol_print_date($element->signature_date, 'dayhour'); + print ''; + print $element->getLibStatut(5); + print ''; + if ($permissiontoadd) { + require __DIR__ . "/../signature/dolimeet_signature_action_view.tpl.php"; + } + print ''; + require __DIR__ . "/../signature/dolimeet_signature_view.tpl.php"; + print '
    '; + print $langs->trans('NoSocietyAttendants'); + print '
    '; + print $form->select_dolusers('', 'user_attendant', 1, $already_added_users); + print ''; + print ''; + print ajax_combobox('attendantRole'); + print ''; + print '-'; + print ''; + print '-'; + print ''; + print '-'; + print ''; + print '-'; + print ''; + print ''; + print ''; + print '-'; + print '
    ' . "\n"; + print ''; + } + + //External Society Intervenants -- Intervenants Société extérieure + $thirdparty->fetch($object->fk_soc); + $ext_society_intervenants = $signatory->fetchSignatory(strtoupper($object->element).'_EXTERNAL_ATTENDANT', $object->id, $object->element); + + print load_fiche_titre($langs->trans("ExternalAttendants"), '', ''); + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + $already_selected_intervenants = array(); + $j = 1; + if (is_array($ext_society_intervenants) && ! empty($ext_society_intervenants) && $ext_society_intervenants > 0) { + foreach ($ext_society_intervenants as $element) { + $contact->fetch($element->element_id); + print ''; + print ''; + if ($element->signature != $langs->transnoentities("FileGenerated") && $permissiontoadd) { + print ''; + } + print ''; + $already_selected_intervenants[$element->element_id] = $element->element_id; + $j++; + } + } else { + print ''; + } + + if ($permissiontoadd) { + print ''; + print ''; + print ''; + print ''; + print ''; + + if ($backtopageforcancel) print ''; + + //Intervenants extérieurs + $ext_society = $object->fk_soc; + if ($ext_society < 1) { + $ext_society = new StdClass(); + } + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
    ' . $langs->trans("Thirdparty") . '' . $langs->trans("ContactLinked") . '' . $langs->trans("Role") . '' . $langs->trans("SignatureLink") . '' . $langs->trans("SendMailDate") . '' . $langs->trans("SignatureDate") . '' . $langs->trans("Status") . '' . $langs->trans("ActionsSignature") . '' . $langs->trans("Signature") . '
    '; + $thirdparty->fetch($contact->fk_soc); + print $thirdparty->getNomUrl(1); + print ''; + print $contact->getNomUrl(1); + print ''; + print $langs->trans("ExtSocietyIntervenant"); + print ''; +// if ($object->status == 2) { + $signatureUrl = dol_buildpath('/custom/dolimeet/public/signature/add_signature.php?track_id=' . $element->signature_url . '&type=' . $object->element, 3); + print ''; +// } else { +// print '-'; +// } + + print ''; + print dol_print_date($element->last_email_sent_date, 'dayhour'); + print ''; + print dol_print_date($element->signature_date, 'dayhour'); + print ''; + print $element->getLibStatut(5); + print ''; + if ($permissiontoadd) { + require __DIR__ . "/../signature/dolimeet_signature_action_view.tpl.php"; + } + print ''; + require __DIR__ . "/../signature/dolimeet_signature_view.tpl.php"; + print '
    '; + print $langs->trans('NoExternalAttendants'); + print '
    '; + $selectedCompany = GETPOSTISSET("newcompany") ? GETPOST("newcompany", 'int') : (empty($object->socid) ? 0 : $object->socid); + $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0, '', 'minwidth300imp'); + + print ''; + print img_object('', 'contact', 'class="pictofixedwidth"').$form->selectcontacts(($selectedCompany > 0 ? $selectedCompany : -1), '', 'external_attendant', 1, $already_selected_intervenants, '', 1, 'minwidth100imp widthcentpercentminusxx maxwidth400'); + $nbofcontacts = $form->num; + $newcardbutton = ''; + if (!empty(GETPOST('newcompany')) && GETPOST('newcompany') > 1 && $user->rights->societe->creer) { + $newcardbutton .= ''; + } + print $newcardbutton; + print '' . $langs->trans("ExtSocietyIntervenant") . ''; + print '-'; + print ''; + print '-'; + print ''; + print '-'; + print ''; + print '-'; + print ''; + print ''; + print ''; + print '-'; + print '
    ' . "\n"; + print ''; + print '
    '; + + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/meeting_card.php b/core/tpl/session/dolimeet_session_card.tpl.php similarity index 66% rename from meeting_card.php rename to core/tpl/session/dolimeet_session_card.tpl.php index f522c2d..13fcc41 100644 --- a/meeting_card.php +++ b/core/tpl/session/dolimeet_session_card.tpl.php @@ -1,81 +1,14 @@ - * - * 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 meeting_card.php - * \ingroup meeting - * \brief Page to create/edit/view meeting - */ -// Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; -if (!$res) die("Include of main fails"); - -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php'; -require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; -require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - -require_once './class/meeting.class.php'; -require_once './core/modules/dolimeet/mod_meeting_standard.php'; -require_once './lib/dolimeet_meeting.lib.php'; -require_once './lib/dolimeet.lib.php'; -require_once './lib/dolimeet_function.lib.php'; - -global $db, $conf, $langs, $user, $hookmanager; - -// Load translation files required by the page -$langs->loadLangs(array("dolimeet@dolimeet", "other")); - -// Get parameters -$id = GETPOST('id', 'int'); -$action = GETPOST('action', 'aZ09'); -$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$confirm = GETPOST('confirm', 'alpha'); -$cancel = GETPOST('cancel', 'aZ09'); -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'riskcard'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); - -// Initialize technical objects -$object = new Meeting($db); $contact = new Contact($db); $project = new Project($db); -$refMeetingMod = new $conf->global->DOLIMEET_MEETING_ADDON(); +$mod = 'DOLIMEET_'. strtoupper($object->element) .'_ADDON'; +$refMod = new $conf->global->$mod(); $extrafields = new ExtraFields($db); $usertmp = new User($db); $ecmfile = new EcmFiles($db); $thirdparty = new Societe($db); +$signatory = new DolimeetSignature($db); $object->fetch($id); if ($object->fk_contact > 0) { @@ -83,7 +16,7 @@ $linked_contact->fetch($object->fk_contact); } -$hookmanager->initHooks(array('lettercard', 'globalcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array($object->element . 'card', 'globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -102,15 +35,15 @@ if (empty($action) && empty($id) && empty($ref)) { $action = 'view'; } -$upload_dir = $conf->dolimeet->multidir_output[$conf->entity ?: $conf->entity]."/meeting/".get_exdir(0, 0, 0, 1, $object); +$upload_dir = $conf->dolimeet->multidir_output[$conf->entity ?: $conf->entity]. "/" . $object->element . "/" .get_exdir(0, 0, 0, 1, $object); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. -$permissiontoread = $user->rights->dolimeet->meeting->read; -$permissiontoadd = $user->rights->dolimeet->meeting->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->dolimeet->meeting->delete || ($permissiontoadd && isset($object->status)); -$permissionnote = $user->rights->dolimeet->meeting->write; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $user->rights->meeting->letter->write; // Used by the include of actions_dellink.inc.php +$object_type = $object->element; +$permissiontoread = $user->rights->dolimeet->$object_type->read; +$permissiontoadd = $user->rights->dolimeet->$object_type->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->dolimeet->$object_type->delete || ($permissiontoadd && isset($object->status)); +$permissionnote = $user->rights->dolimeet->$object_type->write; // Used by the include of actions_setnotes.inc.php $upload_dir = $conf->dolimeet->multidir_output[$conf->entity]; $thirdparty->fetch($object->fk_soc); @@ -120,7 +53,6 @@ if (empty($conf->dolimeet->enabled)) accessforbidden(); if (!$permissiontoread) accessforbidden(); - /* * Actions */ @@ -163,19 +95,18 @@ $error = 0; - $backurlforlist = dol_buildpath('/dolimeet/meeting_list.php', 1); + $backurlforlist = dol_buildpath('/dolimeet/view/'. $object->element .'/'. $object->element .'_list.php', 1); if (empty($backtopage) || ($cancel && empty($id))) { if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) { if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) { $backtopage = $backurlforlist; } else { - $backtopage = dol_buildpath('/dolimeet/meeting_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); + $backtopage = dol_buildpath('/dolimeet/view/'. $object->element .'/'. $object->element .'_card.php', 1).'?id='.($id > 0 ? $id : '__ID__'); } } } - // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen //include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -186,22 +117,35 @@ $note_private = GETPOST('note_private'); $note_public = GETPOST('note_public'); $label = GETPOST('label'); - $project_id = GETPOST('fk_project'); + $society_id = GETPOST('fk_soc'); + $project_id = GETPOST('projectid'); + $contrat_id = GETPOST('fk_contrat'); + $durationh = GETPOST('durationh') ?:0; + $durationm = GETPOST('durationm') ?: 0; + + $duration_minutes = $durationh * 60 + $durationm; + + $date_start = dol_mktime(GETPOST('date_starthour', 'int'), GETPOST('date_startmin', 'int'), 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); + $date_end = dol_mktime(GETPOST('date_endhour', 'int'), GETPOST('date_endmin', 'int'), 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); // Initialize object $now = dol_now(); - $object->ref = $refMeetingMod->getNextValue($object); + $object->ref = $refMod->getNextValue($object); $object->ref_ext = 'dolimeet_' . $object->ref; $object->date_creation = $object->db->idate($now); + $object->date_start = $date_start; + $object->date_end = $date_end; $object->tms = $now; $object->import_key = ""; $object->note_private = $note_private; $object->note_public = $note_public; $object->label = $label; + $object->type = $object->element; + $object->duration = $duration_minutes; $object->fk_soc = $society_id; - $object->fk_contact = $contact_id; $object->fk_project = $project_id; + $object->fk_contrat = $contrat_id; $object->content = $content; $object->entity = $conf->entity ?: 1; @@ -217,14 +161,17 @@ if (!$error) { $result = $object->create($user, false); if ($result > 0) { - // Creation meeting OK - $urltogo = str_replace('__ID__', $result, $backtopage); - $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $id, $urltogo); // New method to autoselect project after a New on another form object creation - header("Location: " . $urltogo); + // Creation OK + // Category association + $categories = GETPOST('categories', 'array'); + $object->setCategories($categories); + $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; + $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation + header("Location: ".$urltogo); exit; } else { - // Creation meeting KO + // Creation KO if (!empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); else setEventMessages($object->error, null, 'errors'); } @@ -238,24 +185,33 @@ $society_id = GETPOST('fk_soc'); $content = GETPOST('content', 'restricthtml'); $label = GETPOST('label'); - $contact_id = GETPOST('fk_contact'); + $contrat_id = GETPOST('fk_contrat'); $project_id = GETPOST('fk_project'); + $date_start = dol_mktime(GETPOST('date_starthour', 'int'), GETPOST('date_startmin', 'int'), 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); + $date_end = dol_mktime(GETPOST('date_endhour', 'int'), GETPOST('date_endmin', 'int'), 0, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); + $durationh = GETPOST('durationh') ?:0; + $durationm = GETPOST('durationm') ?: 0; + + $duration_minutes = $durationh * 60 + $durationm; $object->label = $label; $object->fk_soc = $society_id; $object->content = $content; - $object->fk_contact = $contact_id; + $object->fk_contrat = $contrat_id; $object->fk_project = $project_id; + $object->date_start = $date_start; + $object->date_end = $date_end; + $object->duration = $duration_minutes; $object->fk_user_creat = $user->id ? $user->id : 1; if (!$error) { $result = $object->update($user, false); if ($result > 0) { - $signatory->deleteSignatoriesSignatures($object->id, 0); - $object->setStatusCommon($user, 0); - $urltogo = str_replace('__ID__', $result, $backtopage); - $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $id, $urltogo); // New method to autoselect project after a New on another form object creation - header("Location: " . $urltogo); + $categories = GETPOST('categories', 'array'); + $object->setCategories($categories); + $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; + $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation + header("Location: ".$urltogo); exit; } else @@ -271,7 +227,7 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == "yes") { $object->setStatusCommon($user, -1); - $urltogo = DOL_URL_ROOT . '/custom/dolimeet/meeting_list.php'; + $urltogo = DOL_URL_ROOT . '/custom/dolimeet/view/'. $object->element .'/'. $object->element .'_list.php'; header("Location: " . $urltogo); exit; } @@ -286,108 +242,71 @@ //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Action to build doc -// include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - if ($action == 'builddoc' && $permissiontoadd) { - if (is_numeric(GETPOST('model', 'alpha'))) { - $error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Model")); - } else { - // Reload to get all modified line records and be ready for hooks - $ret = $object->fetch($id); - $ret = $object->fetch_thirdparty(); - /*if (empty($object->id) || ! $object->id > 0) - { - dol_print_error('Object must have been loaded by a fetch'); - exit; - }*/ - - // Save last template used to generate document - if (GETPOST('model', 'alpha')) { - $object->setDocModel($user, GETPOST('model', 'alpha')); - } + $outputlangs = $langs; + $newlang = ''; - // Special case to force bank account - //if (property_exists($object, 'fk_bank')) - //{ - if (GETPOST('fk_bank', 'int')) { - // this field may come from an external module - $object->fk_bank = GETPOST('fk_bank', 'int'); - } elseif (!empty($object->fk_account)) { - $object->fk_bank = $object->fk_account; - } - //} - - $outputlangs = $langs; - $newlang = ''; - - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) { - $newlang = GETPOST('lang_id', 'aZ09'); - } - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->thirdparty->default_lang)) { - $newlang = $object->thirdparty->default_lang; // for proposal, order, invoice, ... - } - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->default_lang)) { - $newlang = $object->default_lang; // for thirdparty - } - if (!empty($newlang)) { - $outputlangs = new Translate("", $conf); - $outputlangs->setDefaultLang($newlang); - } - - // To be sure vars is defined - if (empty($hidedetails)) { - $hidedetails = 0; - } - if (empty($hidedesc)) { - $hidedesc = 0; - } - if (empty($hideref)) { - $hideref = 0; - } - if (empty($moreparams)) { - $moreparams = null; - } + if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) $newlang = GETPOST('lang_id', 'aZ09'); + if ( ! empty($newlang)) { + $outputlangs = new Translate("", $conf); + $outputlangs->setDefaultLang($newlang); + } - $result = $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); - if ($result <= 0) { - setEventMessages($object->error, $object->errors, 'errors'); - $action = ''; - } else { - if ($conf->global->DOLIMEET_SHOW_DOCUMENTS_ON_PUBLIC_INTERFACE) { - $filedir = $conf->dolimeet->dir_output.'/'.$object->element.'/'.$object->ref; - $filelist = dol_dir_list($filedir, 'files'); - if (!empty($filelist)) { - foreach ($filelist as $file) { - if (!preg_match('/specimen/', $file['name'])) { - $fileurl = $file['fullname']; - $filename = $file['name']; - } + // To be sure vars is defined + if (empty($hidedetails)) $hidedetails = 0; + if (empty($hidedesc)) $hidedesc = 0; + if (empty($hideref)) $hideref = 0; + if (empty($moreparams)) $moreparams = null; + + $model = GETPOST('model', 'alpha'); + + $moreparams['object'] = $object; + $moreparams['user'] = $user; + + if (preg_match('/completioncertificate/',GETPOST('model'))) { + $signatoriesList = $signatory->fetchSignatories($object->id, $object->type); + if (!empty($signatoriesList)) { + foreach($signatoriesList as $objectSignatory) { + if ($objectSignatory->role != 'TRAININGSESSION_SESSION_TRAINER') { + $moreparams['attendant'] = $objectSignatory; + $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + if ($result <= 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $action = ''; } } - - $ecmfile->fetch(0, '', 'dolimeet/meeting/'.$object->ref.'/'.$filename, '', '', 'dolimeet_meeting', $id); - require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $ecmfile->share = getRandomPassword(true); - $ecmfile->update($user); } - if (empty($donotredirect)) { // This is set when include is done by bulk action "Bill Orders" - setEventMessages($langs->trans("FileGenerated"), null); - + if (empty($donotredirect)) { + setEventMessages($langs->trans("FileGenerated") . ' - ' . $object->last_main_doc, null); $urltoredirect = $_SERVER['REQUEST_URI']; $urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect); $urltoredirect = preg_replace('/action=builddoc&?/', '', $urltoredirect); // To avoid infinite loop - - header('Location: '.$urltoredirect.'#builddoc'); + header('Location: ' . $urltoredirect . '#builddoc'); exit; } } } + + $result = $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); + if ($result <= 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $action = ''; + } else { + if (empty($donotredirect)) { + setEventMessages($langs->trans("FileGenerated") . ' - ' . $object->last_main_doc, null); + $urltoredirect = $_SERVER['REQUEST_URI']; + $urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect); + $urltoredirect = preg_replace('/action=builddoc&?/', '', $urltoredirect); // To avoid infinite loop + header('Location: ' . $urltoredirect . '#builddoc'); + exit; + } + } } // Actions to send emails - $triggersendname = 'DOLIMEET_MEETING_SENTBYMAIL'; - $autocopy = 'MAIN_MAIL_AUTOCOPY_MEETING_TO'; - $trackid = 'meeting'.$object->id; + $triggersendname = 'DOLIMEET_'. strtoupper($object->element) .'_SENTBYMAIL'; + $autocopy = 'MAIN_MAIL_AUTOCOPY_'. strtoupper($object->element) .'_TO'; + $trackid = $object->element.$object->id; /* * Send mail @@ -754,11 +673,9 @@ // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes') { - if ($object->status > 0) { - $object->status = 0; - } - $object->ref = $refMeetingMod->getNextValue($object); - $result = $object->create($user); + $options = array(); + $object->ref = $refMod->getNextValue($object); + $result = $object->createFromClone($user, $object->id, $options); if ($result > 0) { header("Location: " . $_SERVER["PHP_SELF"] . '?id=' . $result); @@ -769,7 +686,7 @@ /* * View - * + *FZ * Put here all code to build page */ @@ -778,9 +695,9 @@ $formfile = new FormFile($db); $formproject = new FormProjets($db); -$title = $langs->trans("Meeting"); -$title_create = $langs->trans("NewMeeting"); -$title_edit = $langs->trans("ModifyMeeting"); +$title = $langs->trans("Card" . ucfirst($object->element)); +$title_create = $langs->trans("New" . ucfirst($object->element)); +$title_edit = $langs->trans("Modify" . ucfirst($object->element)); $help_url = ''; $morejs = array("/dolimeet/js/signature-pad.min.js", "/dolimeet/js/dolimeet.js.php"); $morecss = array("/dolimeet/css/dolimeet.css"); @@ -811,14 +728,17 @@ unset($object->fields['content']); unset($object->fields['note_public']); unset($object->fields['note_private']); + unset($object->fields['date_start']); + unset($object->fields['date_end']); unset($object->fields['fk_soc']); - unset($object->fields['fk_contact']); + unset($object->fields['fk_contrat']); unset($object->fields['fk_project']); + unset($object->fields['duration']); //Ref -- Ref print ''.$langs->trans("Ref").''; - print ''; - print $refMeetingMod->getNextValue($object); + print ''; + print $refMod->getNextValue($object); print ''; // Common attributes @@ -826,16 +746,60 @@ //Project -- Projet print ''; - $numprojet = $formproject->select_projects(GETPOST('fk_soc') ?: -1, GETPOST('fk_project'), 'fk_project', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'minwidth300'); + $numprojet = $formproject->select_projects(GETPOST('fk_soc') ?: -1, GETPOST('projectid'), 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'minwidth300'); print ' '; print ''; + //Contract -- Contrat + if ($object->element == 'trainingsession') { + print ''; + $numcontrat = $formcontract->select_contract(GETPOST('fk_soc') ?: -1, GETPOST('fk_contrat'), 'fk_contrat', 0, 1, 1); + print ' '; + print ''; + + //Duration - Durée + print ''; + print ''; + print $langs->trans('Hour(s)'); + print ''; + print $langs->trans('Minute(s)'); + print ''; + } + + //Date start - Date de début + print ''; + print $form->selectDate(dol_now('tzuser'), 'date_start', 1, 1, 0, '', 1,1); + print ''; + + //Date end - Date de début + print ''; + print $form->selectDate(dol_now('tzuser'), 'date_end', 1, 1, 0, '', 1, 1); + print ''; + + +// //Society -- Société +// print ''.$langs->trans("Society").''; +// $events = array(); +// $events[1] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'fk_contact', 'params' => array('add-customer-contact' => 'disabled')); +// print $form->select_company(GETPOST('fromtype') == 'thirdparty' ? GETPOST('fromid') : GETPOST('fk_soc'), 'fk_soc', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); +// print ' '; +// print ''; + //Content -- Contenu print ''; $doleditor = new DolEditor('content', GETPOST('content'), '', 250, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); $doleditor->Create(); print ''; + // Categories + if (!empty($conf->categorie->enabled)) { + print ''.$langs->trans("Categories").''; + $cate_arbo = $form->select_all_categories($object->element, '', 'parent', 64, 0, 1); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); + print ""; + } + + // //PublicNote -- Note publique // print ''; // $doleditor = new DolEditor('note_public', GETPOST('note_public'), '', 90, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); @@ -867,7 +831,7 @@ // Part to edit record if (($id || $ref) && $action == 'edit' ||$action == 'confirm_setInProgress') { - print load_fiche_titre($langs->trans("EditMeeting"), '', 'object_'.$object->picto); + print load_fiche_titre($langs->trans("Edit".ucfirst($object->element)), '', 'object_'.$object->picto); print '
    '; print ''; @@ -896,6 +860,7 @@ unset($object->fields['fk_soc']); unset($object->fields['fk_contact']); unset($object->fields['fk_project']); + unset($object->fields['duration']); // Common attributes // include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; @@ -905,31 +870,68 @@ print ''; print ''; - //Society -- Société - print ''.$langs->trans("Society").''; - $events = array(); - $events[1] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contact', 'params' => array('add-customer-contact' => 'disabled')); - print $form->select_company($object->fk_soc, 'fk_soc', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); - print ' '; + //Project -- Projet + print ''; + $numprojet = $formproject->select_projects(GETPOST('fk_soc') ?: -1, $object->fk_project, 'fk_project', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'minwidth300'); + print ' '; print ''; - //Contact -- Contact - print ''.$langs->trans("Contact").''; - print $form->selectcontacts(GETPOST('fk_soc', 'int'), $object->fk_contact, 'fk_contact', 1, '', '', 0, 'quatrevingtpercent', false, 0, array(), false, '', 'fk_contact'); + //Contract -- Contrat + if ($object->element == 'trainingsession') { + print ''; + $numcontrat = $formcontract->select_contract(GETPOST('fk_soc') ?: -1, $object->fk_contrat, 'fk_contrat', 0, 1, 1); + print ' '; + print ''; + + //Duration - Durée + print ''; + $duration_hours = floor($object->duration / 60); + $duration_minutes = ($object->duration % 60); + print ''; + print ''; + print ''; + } + + //Date start - Date de début + print ''; + print $form->selectDate($object->date_start, 'date_start', 1, 1, 0, '', 1,1); print ''; - //Contact -- Contact - print ''; - $numprojet = $formproject->select_projects(0, $object->fk_project, 'fk_project', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'minwidth300'); - print ' '; + //Date end - Date de début + print ''; + print $form->selectDate($object->date_end, 'date_end', 1, 1, 0, '', 1, 1); print ''; +// //Society -- Société +// print ''.$langs->trans("Society").''; +// $events = array(); +// $events[1] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contact', 'params' => array('add-customer-contact' => 'disabled')); +// print $form->select_company($object->fk_soc, 'fk_soc', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); +// print ' '; +// print ''; + //Content -- Contenu print ''; $doleditor = new DolEditor('content', $object->content, '', 90, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); $doleditor->Create(); print ''; + // Tags-Categories + if ($conf->categorie->enabled) { + print ''.$langs->trans("Categories").''; + $cate_arbo = $form->select_all_categories($object->element, '', 'parent', 64, 0, 1); + $c = new Categorie($db); + $cats = $c->containing($object->id, 'session'); + $arrayselected = array(); + if (is_array($cats)) { + foreach ($cats as $cat) { + $arrayselected[] = $cat->id; + } + } + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); + print ""; + } + print ''; print dol_get_fiche_end(); @@ -944,8 +946,9 @@ // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'confirm_setInProgress' && $action != 'create'))) { $res = $object->fetch_optionals(); - $head = meetingPrepareHead($object); - print dol_get_fiche_head($head, 'card', $langs->trans("Meeting"), -1, "dolimeet@dolimeet"); + $prepareHead = $object->element . 'PrepareHead'; + $head = $prepareHead($object); + print dol_get_fiche_head($head, 'card', $langs->trans(ucfirst($object->element)), -1, $object->picto); $formconfirm = ''; @@ -963,10 +966,10 @@ || ( ! empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) { // Always output when not jmobile nor js // Define confirmation messages $formquestionclone = array( - 'text' => $langs->trans("CloneMeeting", $object->ref), + 'text' => $langs->trans("Clone".ucfirst($object->element), $object->ref), ); - $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMeeting', $object->ref), 'confirm_clone', $formquestionclone, 'yes', 'actionButtonClone', 350, 600); + $formconfirm .= $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmClone' . ucfirst($object->element), $object->ref), 'confirm_clone', $formquestionclone, 'yes', 'actionButtonClone', 350, 600); } // Call Hook formConfirm @@ -981,23 +984,33 @@ // Print form confirm print $formconfirm; - $contact->fetch($object->fk_contact); + $thirdparty->fetch($object->fk_soc); // Object card // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; + // Project $project->fetch($object->fk_project); - $morehtmlref = '
    '; - + $morehtmlref = '- ' . $object->label; + $morehtmlref .= '
    '; $morehtmlref .= $langs->trans('Project') . ' : ' . $project->getNomUrl(1); $morehtmlref .= ''; $morehtmlref .= '
    '; $morehtmlref .= '
    '; + if ($object->element == 'trainingsession' && $object->fk_contrat > 0) { + $contract->fetch($object->fk_contrat); + $morehtmlref .= '
    '; + $morehtmlref .= $langs->trans('Contract') . ' : ' . $contract->getNomUrl(1); + $morehtmlref .= ''; + $morehtmlref .= '
    '; + $morehtmlref .= '
    '; + } + dol_banner_tab($object, 'ref', $linkback, 0, 'ref', 'ref', $morehtmlref, '', 0, '' ); print '
    '; - print '
    '; + print '
    '; print '
    '; print ''."\n"; @@ -1010,16 +1023,73 @@ print ''; print ''; + // Categories + if ($conf->categorie->enabled) { + print '"; + } + + // Date Start + print ''; + print ''; + + // Date End + print ''; + print ''; + + if ($object->type == 'trainingsession') { + $duration_hours = floor($object->duration / 60); + $duration_minutes = ($object->duration % 60); + + print ''; + print ''; + } + //unused display of information unset($object->fields['fk_soc']); unset($object->fields['fk_contact']); unset($object->fields['fk_project']); unset($object->fields['content']); + unset($object->fields['fk_contrat']); + unset($object->fields['date_start']); + unset($object->fields['date_end']); + unset($object->fields['duration']); include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; // Other attributes. Fields from hook formObjectOptions and Extrafields. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; + print '
    '.$langs->trans("Categories").''; + print $form->showCategories($object->id, 'session', 1); + print "
    '; + print $form->textwithpicto($langs->trans("DateStart"), $langs->trans("GaugeCounter"), 1, 'info'); + print ''; + print dol_print_date($object->date_start, 'dayhoursec'); + print '
    '; + print $form->textwithpicto($langs->trans("DateEnd"), $langs->trans("GaugeCounter"), 1, 'info'); + print ''; + print dol_print_date($object->date_end, 'dayhoursec'); + print '
    '; + print $langs->trans("Duration"); + print ''; + print $duration_hours . ' ' . $langs->trans('Hour(s)') . ' ' . $duration_minutes . ' ' . $langs->trans('Minute(s)'); + print '
    '; + print '
    '; + + print '
    '; + print ''."\n"; + + //Thirdparty + if ($object->fk_soc > 0) { + print ''; + print ''; + } + print '
    '; + print $langs->trans("Thirdparty"); + print ''; + print '
    '; + print $thirdparty->getNomUrl(1); //wrap -> middle? + print '
    '; + print '
    '; print '
    '; print '
    '; @@ -1038,8 +1108,8 @@ if (empty($reshook)) { // Send - $class = 'ModelePDFMeeting'; - $modellist = call_user_func($class.'::liste_modeles', $db, 100); + $class = 'ModelePDFSession'; + $modellist = call_user_func($class.'::liste_modeles', $db, 100, $object->type); if (!empty($modellist)) { asort($modellist); @@ -1059,9 +1129,9 @@ $button_edit = '' . $langs->trans("Modify"). '' . "\n"; $button_edit_with_confirm = '' . $langs->trans("Modify"). '' . "\n"; $button_edit_disabled = '' . $langs->trans("Modify") . '' . "\n"; - print ($object->status == 0 ? $button_edit : ($object->status == 1 ? $button_edit_with_confirm : $button_edit_disabled)); -// print '' . $langs->trans("Sign") . '' . "\n"; -// print '' . $langs->trans("Lock") . ''; + print $button_edit; +// print '' . $langs->trans("Sign") . '' . "\n"; +// print '' . $langs->trans("Lock") . ''; // print '' . $langs->trans("SendMail") . '' . "\n"; print '' . $langs->trans("ToClone") . ''; } else { @@ -1075,6 +1145,46 @@ print '' . $langs->trans('Delete') . '' . "\n"; } } + + print '
    '; + $includedocgeneration = 1; + + print '
    '; + // Documents + if ($includedocgeneration) { + $objref = dol_sanitizeFileName($object->ref); + $relativepath = $objref.'/'.$objref.'.pdf'; + $filedir = $conf->dolimeet->dir_output.'/'.$object->element.'/'.$objref; + + $generated_files = dol_dir_list($filedir.'/', 'files'); + $document_generated = 0; + foreach ($generated_files as $generated_file) { + if (!preg_match('/specimen/', $generated_file['name'])) { + $document_generated += 1; + } + } + $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; + $genallowed = $user->rights->dolimeet->session->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->dolimeet->session->write; // If you can create/edit, you can remove a file on card + print dolimeetshowdocuments('dolimeet:'.$object->type, $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, 0, '', 1, 0, 0, $langs->trans("LinkedDocuments"), 0, '', '', '', $langs->defaultlang, 1); + } + + print '
    '; + print '
    '; + + $MAXEVENT = 10; + + $morehtmlright = ''; + $morehtmlright .= $langs->trans("SeeAll"); + $morehtmlright .= ''; + + // List of actions on element + include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; + $formactions = new FormActions($db); + $somethingshown = $formactions->showactions($object, $object->element.'@dolimeet', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlright); + + print '
    '; + print ''."\n"; } diff --git a/core/tpl/session/dolimeet_session_document.tpl.php b/core/tpl/session/dolimeet_session_document.tpl.php new file mode 100644 index 0000000..731ab9f --- /dev/null +++ b/core/tpl/session/dolimeet_session_document.tpl.php @@ -0,0 +1,126 @@ +dolimeet->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array($object->element.'document', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals + +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->dolimeet->multidir_output[$conf->entity ?: 1]."/". $object->element ."/".get_exdir(0, 0, 0, 1, $object); +} + +$object_type = $object->element; +$permissiontoread = $user->rights->dolimeet->$object_type->read; +$permissiontoadd = $user->rights->dolimeet->$object_type->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->dolimeet->$object_type->delete || ($permissiontoadd && isset($object->status)); +$permissionnote = $user->rights->dolimeet->$object_type->write; // Used by the include of actions_setnotes.inc.php +//$upload_dir = $conf->dolimeet->multidir_output[$conf->entity]; + +// Security check (enable the most restrictive one) +if ($user->socid > 0) accessforbidden(); +if ($user->socid > 0) $socid = $user->socid; +if (empty($conf->dolimeet->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; + +/* + * View + */ + +$form = new Form($db); + +$title = $langs->trans("Documents" . ucfirst($object->element)); +$help_url = ''; +//$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; +llxHeader('', $title, $help_url); + +if ($object->id) { + /* + * Show tabs + */ + $prepareHead = $object->element . 'PrepareHead'; + $head = $prepareHead($object); + + print dol_get_fiche_head($head, 'document', $langs->trans('Document'), -1, $object->picto); + + // Build file list + $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); + $totalsize = 0; + foreach ($filearray as $key => $file) { + $totalsize += $file['size']; + } + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + // Project + $project->fetch($object->fk_project); + $morehtmlref = '- ' . $object->label; + $morehtmlref .= '
    '; + $morehtmlref .= $langs->trans('Project') . ' : ' . $project->getNomUrl(1); + $morehtmlref .= ''; + $morehtmlref .= '
    '; + $morehtmlref .= '
    '; + + if ($object->element == 'trainingsession') { + $contract->fetch($object->fk_contrat); + $morehtmlref .= '
    '; + $morehtmlref .= $langs->trans('Contract') . ' : ' . $contract->getNomUrl(1); + $morehtmlref .= ''; + $morehtmlref .= '
    '; + $morehtmlref .= '
    '; + } $morehtmlref .= ''; + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
    '; + + print '
    '; + print ''; + + // Number of files + print ''; + + // Total size + print ''; + + print '
    '.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
    '.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
    '; + + + print dol_get_fiche_end(); + + $modulepart = 'dolimeet'; + //todo:perms + //$permissiontoadd = $user->rights->'. $object->element .'->dolimeet->write; + $permissiontoadd = 1; + //$permtoedit = $user->rights->'. $object->element .'->dolimeet->write; + $permtoedit = 1; + $param = '&id='.$object->id; + + //$relativepathwithnofile='dolimeet/' . dol_sanitizeFileName($object->id).'/'; + $relativepathwithnofile = $object->element . '/'.dol_sanitizeFileName($object->ref).'/'; + + include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; + print '
    '; + +} else { + accessforbidden('', 0, 1); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/meeting_list.php b/core/tpl/session/dolimeet_session_list.tpl.php similarity index 63% rename from meeting_list.php rename to core/tpl/session/dolimeet_session_list.tpl.php index b9751a4..1fb1f39 100644 --- a/meeting_list.php +++ b/core/tpl/session/dolimeet_session_list.tpl.php @@ -1,41 +1,4 @@ - * Copyright (C) ---Put here your own copyright and developer email--- - * - * 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 envelope_list.php - * \ingroup doliletter - * \brief List page for document - */ - -// Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; -if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; -if (!$res) die("Include of main fails"); - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; @@ -44,6 +7,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; @@ -54,17 +18,22 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php'; -// load envelope libraries -require_once './lib/doliletter_envelope.lib.php'; -require_once './lib/doliletter_function.lib.php'; -require_once __DIR__ . '/class/envelope.class.php'; +// load session libraries +require_once __DIR__ . '/../../../lib/dolimeet_function.lib.php'; +require_once __DIR__ . '/../../../class/session.class.php'; +require_once __DIR__ . '/../../../class/trainingsession.class.php'; +require_once __DIR__ . '/../../../class/meeting.class.php'; +require_once __DIR__ . '/../../../class/audit.class.php'; // for other modules //dol_include_once('/othermodule/class/otherobject.class.php'); global $user, $db, $user, $langs; // Load translation files required by the page -$langs->loadLangs(array("doliletter@doliletter", "other", "bills", "projects", "orders", "companies")); +$langs->loadLangs(array("dolimeet@dolimeet", "other", "bills", "projects", "orders", "companies", "contracts")); $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) @@ -72,14 +41,14 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'documentlist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sessionlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') - $fromtype = GETPOST('fromtype', 'alpha'); // element type $fromid = GETPOST('fromid', 'int'); //element id $id = GETPOST('id', 'int'); +$type = GETPOST('type'); // Load variable for pagination $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; @@ -95,15 +64,21 @@ $pagenext = $page + 1; // Initialize technical objects -$object = new Envelope($db); +$object = new $session_type($db); $extrafields = new ExtraFields($db); $thirdparty = new Societe($db); $contact = new Contact($db); $sender = new User($db); $project = new Project($db); $formproject = new FormProjets($db); - -$diroutputmassaction = $conf->envelope->dir_output.'/temp/massgeneration/'.$user->id; +$formcontrat = new FormContract($db); +if (empty($object->type)) { + $object->type = 'session'; +} +if (!$fromtype || !$fromid) { + unset($object->fields['type']); +} +$diroutputmassaction = $conf->session->dir_output.'/temp/massgeneration/'.$user->id; $hookmanager->initHooks(array('documentlist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels @@ -147,14 +122,23 @@ $objectLinked = new Commande($db); $prehead = 'commande_prepare_head'; break; - case 'contact' : + case 'socpeople' : $objectLinked = new Contact($db); $prehead = 'contact_prepare_head'; break; + case 'contrat' : + $objectLinked = new Contrat($db); + $prehead = 'contract_prepare_head'; + break; + case 'user' : + $objectLinked = new User($db); + $prehead = 'user_prepare_head'; + break; } $objectLinked->fetch($fromid); $head = $prehead($objectLinked); - $linkedObjectsArray = array('thirdparty', 'contact','project'); + $linkedObjectsArray = array('project', 'contrat'); + $signatoryObjectsArray = array('user', 'thirdparty', 'socpeople'); } // Initialize array of search criterias @@ -173,15 +157,27 @@ if(!empty($fromtype)) { switch ($fromtype) { - case 'thirdparty': - $search['fk_soc'] = $fromid; - break; - case 'contact': - $search['fk_contact'] = $fromid; - break; +// case 'thirdparty': +// $search['fk_soc'] = $fromid; +// break; +// case 'contact': +// $search['fk_contact'] = $fromid; +// break; case 'project': $search['fk_project'] = $fromid; break; + case 'contrat': + $search['fk_contrat'] = $fromid; + break; + case 'user': + $search['search_society_attendants'] = $fromid; + break; + case 'socpeople': + $search['search_external_attendants'] = $fromid; + break; + case 'thirdparty': + $search['search_attendant_thirdparties'] = $fromid; + break; } } @@ -214,17 +210,17 @@ $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -$permissiontoread = $user->rights->doliletter->envelope->read; -$permissiontoadd = $user->rights->doliletter->envelope->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->rights->doliletter->envelope->delete || ($permissiontoadd && isset($object->status)); -$permissionnote = $user->rights->doliletter->envelope->write; // Used by the include of actions_setnotes.inc.php -$permissiondellink = $user->rights->envelope->letter->write; // Used by the include of actions_dellink.inc.php -$upload_dir = $conf->doliletter->multidir_output[$conf->entity]; +$object_type = strtolower($session_type); +$permissiontoread = $user->rights->dolimeet->$object_type->read; +$permissiontoadd = $user->rights->dolimeet->$object_type->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->dolimeet->$object_type->delete || ($permissiontoadd && isset($object->status)); +$permissionnote = $user->rights->dolimeet->$object_type->write; // Used by the include of actions_setnotes.inc.php +$upload_dir = $conf->dolimeet->multidir_output[$conf->entity]; // Security check (enable the most restrictive one) if ($user->socid > 0) accessforbidden(); if ($user->socid > 0) $socid = $user->socid; -if (empty($conf->doliletter->enabled)) accessforbidden(); +if (empty($conf->dolimeet->enabled)) accessforbidden(); if (!$permissiontoread) accessforbidden(); /* @@ -267,9 +263,9 @@ } // Mass actions - $objectclass = 'Envelope'; - $objectlabel = 'Envelope'; - $uploaddir = $conf->doliletter->envelope->dir_output; + $objectclass = 'Session'; + $objectlabel = 'Session'; + $uploaddir = $conf->dolimeet->session->dir_output; // include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -278,18 +274,20 @@ */ $form = new Form($db); +$signatory = new DolimeetSignature($db); $now = dol_now(); -//$help_url="EN:Module_Envelope|FR:Module_Envelope_FR|ES:Módulo_Envelope"; +//$help_url="EN:Module_Audit|FR:Module_Audit_FR|ES:Módulo_Audit"; $help_url = ''; -$title = $langs->trans('EnvelopeList'); +$title = $langs->trans(ucfirst($object->type) . 'List'); $morejs = array(); $morecss = array(); + // Build and execute select // -------------------------------------------------------------------- -$sql = 'SELECT '; +$sql = 'SELECT DISTINCT '; $sql .= $object->getFieldList('t'); // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -307,9 +305,28 @@ if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } -if (dol_strlen($fromtype) > 0 && !in_array($fromtype, $linkedObjectsArray)) { - $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'element_element as e on (e.fk_source = ' .$fromid. ' AND e.sourcetype="' . $fromtype . '" AND e.targettype = "doliletter_envelope")'; +if (dol_strlen($fromtype) > 0 && !in_array($fromtype, $linkedObjectsArray) && !in_array($fromtype, $signatoryObjectsArray)) { + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'element_element as e on (e.fk_source = ' .$fromid. ' AND e.sourcetype="' . $fromtype . '" AND e.targettype = "dolimeet_'. $object->type .'")'; +} elseif (is_array($signatoryObjectsArray) && in_array($fromtype, $signatoryObjectsArray)) { + if ($fromtype == 'thirdparty') { + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'socpeople as c on (c.fk_soc = ' .$fromid. ')'; + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'dolimeet_object_signature as e on (e.element_id = c.rowid AND e.element_type="socpeople" AND e.status > 0)'; + } else { + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'dolimeet_object_signature as e on (e.element_id = ' .$fromid. ' AND e.element_type="' . $fromtype . '" AND e.status > 0)'; + } +} + +if (GETPOST('search_society_attendants') > 0) { + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'dolimeet_object_signature as search_society_attendants on (search_society_attendants.element_id = ' .GETPOST('search_society_attendants'). ' AND search_society_attendants.element_type="user" AND search_society_attendants.status > 0)'; +} +if (GETPOST('search_external_attendants') > 0) { + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'dolimeet_object_signature as search_external_attendants on (search_external_attendants.element_id = ' .GETPOST('search_external_attendants'). ' AND search_external_attendants.element_type="socpeople" AND search_external_attendants.status > 0)'; } +if (GETPOST('search_attendant_thirdparties') > 0) { + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'socpeople as cf on (cf.fk_soc = ' .GETPOST('search_attendant_thirdparties'). ')'; + $sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'dolimeet_object_signature as search_attendant_thirdparties on (search_attendant_thirdparties.element_id = cf.rowid AND search_attendant_thirdparties.element_type="socpeople" AND search_attendant_thirdparties.status > 0)'; +} + // Add table from hooks $parameters = array(); $reshook = $hookmanager->executeHooks("printFieldListFrom", $parameters, $object); // Note that $action and $object may have been modified by hook @@ -320,12 +337,26 @@ $sql .= " AND t.entity IN (".getEntity($object->element).")"; } $sql .= " AND t.status > -1"; -if (dol_strlen($fromtype) > 0 && !in_array($fromtype, $linkedObjectsArray)) { +if (is_array($signatoryObjectsArray) && dol_strlen($fromtype) > 0 && !in_array($fromtype, $linkedObjectsArray) && !in_array($fromtype, $signatoryObjectsArray)) { $sql .= " AND t.rowid = e.fk_target "; +} else if (is_array($signatoryObjectsArray) && in_array($fromtype, $signatoryObjectsArray)) { + $sql .= " AND t.rowid = e.fk_object "; } -foreach ($search as $key => $val) { +if (GETPOST('search_society_attendants') > 0) { + $sql .= " AND t.rowid = search_society_attendants.fk_object "; +} +if (GETPOST('search_external_attendants') > 0) { + $sql .= " AND t.rowid = search_external_attendants.fk_object "; +} +if (GETPOST('search_attendant_thirdparties') > 0) { + $sql .= " AND t.rowid = search_attendant_thirdparties.fk_object "; +} +if ($object->type != 'session') { + $sql .= " AND type = '". $object->type ."'"; +} +foreach ($search as $key => $val) { if (array_key_exists($key, $object->fields)) { if ($key == 'status' && $search[$key] == -1) { continue; @@ -341,7 +372,6 @@ $mode_search = 2; } if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); } } else { @@ -356,6 +386,7 @@ } } } + } } @@ -403,18 +434,24 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; - header("Location: ".dol_buildpath('/envelope/envelope_card.php', 1).'?id='.$id); + header("Location: ".dol_buildpath('/'. $object->type .'/'. $object->type .'_card.php', 1).'?id='.$id); exit; } +if ($object->type != 'trainingsession' && GETPOST('fromtype') != 'contrat') { + unset($object->fields['fk_contrat']); +} // Output page // -------------------------------------------------------------------- llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); +require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; +$contract = new Contrat($db); + if (!empty($fromtype)) { - print dol_get_fiche_head($head, 'envelopeList', $langs->trans("Envelope"), -1, $objectLinked->picto); + print dol_get_fiche_head($head, $object->type . 'List', $langs->trans($object->type), -1, $objectLinked->picto); dol_banner_tab($objectLinked, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); } @@ -444,7 +481,7 @@ $param .= '&optioncss='.urlencode($optioncss); } // Add $param from extra fields -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php'; // Add $param from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook @@ -452,10 +489,10 @@ // List of mass actions available $arrayofmassactions = array( - //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), - //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), - //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), - //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), +//'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"), +//'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"), +//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), +//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); @@ -465,7 +502,7 @@ } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); -print ''."\n"; +print ''."\n"; if ($optioncss != '') { print ''; } @@ -481,16 +518,17 @@ if (!empty($fromtype)) { $fromurl = '&fromtype='.$fromtype.'&fromid='.$fromid; } -$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/doliletter/envelope_card.php', 1).'?action=create'.$fromurl, '', $permissiontoadd); -$object->picto ='doliletter32px@doliletter'; +if ($object->type !== 'session') { + $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/dolimeet/view/'. strtolower($object->type) .'/'. strtolower($object->type) .'_card.php', 1).'?action=create'.$fromurl, '', $permissiontoadd); +} print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); -$object->picto ='doliletter16px@doliletter'; // Add code for pre mass action (confirmation or email presend form) -$topicmail = "SendEnvelopeRef"; +$topicmail = "Send". $object->type ."Ref"; $modelmail = "document"; -$objecttmp = new Envelope($db); + +$objecttmp = new $object->type($db); $trackid = 'xxxx'.$object->id; -include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; +include DOL_DOCUMENT_ROOT . '/core/tpl/massactions_pre.tpl.php'; if ($search_all) { foreach ($fieldstosearchall as $key => $val) { @@ -501,31 +539,39 @@ $moreforfilter = ''; /*$moreforfilter.='
    '; -$moreforfilter.= $langs->trans('MyFilter') . ': '; -$moreforfilter.= '
    ';*/ + $moreforfilter.= $langs->trans('MyFilter') . ': '; + $moreforfilter.= '';*/ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook if (empty($reshook)) { - $moreforfilter .= $hookmanager->resPrint; +$moreforfilter .= $hookmanager->resPrint; } else { - $moreforfilter = $hookmanager->resPrint; +$moreforfilter = $hookmanager->resPrint; } if (!empty($moreforfilter)) { - print '
    '; +print '
    '; print $moreforfilter; print '
    '; } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; + +$arrayfields['SocietyAttendants'] = array('label' => 'SocietyAttendants', 'checked' => 1); +$arrayfields['ExternalAttendants'] = array('label' => 'ExternalAttendants', 'checked' => 1); +$arrayfields['AttendantThirdparties'] = array('label' => 'AttendantThirdparties', 'checked' => 1); + $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); +$object->fields['Custom']['SOCIETY_ATTENDANTS'] = $arrayfields['SocietyAttendants'] ; +$object->fields['Custom']['EXTERNAL_ATTENDANT'] = $arrayfields['ExternalAttendants']; +$object->fields['Custom']['ATTENDANT_THIRDPARTIES'] = $arrayfields['AttendantThirdparties']; + print '
    '; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''."\n"; - // Fields title search // -------------------------------------------------------------------- print ''; @@ -554,6 +600,10 @@ $project->fetch(0, $search['fk_project']); print $formproject->select_projects(0, ( ! empty(GETPOST('fk_project')) ? GETPOST('fk_project') : (GETPOST('fromtype') == 'project' ? GETPOST('fromid') : '')), 'fk_project', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth200'); print ''; + } elseif ($key == 'fk_contrat') { + $contract->fetch(0, $search['fk_contrat']); + $formcontrat->select_contract(-1, ( ! empty(GETPOST('fk_contrat')) ? GETPOST('fk_contrat') : (GETPOST('fromtype') == 'contrat' ? GETPOST('fromid') : '')), 'fk_contrat', 0, 1, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth200'); + print ''; } elseif ($key == 'fk_contact') { $contact->fetch(0, $search['fk_contact']); print $form->selectcontacts(0, !empty(GETPOST('fk_contact')) ? GETPOST('fk_contact') : (GETPOST('fromtype') == 'contact' ? GETPOST('fromid') : ''), 'fk_contact', 1); @@ -571,10 +621,29 @@ print ''; } print ''; + } elseif ($key == 'Custom') { + foreach ($val as $resource) { + if ($resource['checked']) { + if ($resource['label'] == 'SocietyAttendants') { + print ''; + } else if ($resource['label'] == 'ExternalAttendants') { + print ''; + } else if ($resource['label'] == 'AttendantThirdparties') { + print ''; + } + } + } } + } // Extra fields -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; +include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields); @@ -591,36 +660,43 @@ // Fields title label // -------------------------------------------------------------------- print ''; -foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); - if ($key == 'status') { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } elseif (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { - $cssforfield .= ($cssforfield ? ' ' : '').'right'; - } - if (!empty($arrayfields['t.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + foreach ($object->fields as $key => $val) { + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + if ($key == 'status') { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'center'; + } elseif (in_array($val['type'], array('timestamp'))) { + $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; + } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) { + $cssforfield .= ($cssforfield ? ' ' : '').'right'; + } + if (!empty($arrayfields['t.'.$key]['checked'])) { + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; + } elseif ($key == 'Custom') { + foreach ($val as $resource) { + if ($resource['checked']) { + print ''; + } + } + } } -} -// Extra fields -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; -// Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); -$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook -print $hookmanager->resPrint; -// Action column -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; -print ''."\n"; - + // Extra fields + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php'; + // Hook fields + $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); + $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + // Action column + print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; + print ''."\n"; -// Detect if we need a fetch on each output line -$needToFetchEachLine = 0; -if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { - foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { + // Detect if we need a fetch on each output line + $needToFetchEachLine = 0; + if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { if (preg_match('/\$object/', $val)) { $needToFetchEachLine++; // There is at least one compute field that use $object } @@ -634,9 +710,10 @@ $totalarray = array(); $totalarray['nbfield'] = 0; while ($i < ($limit ? min($num, $limit) : $num)) { + $obj = $db->fetch_object($resql); if (empty($obj)) { - break; // Should not happen + break; // Should not happen } // Store properties in $object @@ -645,7 +722,7 @@ // Show here line of result print ''; foreach ($object->fields as $key => $val) { - $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif ($key == 'status') { @@ -666,20 +743,34 @@ if (!empty($arrayfields['t.'.$key]['checked'])) { print ''; if ($key == 'fk_soc') { - $thirdparty->fetch($obj->fk_soc); - print $thirdparty->getNomUrl(1); + if ($object->fk_soc > 0) { + $thirdparty->fetch($obj->fk_soc); + print $thirdparty->getNomUrl(1); + } + } elseif ($key == 'fk_contrat') { + if ($obj->fk_contrat > 0) { + $contract->fetch($obj->fk_contrat); + print $contract->getNomUrl(1); + } + } elseif ($key == 'type') { + print '
    '; + print $langs->transnoentities(ucfirst($object->type)); + print '
    '; } else if ($key == 'fk_contact') { $contact->fetch($obj->fk_contact); - print $contact->getNomUrl(1); + print $contact->getNomUrl(1); } - else if ($key == 'sender') { + else if ($key == 'sender') { $sender->fetch($obj->sender); print $sender->getNomUrl(); } else if ($key == 'fk_project') { - $project->fetch($obj->fk_project); - print $project->getNomUrl(1); + if ($obj->fk_project > 0) { + + $project->fetch($obj->fk_project); + print $project->getNomUrl(1); + } } else if ($key == 'status') { print $object->getLibStatut(5); @@ -704,47 +795,86 @@ } $totalarray['val']['t.'.$key] += $object->$key; } + } else if ($key == 'Custom') { + foreach ($val as $resource) { + if ($resource['checked']) { + if ($resource['label'] == 'SocietyAttendants') { + $signatories = $signatory->fetchSignatory(strtoupper($object->type).'_SOCIETY_ATTENDANT',$object->id, $object->type); + print '
    '; + } elseif ($resource['label'] == 'ExternalAttendants') { + $signatories = $signatory->fetchSignatory(strtoupper($object->type).'_EXTERNAL_ATTENDANT',$object->id, $object->type); + print ''; + } elseif ($resource['label'] == 'AttendantThirdparties') { + $signatories = $signatory->fetchSignatory(strtoupper($object->type).'_EXTERNAL_ATTENDANT',$object->id, $object->type); + print ''; + } + } + } } } // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; + include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column print ''; + } + print ''; if (!$i) { - $totalarray['nbfield']++; + $totalarray['nbfield']++; } print ''."\n"; - $i++; } // Show total line -include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; +include DOL_DOCUMENT_ROOT . '/core/tpl/list_print_total.tpl.php'; // If no record found if ($num == 0) { - $colspan = 1; - foreach ($arrayfields as $key => $val) { - if (!empty($val['checked'])) { - $colspan++; - } - } - print ''; +$colspan = 1; +foreach ($arrayfields as $key => $val) { +if (!empty($val['checked'])) { +$colspan++; +} +} +print ''; } - $db->free($resql); @@ -763,7 +893,7 @@ $hidegeneratedfilelistifempty = 0; } - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; $formfile = new FormFile($db); // Show list of available documents @@ -774,9 +904,5 @@ $genallowed = $permissiontoread; $delallowed = $permissiontoadd; - print $formfile->showdocuments('massfilesarea_envelope', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); + print $formfile->showdocuments('massfilesarea_' .$object->type, '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } - -// End of page -llxFooter(); -$db->close(); diff --git a/core/tpl/session/dolimeet_session_note.tpl.php b/core/tpl/session/dolimeet_session_note.tpl.php new file mode 100644 index 0000000..5825d32 --- /dev/null +++ b/core/tpl/session/dolimeet_session_note.tpl.php @@ -0,0 +1,98 @@ +dolimeet->dir_output.'/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array($object->element.'note', 'globalcard')); // Note that conf->hooks_modules contains array +// Fetch optionals attributes and labels +$extrafields->fetch_name_optionals_label($object->table_element); + +// Load object +include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals +if ($id > 0 || !empty($ref)) { + $upload_dir = $conf->dolimeet->multidir_output[$object->entity]."/".$object->id; +} + +$object_type = $object->element; +$permissiontoread = $user->rights->dolimeet->$object_type->read; +$permissiontoadd = $user->rights->dolimeet->$object_type->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->dolimeet->$object_type->delete || ($permissiontoadd && isset($object->status)); +$permissionnote = $user->rights->dolimeet->$object_type->write; // Used by the include of actions_setnotes.inc.php +$upload_dir = $conf->dolimeet->multidir_output[$conf->entity]; + +// Security check (enable the most restrictive one) +if ($user->socid > 0) accessforbidden(); +if ($user->socid > 0) $socid = $user->socid; +if (empty($conf->dolimeet->enabled)) accessforbidden(); +if (!$permissiontoread) accessforbidden(); + +/* + * Actions + */ + +include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once + + +/* + * View + */ + +$form = new Form($db); + +//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; +$help_url = ''; +$title = $langs->trans("Note" . ucfirst($object->element)); + +llxHeader('', $title, $help_url); + +if ($id > 0 || !empty($ref)) { + $object->fetch_thirdparty(); + + $prepareHead = $object->element . 'PrepareHead'; + $head = $prepareHead($object); + + print dol_get_fiche_head($head, 'note', $langs->trans('Notes'), -1, $object->picto); + + // Object card + // ------------------------------------------------------------ + $linkback = ''.$langs->trans("BackToList").''; + + + // Project + $project->fetch($object->fk_project); + $morehtmlref = '- ' . $object->label; + $morehtmlref .= '
    '; + $morehtmlref .= $langs->trans('Project') . ' : ' . $project->getNomUrl(1); + $morehtmlref .= ''; + $morehtmlref .= '
    '; + $morehtmlref .= '
    '; + + if ($object->element == 'trainingsession') { + $contract->fetch($object->fk_contrat); + $morehtmlref .= '
    '; + $morehtmlref .= $langs->trans('Contract') . ' : ' . $contract->getNomUrl(1); + $morehtmlref .= ''; + $morehtmlref .= '
    '; + $morehtmlref .= '
    '; + } + + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); + + print '
    '; + print '
    '; + + + $cssclass = "titlefield"; + include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; + + print '
    '; + + print dol_get_fiche_end(); +} + +// End of page +llxFooter(); +$db->close(); diff --git a/core/tpl/signature/dolimeet_signature_action_view.tpl.php b/core/tpl/signature/dolimeet_signature_action_view.tpl.php new file mode 100644 index 0000000..819e74c --- /dev/null +++ b/core/tpl/signature/dolimeet_signature_action_view.tpl.php @@ -0,0 +1,46 @@ +
    + + + +
    + + + + diff --git a/core/tpl/signature/dolimeet_signature_view.tpl.php b/core/tpl/signature/dolimeet_signature_view.tpl.php new file mode 100644 index 0000000..9f4b7a5 --- /dev/null +++ b/core/tpl/signature/dolimeet_signature_view.tpl.php @@ -0,0 +1,44 @@ +signature)) : ?> + +signature)) : ?> + + + + + + + + diff --git a/core/tpl/signature/index.php b/core/tpl/signature/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/core/tpl/signature/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 . + * or see https://www.gnu.org/ + */ + + +/** + * \file core/triggers/interface_99_modDoliMeet_DoliMeetTriggers.class.php + * \ingroup dolimeet + * \brief DoliMeet trigger. + */ + +require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php'; + +/** + * Class of triggers for DoliMeet module + */ +class InterfaceDoliMeetTriggers extends DolibarrTriggers +{ + /** + * @var DoliDB Database handler + */ + protected $db; + + /** + * Constructor + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + $this->db = $db; + + $this->name = preg_replace('/^Interface/i', '', get_class($this)); + $this->family = "demo"; + $this->description = "DoliMeet triggers."; + $this->version = '1.0.2'; + $this->picto = 'dolimeet@dolimeet'; + } + + /** + * Trigger name + * + * @return string Name of trigger file + */ + public function getName() + { + return $this->name; + } + + /** + * Trigger description + * + * @return string Description of trigger file + */ + public function getDesc() + { + return $this->description; + } + + /** + * Function called when a Dolibarrr business event is done. + * All functions "runTrigger" are triggered if file + * is inside directory core/triggers + * + * @param string $action Event action code + * @param CommonObject $object Object + * @param User $user Object user + * @param Translate $langs Object langs + * @param Conf $conf Object conf + * @return int <0 if KO, 0 if no triggered ran, >0 if OK + */ + public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf) + { + //echo '
    '; print_r( $conf ); echo '
    '; exit; + if (empty($conf->dolimeet->enabled)) return 0; // If module is not enabled, we do nothing + + // Data and type of action are stored into $object and $action + switch ($action) { + + // Meeting + case 'MEETING_CREATE' : + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = 'meeting@dolimeet'; + $actioncomm->code = 'AC_MEETING_CREATE'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->trans('MeetingCreateTrigger'); + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->id; + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $result = $actioncomm->create($user); + break; + + case 'MEETING_MODIFY' : + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = 'meeting@dolimeet'; + $actioncomm->code = 'AC_MEETING_MODIFY'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->trans('MeetingModifyTrigger'); + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->id; + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + case 'MEETING_DELETE' : + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = 'meeting@dolimeet'; + $actioncomm->code = 'AC_MEETING_DELETE'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->trans('MeetingDeleteTrigger'); + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->id; + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + // TrainingSession + case 'TRAININGSESSION_CREATE' : + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = 'trainingsession@dolimeet'; + $actioncomm->code = 'AC_TRAININGSESSION_CREATE'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->trans('TrainingSessionCreateTrigger'); + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->id; + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $result = $actioncomm->create($user); + break; + + case 'TRAININGSESSION_MODIFY' : + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = 'trainingsession@dolimeet'; + $actioncomm->code = 'AC_TRAININGSESSION_MODIFY'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->trans('TrainingSessionModifyTrigger'); + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->id; + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + case 'TRAININGSESSION_DELETE' : + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = 'trainingsession@dolimeet'; + $actioncomm->code = 'AC_TRAININGSESSION_DELETE'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->trans('TrainingSessionDeleteTrigger'); + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->id; + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + // Audit + case 'AUDIT_CREATE' : + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = 'audit@dolimeet'; + $actioncomm->code = 'AC_AUDIT_CREATE'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->trans('AuditCreateTrigger'); + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->id; + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $result = $actioncomm->create($user); + break; + + case 'AUDIT_MODIFY' : + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = 'audit@dolimeet'; + $actioncomm->code = 'AC_AUDIT_MODIFY'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->trans('AuditModifyTrigger'); + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->id; + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + case 'AUDIT_DELETE' : + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = 'audit@dolimeet'; + $actioncomm->code = 'AC_AUDIT_DELETE'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->trans('AuditDeleteTrigger'); + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->id; + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + + case 'SESSION_ADDATTENDANT' : + dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); + require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = $object->object_type . '@dolimeet'; + $actioncomm->code = 'AC_SESSION_ADDATTENDANT'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->transnoentities('AddAttendantTrigger', $object->firstname . ' ' . $object->lastname); + if ($object->element_type == 'socpeople') { + $actioncomm->socpeopleassigned = array($object->element_id => $object->element_id); + } + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->fk_object; + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + case 'DOLIMEETSIGNATURE_SIGNED' : + dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); + require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = $object->object_type . '@dolimeet'; + $actioncomm->code = 'AC_DOLIMEETSIGNATURE_SIGNED'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + + $actioncomm->label = $langs->transnoentities($object->role . 'Signed') . ' : ' . $object->firstname . ' ' . $object->lastname; + + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->fk_object; + if ($object->element_type == 'socpeople') { + $actioncomm->socpeopleassigned = array($object->element_id => $object->element_id); + } + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + case 'DOLIMEETSIGNATURE_PENDING_SIGNATURE' : + + dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); + require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = $object->object_type . '@dolimeet'; + $actioncomm->code = 'AC_DOLIMEETSIGNATURE_PENDING_SIGNATURE'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->transnoentities('DolimeetSignaturePendingSignatureTrigger') . ' : ' . $object->firstname . ' ' . $object->lastname; + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->fk_object; + if ($object->element_type == 'socpeople') { + $actioncomm->socpeopleassigned = array($object->element_id => $object->element_id); + } + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + case 'DOLIMEETSIGNATURE_ABSENT' : + + dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); + require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = $object->object_type . '@dolimeet'; + $actioncomm->code = 'AC_DOLIMEETSIGNATURE_ABSENT'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->transnoentities('DolimeetSignatureAbsentTrigger') . ' : ' . $object->firstname . ' ' . $object->lastname; + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->fk_object; + if ($object->element_type == 'socpeople') { + $actioncomm->socpeopleassigned = array($object->element_id => $object->element_id); + } + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + case 'DOLIMEETSIGNATURE_DELETED' : + + dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); + require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; + $now = dol_now(); + $actioncomm = new ActionComm($this->db); + + $actioncomm->elementtype = $object->object_type . '@dolimeet'; + $actioncomm->code = 'AC_DOLIMEETSIGNATURE_DELETED'; + $actioncomm->type_code = 'AC_OTH_AUTO'; + $actioncomm->label = $langs->transnoentities('DolimeetSignatureDeletedTrigger') . ' : ' . $object->firstname . ' ' . $object->lastname; + $actioncomm->datep = $now; + $actioncomm->fk_element = $object->fk_object; + $actioncomm->socpeopleassigned = array($object->element_id => $object->element_id); + $actioncomm->userownerid = $user->id; + $actioncomm->percentage = -1; + + $actioncomm->create($user); + break; + + default: + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + break; + } + + + return 0; + } +} diff --git a/css/dolimeet.css b/css/dolimeet.css new file mode 100644 index 0000000..8a00bbd --- /dev/null +++ b/css/dolimeet.css @@ -0,0 +1,4117 @@ +@charset "UTF-8"; +.risk-evaluation-cotation { + width: 50px; + min-width: 50px; + height: 50px; + line-height: 50px; + text-align: center; + border-radius: 6px; + background: #ececec; + color: rgba(0, 0, 0, 0.8); + font-size: 16px; + font-weight: 600; + margin-right: 0.5em; +} +.risk-evaluation-cotation[data-scale="1"] { + background: #ececec; +} +.risk-evaluation-cotation[data-scale="2"] { + background: #e9ad4f; + color: #fff; +} +.risk-evaluation-cotation[data-scale="3"] { + background: #e05353; + color: #fff; +} +.risk-evaluation-cotation[data-scale="4"] { + background: #2b2b2b; + color: #fff; +} +.risk-evaluation-cotation.selected-cotation { + -webkit-box-shadow: 0 0 0 2px #0d8aff; + box-shadow: 0 0 0 2px #0d8aff; +} + +.can-select, .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .risk-evaluation-cotation { + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.can-select:hover, .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .risk-evaluation-cotation:hover { + cursor: pointer; + opacity: 0.8; +} + +.wpeo-modal .title { + display: block; + font-weight: 600; + font-size: 13px; + margin-bottom: 0.6em; + color: rgba(0, 0, 0, 0.8); +} +.wpeo-modal input[type=text], +.wpeo-modal input[type=email], +.wpeo-modal input[type=url], +.wpeo-modal input[type=password], +.wpeo-modal input[type=search], +.wpeo-modal input[type=number], +.wpeo-modal input[type=tel], +.wpeo-modal input[type=range], +.wpeo-modal input[type=date], +.wpeo-modal input[type=month], +.wpeo-modal input[type=week], +.wpeo-modal input[type=time], +.wpeo-modal input[type=datetime], +.wpeo-modal input[type=datetime-local], +.wpeo-modal input[type=color], +.wpeo-modal select, +.wpeo-modal textarea { + width: 100%; + border: 1px solid rgba(0, 0, 0, 0.2); + padding: 1em; +} +.wpeo-modal input[type=text]:focus, +.wpeo-modal input[type=email]:focus, +.wpeo-modal input[type=url]:focus, +.wpeo-modal input[type=password]:focus, +.wpeo-modal input[type=search]:focus, +.wpeo-modal input[type=number]:focus, +.wpeo-modal input[type=tel]:focus, +.wpeo-modal input[type=range]:focus, +.wpeo-modal input[type=date]:focus, +.wpeo-modal input[type=month]:focus, +.wpeo-modal input[type=week]:focus, +.wpeo-modal input[type=time]:focus, +.wpeo-modal input[type=datetime]:focus, +.wpeo-modal input[type=datetime-local]:focus, +.wpeo-modal input[type=color]:focus, +.wpeo-modal select:focus, +.wpeo-modal textarea:focus { + border: 1px solid rgba(0, 0, 0, 0.6); +} +.wpeo-modal select { + padding: 1em 0; +} + +.form-label-required::after { + display: inline-block; + content: "*"; + color: #e05353; + font-size: 22px; + line-height: 0; + position: relative; + top: 4px; + left: 4px; +} + +.digirisk-page-container { + max-width: 1000px; + background: #fff; + -webkit-box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.1); + margin: 1.5em auto 0 auto; + padding: 2em; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.digirisk-page-container * { + -webkit-box-sizing: border-box; + box-sizing: border-box; +} + +.pictoDigirisk { + vertical-align: middle; + width: 24px; + margin-right: 2px; +} + +/*-------------------------------------------------------------- + Module : Dropdown + Version : 1.0.0 + + .wpeo-dropdown -> classe de base du mobule + .grid -> Affichage en grille + .list -> Affichage en liste +--------------------------------------------------------------*/ +.wpeo-dropdown { + position: relative; + display: inline-block; +} +.wpeo-dropdown .dropdown-toggle { + display: inline-block; +} +.wpeo-dropdown .dropdown-toggle span ~ *[class*=icon] { + margin-left: 10px; +} +.wpeo-dropdown .dropdown-content { + opacity: 0; + pointer-events: none; + -webkit-transform: translateY(-10px); + transform: translateY(-10px); + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + position: absolute; + background: #fff; + z-index: 99; + border: 1px solid rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.3); + box-shadow: 0 0 10px 0px rgba(0, 0, 0, 0.3); + width: 220px; + padding: 0.6em; +} +.wpeo-dropdown.dropdown-active .dropdown-content { + opacity: 1; + pointer-events: auto; + -webkit-transform: translateY(0); + transform: translateY(0); +} +.wpeo-dropdown ul, .wpeo-dropdown li { + margin: 0; + list-style-type: none; + padding: 0; +} +.wpeo-dropdown .dropdown-item { + display: block; + color: rgba(0, 0, 0, 0.7); + text-decoration: none; +} +.wpeo-dropdown .dropdown-item::before { + display: none; + content: ""; +} +.wpeo-dropdown .dropdown-item .dropdown-result-title, .wpeo-dropdown .dropdown-item .dropdown-result-subtitle { + display: block; +} +.wpeo-dropdown .dropdown-item .dropdown-result-title { + font-size: 14px; +} +.wpeo-dropdown .dropdown-item .dropdown-result-subtitle { + font-size: 12px; + color: rgba(0, 0, 0, 0.5); +} + +/** Taille */ +.wpeo-dropdown.dropdown-small .dropdown-content { + width: 60px; +} +.wpeo-dropdown.dropdown-medium .dropdown-content { + width: 220px; +} +.wpeo-dropdown.dropdown-large .dropdown-content { + width: 360px; +} + +/** Padding */ +.wpeo-dropdown.dropdown-padding-0 .dropdown-content { + padding: 0; +} +.wpeo-dropdown.dropdown-padding-1 .dropdown-content { + padding: 0.6em; +} +.wpeo-dropdown.dropdown-padding-2 .dropdown-content { + padding: 1.2em; +} + +/** Alignement */ +.wpeo-dropdown.dropdown-left .dropdown-content { + left: 0; +} +.wpeo-dropdown.dropdown-right .dropdown-content { + right: 0; +} +.wpeo-dropdown.dropdown-horizontal.dropdown-left .dropdown-content { + left: 100%; +} +.wpeo-dropdown.dropdown-horizontal.dropdown-right .dropdown-content { + right: 100%; +} + +/** Sens */ +.wpeo-dropdown.dropdown-horizontal .dropdown-content { + top: 0; + width: auto !important; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; +} + +/** Disable */ +.wpeo-dropdown .dropdown-item.dropdown-item-disable { + opacity: 0.6; + cursor: default !important; + pointer-events: none; +} +.wpeo-dropdown .dropdown-content .dropdown-item { + padding: 0.6em; + background: #fff; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.wpeo-dropdown .dropdown-content .dropdown-item:hover { + cursor: pointer; + background: rgba(0, 0, 0, 0.1); +} + +.wpeo-dropdown.dropdown-list .dropdown-content { + text-align: left; +} +.wpeo-dropdown.dropdown-list .dropdown-item::after { + display: block; + content: ""; + clear: both; +} +.wpeo-dropdown.dropdown-list .dropdown-item img { + float: left; + margin-right: 0.4em; +} + +.wpeo-dropdown.dropdown-grid .dropdown-item img { + width: 100%; + height: auto; + display: block; + margin: 0; +} + +/*-------------------------------------------------------------- + Module : Button + Version : 1.2.0 + + * Les boutons se forment grâce à leurs classes CSS + * .button -> classe de base pour un bouton + * .primary + * .light + * .dark + * .red + * .yellow + * .blue + * .green + * .transparent + * .bordered -> Change l'affichage du bouton. Fonctionne avec les même couleurs + * .strong -> texte en gras + * .uppercase -> texte en majuscule + * .float-right -> float right + * .float-left -> float left + * .square-30 -> bouton carré 30px + * .square-40 -> bouton carré 40px + * .square-50 -> bouton carré 50px + * .square-60 -> bouton carré 60px + * .margin -> margin haut et bas sur le bouton + * .radius-1 -> Arrondis les bords + * .radius-3 -> Arrondis les bords + * .radius-3 -> Arrondis les bords + * .rounded -> bouton en forme de rond + * .disable -> désactive les actions sur le bouton + * .size-small -> petite taille + * .size-large -> grande taille +--------------------------------------------------------------*/ +.wpeo-button { + display: inline-block; + border: 0; + -webkit-box-shadow: none; + box-shadow: none; + background: none; + text-decoration: none; + padding: 6px 14px; + line-height: 1.4; + vertical-align: middle; + height: auto; + border-radius: 0; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + position: relative; + border-width: 3px; + border-style: solid; + font-size: 16px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + background: #0d8aff; + border-color: #0d8aff; + color: #fff; +} +.wpeo-button:focus, .wpeo-button:visited { + color: #fff; +} +.wpeo-button:hover { + color: #fff; + -webkit-box-shadow: inset 0 -2.6em rgba(255, 255, 255, 0.25); + box-shadow: inset 0 -2.6em rgba(255, 255, 255, 0.25); + cursor: pointer; + text-decoration: none; +} +.wpeo-button:focus, .wpeo-button:active { + outline: none; +} + +/** Colors */ +.wpeo-button { + /* par défaut */ + background: #0d8aff; + border-color: #0d8aff; + color: #fff; +} +.wpeo-button.button-main { + background: #0d8aff; + border-color: #0d8aff; + color: #fff; +} +.wpeo-button.button-secondary { + background: #263C5C; + border-color: #263C5C; + color: #fff; +} +.wpeo-button.button-light { + background: #fff; + border-color: #fff; + color: #333333; +} +.wpeo-button.button-light:hover { + -webkit-box-shadow: inset 0 -2.6em rgba(0, 0, 0, 0.1); + box-shadow: inset 0 -2.6em rgba(0, 0, 0, 0.1); + color: #333333; +} +.wpeo-button.button-dark { + background: #2b2b2b; + border-color: #2b2b2b; +} +.wpeo-button.button-grey { + background: #ececec; + border-color: #ececec; + color: #333333; +} +.wpeo-button.button-grey:hover { + -webkit-box-shadow: inset 0 -2.6em rgba(0, 0, 0, 0.1); + box-shadow: inset 0 -2.6em rgba(0, 0, 0, 0.1); + color: #333333; +} +.wpeo-button.button-red { + background: #e05353; + border-color: #e05353; +} +.wpeo-button.button-yellow { + background: #e9ad4f; + border-color: #e9ad4f; +} +.wpeo-button.button-blue { + background: #0d8aff; + border-color: #0d8aff; +} +.wpeo-button.button-green { + background: #47e58e; + border-color: #47e58e; +} +.wpeo-button.button-transparent { + background: transparent; + border-color: transparent; + color: rgba(51, 51, 51, 0.4); +} +.wpeo-button.button-transparent:hover { + color: #333333; + -webkit-box-shadow: inset 0 -2.6em rgba(255, 255, 255, 0); + box-shadow: inset 0 -2.6em rgba(255, 255, 255, 0); +} + +.wpeo-button.button-bordered { + background: none; + /* Par defaut */ + border-color: #0d8aff; + color: #0d8aff; +} +.wpeo-button.button-bordered.button-main { + border-color: #0d8aff; + color: #0d8aff; +} +.wpeo-button.button-bordered.button-main:hover { + -webkit-box-shadow: inset 0 -2.6em #0d8aff; + box-shadow: inset 0 -2.6em #0d8aff; + color: #fff; +} +.wpeo-button.button-bordered.button-light { + border-color: #fff; + color: #fff; +} +.wpeo-button.button-bordered.button-light:hover { + -webkit-box-shadow: inset 0 -2.6em #fff; + box-shadow: inset 0 -2.6em #fff; + color: #333333; +} +.wpeo-button.button-bordered.button-dark { + border-color: #2b2b2b; + color: #2b2b2b; +} +.wpeo-button.button-bordered.button-dark:hover { + -webkit-box-shadow: inset 0 -2.6em #2b2b2b; + box-shadow: inset 0 -2.6em #2b2b2b; +} +.wpeo-button.button-bordered.button-grey { + border-color: #ececec; + color: #a0a0a0; +} +.wpeo-button.button-bordered.button-grey:hover { + -webkit-box-shadow: inset 0 -2.6em #ececec; + box-shadow: inset 0 -2.6em #ececec; + color: #333333; +} +.wpeo-button.button-bordered.button-red { + border-color: #e05353; + color: #e05353; +} +.wpeo-button.button-bordered.button-red:hover { + -webkit-box-shadow: inset 0 -2.6em #e05353; + box-shadow: inset 0 -2.6em #e05353; +} +.wpeo-button.button-bordered.button-yellow { + border-color: #e9ad4f; + color: #e9ad4f; +} +.wpeo-button.button-bordered.button-yellow:hover { + -webkit-box-shadow: inset 0 -2.6em #e9ad4f; + box-shadow: inset 0 -2.6em #e9ad4f; +} +.wpeo-button.button-bordered.button-blue { + border-color: #0d8aff; + color: #0d8aff; +} +.wpeo-button.button-bordered.button-blue:hover { + -webkit-box-shadow: inset 0 -2.6em #0d8aff; + box-shadow: inset 0 -2.6em #0d8aff; +} +.wpeo-button.button-bordered.button-green { + border-color: #47e58e; + color: #47e58e; +} +.wpeo-button.button-bordered.button-green:hover { + -webkit-box-shadow: inset 0 -2.6em #47e58e; + box-shadow: inset 0 -2.6em #47e58e; +} +.wpeo-button.button-bordered:hover { + -webkit-box-shadow: inset 0 -2.6em #0d8aff; + box-shadow: inset 0 -2.6em #0d8aff; + color: #fff; +} + +.wpeo-button .button-add { + position: absolute; + top: 0.4em; + right: 0.2em; + opacity: 0.6; + font-size: 14px; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.wpeo-button:hover .button-add { + opacity: 0.8; +} + +.wpeo-button.button-square-40 .button-add { + top: 0.1em; + right: 0; +} + +.wpeo-button .button-icon, .wpeo-button span { + position: relative; +} +.wpeo-button .button-icon ~ span { + margin-left: 10px; +} +.wpeo-button span ~ .button-icon { + margin-left: 10px; +} + +.wpeo-button.button-strong span { + font-weight: 800; +} + +.wpeo-button.button-uppercase span { + text-transform: uppercase; + font-size: 14px; +} + +.wpeo-button[class*=button-square-] { + text-align: center; + overflow: hidden; + padding: 0; +} + +.wpeo-button.button-square-30 { + width: 30px; + height: 30px; + line-height: 24px; +} +.wpeo-button.button-square-30 .button-icon { + font-size: 12px; + line-height: 24px; +} + +.wpeo-button.button-square-40 { + width: 40px; + height: 40px; + line-height: 34px; +} +.wpeo-button.button-square-40 .button-icon { + line-height: 34px; +} + +.wpeo-button.button-square-50 { + width: 50px; + height: 50px; + line-height: 44px; +} +.wpeo-button.button-square-50 .button-icon { + line-height: 44px; +} + +.wpeo-button.button-square-60 { + width: 60px; + height: 60px; + line-height: 54px; +} +.wpeo-button.button-square-60 .button-icon { + line-height: 54px; +} + +.wpeo-button.button-float-left { + float: left; +} +.wpeo-button.button-float-right { + float: right; +} + +.wpeo-button.button-margin { + margin: 1em 0; +} + +.wpeo-button.button-radius-1 { + border-radius: 2px; +} +.wpeo-button.button-radius-2 { + border-radius: 4px; +} +.wpeo-button.button-radius-3 { + border-radius: 6px; +} +.wpeo-button.button-rounded { + border-radius: 50%; +} + +.wpeo-button.button-disable { + background: #ececec !important; + border-color: #ececec !important; + color: rgba(0, 0, 0, 0.4) !important; + pointer-events: none; +} +.wpeo-button.button-disable:hover { + -webkit-box-shadow: none !important; + box-shadow: none !important; +} +.wpeo-button.button-disable.button-event { + pointer-events: all; +} + +.wpeo-button.button-size-small { + font-size: 14px; +} +.wpeo-button.button-size-small.button-uppercase span { + font-size: 12px; +} + +.wpeo-button.button-size-large { + font-size: 18px; +} +.wpeo-button.button-size-large.button-uppercase span { + font-size: 16px; +} + +/*-------------------------------------------------------------- + Module : Modal + Version : 1.0.0 + + .wpeo-modal -> classe de base du mobule + .modalactive -> lance l'apparition de la modal + .no-modal-close -> désactive l'icone fermeture +--------------------------------------------------------------*/ +.wpeo-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; + background: rgba(39, 42, 53, 0.9); + opacity: 0; + pointer-events: none; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.wpeo-modal textarea { + resize: none; +} +.wpeo-modal.modal-active { + opacity: 1; + pointer-events: auto; + z-index: 1002; +} +.wpeo-modal.modal-active .modal-container { + -webkit-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); +} +.wpeo-modal.modal-active textarea { + resize: both; +} +.wpeo-modal.modal-active .modal-active { + z-index: 1003; +} +.wpeo-modal.modal-active .modal-active .modal-active { + z-index: 1004; +} +.wpeo-modal.modal-force-display .modal-close { + display: none; +} + +.wpeo-modal .modal-container { + position: absolute; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + width: 100%; + max-width: 860px; + height: 100%; + max-height: 560px; + background: #fff; + padding: 1em 0; + margin: auto; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -60%); + transform: translate(-50%, -60%); +} +@media (max-width: 480px) { + .wpeo-modal .modal-container { + padding: 1em; + } +} +.wpeo-modal .modal-container .modal-header { + height: 10%; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + padding: 0 2em; +} +.wpeo-modal .modal-container .modal-content { + height: 78%; + padding: 0 2em; +} +.wpeo-modal .modal-container .modal-footer { + height: 12%; + padding: 0 2em; +} +.wpeo-modal .modal-container .modal-header .modal-title, .wpeo-modal .modal-container .modal-header .modal-close { + margin: auto 0; +} +.wpeo-modal .modal-container .modal-header .modal-title { + text-transform: uppercase; + font-size: 18px; + white-space: normal; +} +@media (max-width: 770px) { + .wpeo-modal .modal-container .modal-header .modal-title { + font-size: 16px; + } +} +@media (max-width: 480px) { + .wpeo-modal .modal-container .modal-header .modal-title { + font-size: 14px; + } +} +.wpeo-modal .modal-container .modal-header .modal-close { + margin-left: auto; + color: rgba(0, 0, 0, 0.3); + padding: 4px; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.wpeo-modal .modal-container .modal-header .modal-close:hover { + cursor: pointer; + color: #0d8aff; +} +.wpeo-modal .modal-container .modal-content { + overflow-y: auto; + font-size: 14px; +} +@media (max-width: 480px) { + .wpeo-modal .modal-container .modal-content { + font-size: 12px; + } +} +.wpeo-modal .modal-container .modal-footer { + text-align: right; + padding-top: 1em; +} +.wpeo-modal .modal-container .modal-footer.left { + text-align: left; +} +.wpeo-modal .modal-container .modal-footer.center { + text-align: center; +} + +/*-------------------------------------------------------------- + Module : Loader + Version : 1.0.0 + + .wpeo-loader => classe de base pour le module + .loader-spin => icone de chargement +--------------------------------------------------------------*/ +.wpeo-loader { + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + pointer-events: none; + opacity: 0.5; + position: relative; +} +.wpeo-loader .loader-spin { + position: absolute; + border: 3px solid #a7a7a7; + border-top: 3px solid #002140; + border-radius: 50%; + width: 20px; + height: 20px; + z-index: 99; + left: 50%; + top: 50%; + margin: 0 !important; + padding: 0 !important; + -webkit-animation: loader-spin 1s ease-out infinite; + animation: loader-spin 1s ease-out infinite; +} + +@-webkit-keyframes loader-spin { + 0% { + -webkit-transform: translate(-50%, -50%) rotate(0deg); + transform: translate(-50%, -50%) rotate(0deg); + } + 100% { + -webkit-transform: translate(-50%, -50%) rotate(360deg); + transform: translate(-50%, -50%) rotate(360deg); + } +} + +@keyframes loader-spin { + 0% { + -webkit-transform: translate(-50%, -50%) rotate(0deg); + transform: translate(-50%, -50%) rotate(0deg); + } + 100% { + -webkit-transform: translate(-50%, -50%) rotate(360deg); + transform: translate(-50%, -50%) rotate(360deg); + } +} +/*-------------------------------------------------------------- + Module : Gridlayout + Version : 1.5.0 + + * Classes pour l'élément parent + .wpeo-gridlayout -> classe de base du mobule + .grid-X -> Définit le nombre de colonnes + .grid-margin-X -> Ajoute des marges au dessus et en dessous du parent + .grid-gap-X -> Définit les gouttières des colonnes + + * Classes pour les enfants direct + .gridw-X -> Change la largeur du bloc enfant (gridw-2 = 2 fois la taille initiale) + .gridh-X -> Change la hauteur du bloc enfant (gridh-2 = 2 fois la taille initiale) +--------------------------------------------------------------*/ +.wpeo-gridlayout { + display: grid; + grid-gap: 1em 1em; + grid-template-columns: repeat(4, 1fr); +} + +/** Définition des tailles */ +.wpeo-gridlayout { + /** Du parent */ + /** Chaque enfant peut modifier sa propre taille */ + /** Chaque enfant peut modifier sa propre taille */ + /** Chaque enfant peut modifier sa propre taille */ + /** Chaque enfant peut modifier sa propre taille */ + /** Chaque enfant peut modifier sa propre taille */ + /** Chaque enfant peut modifier sa propre taille */ +} +.wpeo-gridlayout.grid-1 { + grid-template-columns: repeat(1, 1fr); +} +.wpeo-gridlayout.grid-1 > .gridw-1 { + grid-column: auto/span 1; +} +.wpeo-gridlayout.grid-2 { + grid-template-columns: repeat(2, 1fr); +} +.wpeo-gridlayout.grid-2 > .gridw-1 { + grid-column: auto/span 1; +} +.wpeo-gridlayout.grid-2 > .gridw-2 { + grid-column: auto/span 2; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-2 > .gridw-2 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-3 { + grid-template-columns: repeat(3, 1fr); +} +.wpeo-gridlayout.grid-3 > .gridw-1 { + grid-column: auto/span 1; +} +.wpeo-gridlayout.grid-3 > .gridw-2 { + grid-column: auto/span 2; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-3 > .gridw-2 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-3 > .gridw-3 { + grid-column: auto/span 3; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-3 > .gridw-3 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-4 { + grid-template-columns: repeat(4, 1fr); +} +.wpeo-gridlayout.grid-4 > .gridw-1 { + grid-column: auto/span 1; +} +.wpeo-gridlayout.grid-4 > .gridw-2 { + grid-column: auto/span 2; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-4 > .gridw-2 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-4 > .gridw-3 { + grid-column: auto/span 3; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-4 > .gridw-3 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-4 > .gridw-4 { + grid-column: auto/span 4; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-4 > .gridw-4 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-5 { + grid-template-columns: repeat(5, 1fr); +} +.wpeo-gridlayout.grid-5 > .gridw-1 { + grid-column: auto/span 1; +} +.wpeo-gridlayout.grid-5 > .gridw-2 { + grid-column: auto/span 2; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-5 > .gridw-2 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-5 > .gridw-3 { + grid-column: auto/span 3; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-5 > .gridw-3 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-5 > .gridw-4 { + grid-column: auto/span 4; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-5 > .gridw-4 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-5 > .gridw-5 { + grid-column: auto/span 5; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-5 > .gridw-5 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-6 { + grid-template-columns: repeat(6, 1fr); +} +.wpeo-gridlayout.grid-6 > .gridw-1 { + grid-column: auto/span 1; +} +.wpeo-gridlayout.grid-6 > .gridw-2 { + grid-column: auto/span 2; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-6 > .gridw-2 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-6 > .gridw-3 { + grid-column: auto/span 3; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-6 > .gridw-3 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-6 > .gridw-4 { + grid-column: auto/span 4; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-6 > .gridw-4 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-6 > .gridw-5 { + grid-column: auto/span 5; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-6 > .gridw-5 { + grid-column: auto/span 2; + } +} +.wpeo-gridlayout.grid-6 > .gridw-6 { + grid-column: auto/span 6; +} +@media (max-width: 770px) { + .wpeo-gridlayout.grid-6 > .gridw-6 { + grid-column: auto/span 2; + } +} + +/** Définition des hauteur des enfants */ +.wpeo-gridlayout > .gridh-1 { + grid-row: auto/span 1; +} +@media (max-width: 770px) { + .wpeo-gridlayout > .gridh-1 { + grid-row: auto/span 1 !important; + } +} +.wpeo-gridlayout > .gridh-2 { + grid-row: auto/span 2; +} +@media (max-width: 770px) { + .wpeo-gridlayout > .gridh-2 { + grid-row: auto/span 1 !important; + } +} +.wpeo-gridlayout > .gridh-3 { + grid-row: auto/span 3; +} +@media (max-width: 770px) { + .wpeo-gridlayout > .gridh-3 { + grid-row: auto/span 1 !important; + } +} +.wpeo-gridlayout > .gridh-4 { + grid-row: auto/span 4; +} +@media (max-width: 770px) { + .wpeo-gridlayout > .gridh-4 { + grid-row: auto/span 1 !important; + } +} +.wpeo-gridlayout > .gridh-5 { + grid-row: auto/span 5; +} +@media (max-width: 770px) { + .wpeo-gridlayout > .gridh-5 { + grid-row: auto/span 1 !important; + } +} +.wpeo-gridlayout > .gridh-6 { + grid-row: auto/span 6; +} +@media (max-width: 770px) { + .wpeo-gridlayout > .gridh-6 { + grid-row: auto/span 1 !important; + } +} + +/** Marges */ +.wpeo-gridlayout.grid-margin-0 { + margin: 0em 0; +} +.wpeo-gridlayout.grid-margin-1 { + margin: 1em 0; +} +.wpeo-gridlayout.grid-margin-2 { + margin: 2em 0; +} +.wpeo-gridlayout.grid-margin-3 { + margin: 3em 0; +} +.wpeo-gridlayout.grid-margin-4 { + margin: 4em 0; +} +.wpeo-gridlayout.grid-margin-5 { + margin: 5em 0; +} +.wpeo-gridlayout.grid-margin-6 { + margin: 6em 0; +} + +/** Gouttières */ +.wpeo-gridlayout.grid-gap-0 { + grid-gap: 0em 0em; +} +.wpeo-gridlayout.grid-gap-1 { + grid-gap: 1em 1em; +} +.wpeo-gridlayout.grid-gap-2 { + grid-gap: 2em 2em; +} +.wpeo-gridlayout.grid-gap-3 { + grid-gap: 3em 3em; +} +.wpeo-gridlayout.grid-gap-4 { + grid-gap: 4em 4em; +} +.wpeo-gridlayout.grid-gap-5 { + grid-gap: 5em 5em; +} +.wpeo-gridlayout.grid-gap-6 { + grid-gap: 6em 6em; +} + +/** Alignements */ +.wpeo-gridlayout .grid-align-center { + margin-left: auto; + margin-right: auto; +} +.wpeo-gridlayout .grid-align-right { + margin-left: auto; +} +.wpeo-gridlayout .grid-align-middle { + margin-top: auto; + margin-bottom: auto; +} +.wpeo-gridlayout .grid-align-bottom { + margin-top: auto; +} + +/** Media queries */ +@media (max-width: 480px) { + .wpeo-gridlayout:not(.dropdown-content).grid-2 { + grid-template-columns: repeat(1, 1fr) !important; + } +} +@media (max-width: 770px) { + .wpeo-gridlayout:not(.dropdown-content).grid-3 { + grid-template-columns: repeat(2, 1fr) !important; + } +} +@media (max-width: 480px) { + .wpeo-gridlayout:not(.dropdown-content).grid-3 { + grid-template-columns: repeat(1, 1fr) !important; + } +} +@media (max-width: 770px) { + .wpeo-gridlayout:not(.dropdown-content).grid-4 { + grid-template-columns: repeat(2, 1fr) !important; + } +} +@media (max-width: 480px) { + .wpeo-gridlayout:not(.dropdown-content).grid-4 { + grid-template-columns: repeat(1, 1fr) !important; + } +} +@media (max-width: 770px) { + .wpeo-gridlayout:not(.dropdown-content).grid-5 { + grid-template-columns: repeat(2, 1fr) !important; + } +} +@media (max-width: 480px) { + .wpeo-gridlayout:not(.dropdown-content).grid-5 { + grid-template-columns: repeat(1, 1fr) !important; + } +} +@media (max-width: 770px) { + .wpeo-gridlayout:not(.dropdown-content).grid-6 { + grid-template-columns: repeat(2, 1fr) !important; + } +} +@media (max-width: 480px) { + .wpeo-gridlayout:not(.dropdown-content).grid-6 { + grid-template-columns: repeat(1, 1fr) !important; + } +} +@media (max-width: 480px) { + .wpeo-gridlayout:not(.dropdown-content) > * { + grid-column: auto/span 1 !important; + } +} + +/*-------------------------------------------------------------- + Module : Table + Version : 1.0.0 + .wpeo-table -> classe de base du mobule +--------------------------------------------------------------*/ +/*-------------------------------------------------------------- + Table Flex + + .table-25 : max-width: 25px + .table-50 : max-width: 50px + .table-75 : max-width: 75px + .table-100 : max-width: 100px + ... + .table-500 : max-width: 500px; + + .table-end : Utiliser la classe table-end justifie la cellule sur la droite + .table-padding-0 : Enleve les marges internes d’une cellule +--------------------------------------------------------------*/ +.wpeo-table.table-flex { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + font-size: 14px; +} + +/** Ligne */ +.wpeo-table.table-flex .table-row { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; +} +.wpeo-table.table-flex .table-row:not(.table-header):nth-of-type(odd) { + background: rgba(0, 0, 0, 0.05); +} + +/** Ligne entete */ +.wpeo-table.table-flex .table-row.table-header { + background: #263C5C; +} +.wpeo-table.table-flex .table-row.table-header .table-cell { + font-weight: 700; + color: #fff; +} + +/** Cellule */ +.wpeo-table.table-flex .table-cell { + margin: auto 0; + width: 100%; + padding: 0.8em 0.6em; +} +@media (max-width: 770px) { + .wpeo-table.table-flex .table-cell { + padding: 0.4em; + } +} + +/** Taille générale des cellules */ +.wpeo-table.table-flex.table-1 .table-cell { + width: 100%; +} +.wpeo-table.table-flex.table-2 .table-cell { + width: 50%; +} +.wpeo-table.table-flex.table-3 .table-cell { + width: 33.3333333333%; +} +.wpeo-table.table-flex.table-4 .table-cell { + width: 25%; +} +.wpeo-table.table-flex.table-5 .table-cell { + width: 20%; +} +.wpeo-table.table-flex.table-6 .table-cell { + width: 16.6666666667%; +} +.wpeo-table.table-flex.table-7 .table-cell { + width: 14.2857142857%; +} +.wpeo-table.table-flex.table-8 .table-cell { + width: 12.5%; +} +.wpeo-table.table-flex.table-9 .table-cell { + width: 11.1111111111%; +} +.wpeo-table.table-flex.table-10 .table-cell { + width: 10%; +} + +/** Taille spécifiques des cellules */ +.wpeo-table.table-flex .table-cell.table-25 { + max-width: 25px; + min-width: 25px; +} +.wpeo-table.table-flex .table-cell.table-50 { + max-width: 50px; + min-width: 50px; +} +.wpeo-table.table-flex .table-cell.table-75 { + max-width: 75px; + min-width: 75px; +} +.wpeo-table.table-flex .table-cell.table-100 { + max-width: 100px; + min-width: 100px; +} +.wpeo-table.table-flex .table-cell.table-125 { + max-width: 125px; + min-width: 125px; +} +.wpeo-table.table-flex .table-cell.table-150 { + max-width: 150px; + min-width: 150px; +} +.wpeo-table.table-flex .table-cell.table-175 { + max-width: 175px; + min-width: 175px; +} +.wpeo-table.table-flex .table-cell.table-200 { + max-width: 200px; + min-width: 200px; +} +.wpeo-table.table-flex .table-cell.table-225 { + max-width: 225px; + min-width: 225px; +} +.wpeo-table.table-flex .table-cell.table-250 { + max-width: 250px; + min-width: 250px; +} +.wpeo-table.table-flex .table-cell.table-275 { + max-width: 275px; + min-width: 275px; +} +.wpeo-table.table-flex .table-cell.table-300 { + max-width: 300px; + min-width: 300px; +} +.wpeo-table.table-flex .table-cell.table-325 { + max-width: 325px; + min-width: 325px; +} +.wpeo-table.table-flex .table-cell.table-350 { + max-width: 350px; + min-width: 350px; +} +.wpeo-table.table-flex .table-cell.table-375 { + max-width: 375px; + min-width: 375px; +} +.wpeo-table.table-flex .table-cell.table-400 { + max-width: 400px; + min-width: 400px; +} +.wpeo-table.table-flex .table-cell.table-425 { + max-width: 425px; + min-width: 425px; +} +.wpeo-table.table-flex .table-cell.table-450 { + max-width: 450px; + min-width: 450px; +} +.wpeo-table.table-flex .table-cell.table-475 { + max-width: 475px; + min-width: 475px; +} +.wpeo-table.table-flex .table-cell.table-500 { + max-width: 500px; + min-width: 500px; +} +.wpeo-table.table-flex .table-cell.table-full { + width: 100%; +} + +/** Différentes classes */ +.wpeo-table.table-flex .table-cell.table-end { + text-align: right; + margin-left: auto; +} +.wpeo-table.table-flex .table-cell.table-padding-0 { + padding: 0; +} + +/** Responsive mobile */ +@media (max-width: 480px) { + .wpeo-table.table-flex .table-row { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; + } + .wpeo-table.table-flex .table-cell { + width: 100%; + } +} +/*-------------------------------------------------------------- + Module : Tooltip + Version : 1.0.0 + + .wpeo-tooltip -> classe de base du mobule + .tooltip-primary -> tooltip sur fond rouge + .tooltip-light -> tooltip sur fond rouge + .tooltip-red -> tooltip sur fond rouge +--------------------------------------------------------------*/ +.wpeo-tooltip { + display: block; + position: absolute; + bottom: 0; + left: 0; + opacity: 0; + pointer-events: none; + z-index: 99999; + white-space: nowrap; + background: #2b2b2b; + color: #fff; + border-radius: 6px; + font-size: 0.8rem; + padding: 0 1em; + height: 2.2em; + line-height: 2.2em; +} +.wpeo-tooltip::before { + display: block; + content: ""; + width: 0; + height: 0; + border-style: solid; + position: absolute; +} +.wpeo-tooltip:focus { + outline: none; +} + +/* Couleurs */ +.wpeo-tooltip.tooltip-dark { + background: #2b2b2b; +} +.wpeo-tooltip.tooltip-dark.tooltip-top::before { + border-color: #2b2b2b transparent transparent transparent; +} +.wpeo-tooltip.tooltip-dark.tooltip-right::before { + border-color: transparent #2b2b2b transparent transparent; +} +.wpeo-tooltip.tooltip-dark.tooltip-bottom::before { + border-color: transparent transparent #2b2b2b transparent; +} +.wpeo-tooltip.tooltip-dark.tooltip-left::before { + border-color: transparent transparent transparent #2b2b2b; +} +.wpeo-tooltip.tooltip-primary { + background: #0d8aff; +} +.wpeo-tooltip.tooltip-primary.tooltip-top::before { + border-color: #0d8aff transparent transparent transparent; +} +.wpeo-tooltip.tooltip-primary.tooltip-right::before { + border-color: transparent #0d8aff transparent transparent; +} +.wpeo-tooltip.tooltip-primary.tooltip-bottom::before { + border-color: transparent transparent #0d8aff transparent; +} +.wpeo-tooltip.tooltip-primary.tooltip-left::before { + border-color: transparent transparent transparent #0d8aff; +} +.wpeo-tooltip.tooltip-light { + background: #ececec; + color: rgba(0, 0, 0, 0.6); +} +.wpeo-tooltip.tooltip-light.tooltip-top::before { + border-color: #ececec transparent transparent transparent; +} +.wpeo-tooltip.tooltip-light.tooltip-right::before { + border-color: transparent #ececec transparent transparent; +} +.wpeo-tooltip.tooltip-light.tooltip-bottom::before { + border-color: transparent transparent #ececec transparent; +} +.wpeo-tooltip.tooltip-light.tooltip-left::before { + border-color: transparent transparent transparent #ececec; +} +.wpeo-tooltip.tooltip-red { + background: #e05353; +} +.wpeo-tooltip.tooltip-red.tooltip-top::before { + border-color: #e05353 transparent transparent transparent; +} +.wpeo-tooltip.tooltip-red.tooltip-right::before { + border-color: transparent #e05353 transparent transparent; +} +.wpeo-tooltip.tooltip-red.tooltip-bottom::before { + border-color: transparent transparent #e05353 transparent; +} +.wpeo-tooltip.tooltip-red.tooltip-left::before { + border-color: transparent transparent transparent #e05353; +} + +/* Position de la fleche */ +.wpeo-tooltip.tooltip-top::before { + border-width: 6px 6px 0 6px; + border-color: #2b2b2b transparent transparent transparent; + bottom: -6px; + left: 50%; + -webkit-transform: translateX(-50%); + transform: translateX(-50%); +} +.wpeo-tooltip.tooltip-right::before { + border-width: 6px 6px 6px 0; + border-color: transparent #2b2b2b transparent transparent; + top: 50%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + left: -6px; +} +.wpeo-tooltip.tooltip-bottom::before { + border-width: 0 6px 6px 6px; + border-color: transparent transparent #2b2b2b transparent; + top: -6px; + left: 50%; + -webkit-transform: translateX(-50%); + transform: translateX(-50%); +} +.wpeo-tooltip.tooltip-left::before { + border-width: 6px 0 6px 6px; + border-color: transparent transparent transparent #2b2b2b; + top: 50%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + right: -6px; +} + +/*-------------------------------------------------------------- + Module : Notice + Version : 1.0.0 + + .wpeo-notice -> classe de base du mobule +--------------------------------------------------------------*/ +/* General */ +.wpeo-notice { + position: relative; + font-size: 1em; + padding: 1em; + overflow: hidden; + border-radius: 3px; + border: solid #eee 1px; + margin: 1em 0; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} +.wpeo-notice::before { + display: block; + font-family: "Font Awesome 5 Free"; + font-weight: 900; + font-size: 24px; +} +.wpeo-notice .notice-content { + width: 100%; + padding: 0 1em; + color: rgba(0, 0, 0, 0.6); +} +.wpeo-notice .notice-title { + font-size: 20px; + font-weight: 600; + color: rgba(0, 0, 0, 0.9); +} +.wpeo-notice .notice-subtitle { + font-size: 14px; +} +.wpeo-notice .notice-close { + color: rgba(0, 0, 0, 0.3); + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.wpeo-notice .notice-close:hover { + color: #0d8aff; + cursor: pointer; +} +.wpeo-notice ul { + padding: 0 0 0 1.4em; + margin: 0.4em 0; +} + +/** Status */ +/** Info */ +.wpeo-notice.notice-info { + border-left: solid #0d8aff 6px; + color: #0d8aff; + background: rgba(13, 138, 255, 0.05); +} +.wpeo-notice.notice-info::before { + content: "\f05a"; +} +.wpeo-notice.notice-info .notice-title, .wpeo-notice.notice-info .notice-subtitle, .wpeo-notice.notice-info a { + color: #0d8aff; +} + +/** Error */ +.wpeo-notice.notice-error { + border-left: solid #e05353 6px; + color: #e05353; + background: rgba(224, 83, 83, 0.05); +} +.wpeo-notice.notice-error::before { + content: "\f057"; +} +.wpeo-notice.notice-error .notice-title, .wpeo-notice.notice-error .notice-subtitle, .wpeo-notice.notice-error a { + color: #e05353; +} + +/** Warning */ +.wpeo-notice.notice-warning { + border-left: solid #e9ad4f 6px; + color: #e9ad4f; + background: rgba(233, 173, 79, 0.05); +} +.wpeo-notice.notice-warning::before { + content: "\f071"; +} +.wpeo-notice.notice-warning .notice-title, .wpeo-notice.notice-warning .notice-subtitle, .wpeo-notice.notice-warning a { + color: #e9ad4f; +} + +/** Success */ +.wpeo-notice.notice-success { + border-left: solid #47e58e 6px; + color: #47e58e; + background: rgba(71, 229, 142, 0.05); +} +.wpeo-notice.notice-success::before { + content: "\f058"; +} +.wpeo-notice.notice-success .notice-title, .wpeo-notice.notice-success .notice-subtitle, .wpeo-notice.notice-success a { + color: #47e58e; +} + +.tns-outer { + position: relative; +} + +.tns-outer .tns-nav { + text-align: center; + position: absolute; + width: 100%; + bottom: 0.5em; + z-index: 50; +} +.tns-outer .tns-nav button { + display: inline-block; + margin: 0 4px; + padding: 0; + width: 15px; + height: 15px; + background: #fff; + border-radius: 50%; + -webkit-box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.2); + box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.2); + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + border: 2px solid #fff; +} +.tns-outer .tns-nav button:hover { + -webkit-box-shadow: none; + box-shadow: none; +} +.tns-outer .tns-nav button.tns-nav-active { + border: 2px solid #0d8aff; + -webkit-box-shadow: 0px 0px 0px 2px #0d8aff; + box-shadow: 0px 0px 0px 2px #0d8aff; +} + +.tns-outer .tns-controls button[data-controls=prev], .tns-outer .tns-controls button[data-controls=next] { + position: absolute; + top: 50%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); + background: none; + padding: 0; + border: 0; + z-index: 60; +} +.tns-outer .tns-controls button[data-controls=prev] .icon, .tns-outer .tns-controls button[data-controls=next] .icon { + color: #3a3a3a; + background: #fff; + border-radius: 50%; + width: 28px; + height: 28px; + text-align: center; + line-height: 28px; + opacity: 0.7; + -webkit-transition: opacity 0.3s cubic-bezier(0.77, 0, 0.175, 1); + transition: opacity 0.3s cubic-bezier(0.77, 0, 0.175, 1); +} +.tns-outer .tns-controls button[data-controls=prev]:hover, .tns-outer .tns-controls button[data-controls=next]:hover { + -webkit-box-shadow: none; + box-shadow: none; +} +.tns-outer .tns-controls button[data-controls=prev]:hover .icon, .tns-outer .tns-controls button[data-controls=next]:hover .icon { + opacity: 1; +} +.tns-outer .tns-controls button[data-controls=prev]:active .icon, .tns-outer .tns-controls button[data-controls=next]:active .icon { + -webkit-transform: translateY(2px); + transform: translateY(2px); +} +.tns-outer .tns-controls button[data-controls=prev][disabled] .icon, .tns-outer .tns-controls button[data-controls=next][disabled] .icon { + opacity: 0.2; +} +.tns-outer .tns-controls button[data-controls=prev][disabled]:active .icon, .tns-outer .tns-controls button[data-controls=next][disabled]:active .icon { + -webkit-transform: none; + transform: none; +} +.tns-outer .tns-controls button[data-controls=prev] { + left: 15px; +} +.tns-outer .tns-controls button[data-controls=next] { + right: 15px; +} + +/*-------------------------------------------------------------- + Module : Form + Version : 1.0.0 + --------------------------------------------------------------*/ +/** Reset des champs de base */ +.wpeo-form input, .wpeo-form textarea, .wpeo-form select { + border: 1px solid rgba(0, 0, 0, 0.2); + font-size: 14px; + background: transparent; + padding: 0; + margin: 0; + width: 100%; + padding: 1em 0.5em; + -webkit-box-shadow: none; + box-shadow: none; +} +.wpeo-form input:focus, .wpeo-form input:active, .wpeo-form textarea:focus, .wpeo-form textarea:active, .wpeo-form select:focus, .wpeo-form select:active { + outline: none; + -webkit-box-shadow: none; + box-shadow: none; +} +.wpeo-form select { + padding: 1em 0; +} +.wpeo-form input[type=submit] { + width: auto; +} + +/** compatibilité Date */ +.wpeo-form .group-date .mysql-date { + display: none; +} + +/* Compatibility Dropdown */ +.wpeo-form .wpeo-dropdown { + display: block; + width: 100%; +} +.wpeo-form .wpeo-dropdown .dropdown-toggle { + width: 100%; + display: block; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + border: 0; + font-size: 14px; + padding: 1em 2em 1em 1em; + margin: 0; +} +.wpeo-form .wpeo-dropdown .dropdown-toggle:hover { + cursor: pointer; +} +.wpeo-form .wpeo-dropdown .dropdown-toggle > .svg-inline--fa { + position: absolute; + right: 1em; + top: 50%; + -webkit-transform: translateY(-50%); + transform: translateY(-50%); +} + +.wpeo-form .form-element.disable .dropdown-toggle > .svg-inline--fa { + display: none; +} + +/* Compatibility Autocomplete */ +.wpeo-form .wpeo-autocomplete { + display: block; + width: 100%; +} +.wpeo-form .wpeo-autocomplete .autocomplete-label { + -webkit-box-shadow: none; + box-shadow: none; + padding: 0.74em 1em; +} + +.wpeo-form.form-light .wpeo-autocomplete .autocomplete-label { + background: #fff; +} +.wpeo-form.form-light .wpeo-autocomplete .autocomplete-label:hover { + background: #ececec; +} + +/** Général */ +.wpeo-form .form-element input[type=radio].form-field { + display: inline-block; + width: auto; +} + +/** Design */ +.wpeo-form .form-element input[type=radio].form-field { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + border-radius: 50%; + width: 16px; + height: 16px; + padding: 0; + border: 0; + background: transparent !important; + border: 1px solid rgba(0, 0, 0, 0.4); + -webkit-transition: 0.2s all linear; + transition: 0.2s all linear; + outline: none; + position: relative; + top: 2px; +} +.wpeo-form .form-element input[type=radio].form-field::before { + display: none !important; + content: "" !important; +} +.wpeo-form .form-element input[type=radio].form-field:hover { + cursor: pointer; + border: 1px solid #0d8aff; + -webkit-box-shadow: 0 0 0 1px #0d8aff inset; + box-shadow: 0 0 0 1px #0d8aff inset; + background: transparent !important; +} +.wpeo-form .form-element input[type=radio].form-field:checked { + border: 1px solid #0d8aff; + -webkit-box-shadow: 0 0 0 4px #0d8aff inset; + box-shadow: 0 0 0 4px #0d8aff inset; +} +.wpeo-form .form-element input[type=radio].form-field + label { + text-transform: none; + font-weight: 400; + font-size: 14px; + display: inline-block; + margin-right: 1em; +} +.wpeo-form .form-element input[type=radio].form-field + label:hover { + cursor: pointer; +} +.wpeo-form .form-element input[type=radio].form-field + label:active { + outline: none; +} + +/** Général */ +.wpeo-form .form-element input[type=checkbox].form-field { + display: inline-block; + width: auto; +} + +/** Design */ +.wpeo-form .form-element input[type=checkbox].form-field { + width: auto; + visibility: hidden; + display: none; +} +.wpeo-form .form-element input[type=checkbox].form-field + label { + text-transform: none; + font-weight: 400; + font-size: 14px; + display: inline-block; + margin-right: 1em; + position: relative; +} +.wpeo-form .form-element input[type=checkbox].form-field + label:hover { + cursor: pointer; +} +.wpeo-form .form-element input[type=checkbox].form-field + label:active { + outline: none; +} +.wpeo-form .form-element input[type=checkbox].form-field + label::before { + display: inline-block; + content: ""; + width: 14px; + height: 14px; + background: transparent; + -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); + border: 2px solid #fff; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + margin-right: 0.6em; +} +.wpeo-form .form-element input[type=checkbox].form-field:not(:checked) + label:hover::before { + -webkit-box-shadow: 0 0 0 2px #0d8aff; + box-shadow: 0 0 0 2px #0d8aff; +} +.wpeo-form .form-element input[type=checkbox].form-field:checked + label::before { + -webkit-box-shadow: 0 0 0 2px #0d8aff; + box-shadow: 0 0 0 2px #0d8aff; + background: #0d8aff; +} + +/** Formulaire design */ +.wpeo-form .form-element { + width: 100%; +} +.wpeo-form .form-element .form-label { + display: block; + font-size: 14px; + font-weight: 600; + margin: 0.6em 0; + color: rgba(0, 0, 0, 0.9); +} +.wpeo-form .form-element .form-field-container { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + -webkit-box-flex: 0; + -ms-flex: 0 1 auto; + flex: 0 1 auto; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; +} +.wpeo-form .form-element .form-field-container:hover { + -webkit-box-shadow: none; + box-shadow: none; +} +.wpeo-form .form-element .form-field { + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + border-radius: 0; +} +.wpeo-form .form-element .form-field:hover { + -webkit-box-shadow: none; + box-shadow: none; +} +.wpeo-form .form-element .form-sublabel { + font-size: 12px; + font-style: italic; + color: rgba(0, 0, 0, 0.6); +} + +/** Alignement */ +.wpeo-form .form-element .form-field-inline { + margin-right: 0.4em; +} +.wpeo-form .form-element.form-align-vertical .form-field-container { + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -ms-flex-direction: column; + flex-direction: column; +} +.wpeo-form .form-element.form-align-horizontal .form-field-container { + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} + +/** Couleur */ +.wpeo-form .form-element .form-field-container .form-field, .wpeo-form .form-element .form-field-container [class*=form-field-icon] { + background: #ececec; +} +.wpeo-form .form-element .form-field-container:hover .form-field, .wpeo-form .form-element .form-field-container:hover [class*=form-field-icon] { + background: #dfdfdf; +} +.wpeo-form .form-element [class*=form-field-label] { + background: #dfdfdf; +} + +.wpeo-form.form-light .form-element .form-field-container .form-field, .wpeo-form.form-light .form-element .form-field-container [class*=form-field-icon] { + background: #fff; +} +.wpeo-form.form-light .form-element .form-field-container:hover .form-field, .wpeo-form.form-light .form-element .form-field-container:hover [class*=form-field-icon] { + background: #ececec; +} +.wpeo-form.form-light .form-element [class*=form-field-label] { + background: #ececec; +} + +/** Icone */ +.wpeo-form .form-element [class*=form-field-icon] { + padding: 0.8em 0 0.8em 0.8em; + color: rgba(0, 0, 0, 0.4); + font-size: 16px; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.wpeo-form .form-element [class*=form-field-icon] [class*=fa] { + vertical-align: middle; +} +.wpeo-form .form-element .form-field-icon-prev { + padding: 0.8em 0 0.8em 0.8em; +} +.wpeo-form .form-element .form-field-icon-next { + padding: 0.8em 0.8em 0.8em 0; +} + +/** Previous & next label */ +.wpeo-form .form-element [class*=form-field-label] { + padding: 1.2em 1em; + font-size: 12px; +} +.wpeo-form .form-element .form-field-label-prev { + border-right: 1px solid rgba(0, 0, 0, 0.1); +} +.wpeo-form .form-element .form-field-label-next { + border-left: 1px solid rgba(0, 0, 0, 0.1); +} + +/** Required */ +.wpeo-form .form-element.form-element-required .form-label::after { + display: inline-block; + content: "*"; + color: #e05353; + padding: 0 0.4em; +} + +/** Erreur sur un champs */ +.wpeo-form .form-element.form-element-error .form-field-container { + border: 1px solid #e05353; +} + +/** Champs disabled */ +.wpeo-form .form-element.form-element-disable .form-field-container { + opacity: 0.6; + pointer-events: none; +} + +/* Simple */ +/* Moderne */ +.page-ut-gp-list { + margin-left: -30px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + display: block !important; + width: 100%; +} +.page-ut-gp-list * { + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.page-ut-gp-list .fiche { + margin-right: 0 !important; +} + +/** Screen */ +.page-ut-gp-list #id-right { + padding-left: 300px; + width: calc(100% + 30px); + display: block; +} + +/** UT / GP Navigation */ +.page-ut-gp-list .side-nav { + position: absolute; + height: 100%; + top: 0; + padding-top: 50px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + -webkit-box-shadow: none; + box-shadow: none; +} +.page-ut-gp-list .side-nav .side-nav-responsive { + display: none; +} +.page-ut-gp-list .side-nav #id-left { + width: 300px; + padding-top: 0; +} +.page-ut-gp-list .side-nav .digirisk-wrap { + padding: 0 !important; +} +.page-ut-gp-list .side-nav .navigation-container { + max-height: 1000px; + overflow-y: auto; +} +.page-ut-gp-list .side-nav .add-container { + position: absolute; + right: 0; + bottom: 5px; + opacity: 0; + pointer-events: none; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.page-ut-gp-list .side-nav #id-left.active .add-container { + opacity: 1; +} + +/** Header */ +.page-ut-gp-list .side-nav .society-header { + padding-top: 27px; + position: relative; + padding-left: 10px; + padding-right: 10px; +} +.page-ut-gp-list .side-nav .society-header .title { + font-weight: 700; +} +.page-ut-gp-list .side-nav .society-header .linkElement { + line-height: 1; + border-bottom: 1px solid rgba(0, 0, 0, 0.2); + padding-bottom: 10px; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + width: 100%; +} +.page-ut-gp-list .side-nav .society-header:hover .add-container { + opacity: 1; + pointer-events: all; +} + +/** Toolbar */ +.page-ut-gp-list .side-nav .toolbar { + padding-left: 10px; + padding-right: 10px; +} +.page-ut-gp-list .side-nav .toolbar .toggle-plus, .page-ut-gp-list .side-nav .toolbar .toggle-minus { + display: inline-block; + padding: 3px; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + color: rgba(0, 0, 0, 0.6); +} +.page-ut-gp-list .side-nav .toolbar .toggle-plus:hover, .page-ut-gp-list .side-nav .toolbar .toggle-minus:hover { + cursor: pointer; + opacity: 0.6; +} + +/** Content */ +.page-ut-gp-list .side-nav .workunit-list { + padding-left: 0; + /** Toggle */ +} +.page-ut-gp-list .side-nav .workunit-list ul, .page-ut-gp-list .side-nav .workunit-list li { + list-style-type: none; + margin: 0; +} +.page-ut-gp-list .side-nav .workunit-list > .unit:first-child > .unit-container:first-child > .title { + border-top: 1px solid rgba(0, 0, 0, 0.1); +} +.page-ut-gp-list .side-nav .workunit-list .unit-container { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + position: relative; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container:hover .add-container { + opacity: 1; + pointer-events: all; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .toggle-unit { + color: rgba(0, 0, 0, 0.6); + line-height: 40px; + font-size: 18px; + min-width: 30px; + width: 30px; + text-align: center; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .toggle-unit:hover { + cursor: pointer; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .toggle-unit .toggle-icon { + line-height: 40px; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .spacer { + position: relative; + min-width: 30px; + width: 30px; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .spacer::before { + display: block; + position: absolute; + content: ""; + height: 1px; + left: 0; + right: 10px; + top: 20px; + background: rgba(0, 0, 0, 0.3); +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .photodigiriskdolibarr { + display: block; + width: 40px; + min-width: 40px; + height: 40px; + position: relative; + background: #fff; + text-align: center; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .divphotoref { + max-width: 50px; + position: relative; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .divphotoref .photo { + -o-object-fit: cover; + object-fit: cover; + margin: 0; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .title { + width: 100%; + padding-left: 1em; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + border-bottom: 1px solid rgba(0, 0, 0, 0.1); +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .title .linkElement { + width: 100%; + padding-top: 0.5em; + text-decoration: none; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .title .linkElement:hover .name { + color: #0d8aff; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .title .title-container { + margin: auto 0; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .title .ref { + font-size: 10px; + color: #fff; + text-transform: uppercase; + font-weight: 600; + display: inline-block; + background: #263C5C; + padding: 0.2em 0.4em; +} +.page-ut-gp-list .side-nav .workunit-list .unit-container .title .name { + font-size: 14px; + color: #000; + display: block; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.page-ut-gp-list .side-nav .workunit-list .unit > .sub-list { + padding: 0 0 0 7px; + display: none; +} +.page-ut-gp-list .side-nav .workunit-list .unit > .sub-list > .unit:last-child::before { + height: 24px; +} +.page-ut-gp-list .side-nav .workunit-list .unit > .sub-list .toggle-unit { + position: relative; +} +.page-ut-gp-list .side-nav .workunit-list .unit > .sub-list .toggle-unit::before { + right: 20px; + display: block; + position: absolute; + content: ""; + height: 1px; + left: 0; + top: 20px; + background: rgba(0, 0, 0, 0.3); +} +.page-ut-gp-list .side-nav .workunit-list .unit > .sub-list .unit { + position: relative; + margin-left: 0.6em; +} +.page-ut-gp-list .side-nav .workunit-list .unit > .sub-list .unit::before { + display: block; + position: absolute; + content: ""; + width: 1px; + height: 100%; + left: 0; + top: 0; + background: rgba(0, 0, 0, 0.3); +} +.page-ut-gp-list .side-nav .workunit-list .unit.active > .unit-container .title { + background: rgba(0, 0, 0, 0.1); +} +.page-ut-gp-list .side-nav .workunit-list .unit.active > .unit-container .title .name { + font-weight: 600; +} +.page-ut-gp-list .side-nav .workunit-list .unit.type-workunit .unit-container .ref { + background: #0d8aff; +} +.page-ut-gp-list .side-nav .workunit-list .unit.toggled > .sub-list { + display: block; +} + +.digirisk-signature-container { + max-width: 800px; + background: #fff; + -webkit-box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.1); + margin: 1.5em auto 0 auto; + padding: 2em; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.digirisk-signature-container * { + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.digirisk-signature-container .signature .signature-element .wpeo-button.modal-signature-open { + display: none; +} +.digirisk-signature-container .signature .signature-element img { + width: 100%; + height: auto; + border: 1px solid rgba(0, 0, 0, 0.4) !important; +} + +.ticketpublicarea .ticket-parentCategory { + width: 100%; + height: 100%; +} +.ticketpublicarea .ticket-parentCategory .wpeo-button { + width: 100%; + height: 100%; + padding: 12px 14px; +} +.ticketpublicarea .ticket-parentCategory .wpeo-button:hover { + -webkit-box-shadow: inset 0 -4.6em rgba(255, 255, 255, 0.25); + box-shadow: inset 0 -4.6em rgba(255, 255, 255, 0.25); +} +.ticketpublicarea .ticket-parentCategory .wpeo-button.button-yellow { + border-color: #e88740; + background: #e88740; +} +.ticketpublicarea .ticket-parentCategory .wpeo-button.button-blue { + border-color: #009cc2; + background: #009cc2; +} +.ticketpublicarea .ticket-parentCategory .wpeo-button.button-red { + border-color: #c44b2a; + background: #c44b2a; +} +.ticketpublicarea .ticket-parentCategory.active .wpeo-button { + border-color: #000 !important; +} +.ticketpublicarea .ticket-subCategory { + border: 1px solid rgba(0, 0, 0, 0.2); + padding: 1em; + text-align: center; + width: 100%; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.ticketpublicarea .ticket-subCategory:hover { + cursor: pointer; + background: rgba(0, 0, 0, 0.1); +} +.ticketpublicarea .ticket-subCategory.active { + -webkit-box-shadow: inset 0 0 0px 3px #0d8aff; + box-shadow: inset 0 0 0px 3px #0d8aff; +} +.ticketpublicarea .ticket-subCategory .button-label { + display: block; + margin-top: 0.5em; +} +.ticketpublicarea .form-registre .wpeo-button { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; +} +.ticketpublicarea .form-registre .wpeo-button > * { + margin-top: auto; + margin-bottom: auto; +} +.ticketpublicarea .form-registre .wpeo-button .button-label { + margin-left: 0.5em; +} +.ticketpublicarea .tableforinputfields { + margin-top: 1em; +} +.ticketpublicarea .tableforinputfields input { + display: block; + clear: both; + width: 100%; + max-width: none; + margin-bottom: 1em; +} +@media (max-width: 480px) { + .ticketpublicarea .tableforinputfields .inline-block { + display: block; + } +} +.ticketpublicarea .tableforinputfields .inline-block input { + display: inline-block; +} +.ticketpublicarea .tableforinputfields .inline-block #options_digiriskdolibarr_ticket_date { + max-width: 80px; +} + +/** UT / GP Organization */ +.page-ut-gp-list .organization { + position: absolute; + height: 100%; + top: 0; + padding-top: 50px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + -webkit-box-shadow: none; + box-shadow: none; +} + +.page-ut-gp-list .organization .side-nav-responsive { + display: none; +} + +.page-ut-gp-list .organization #id-left { + width: 300px; + padding-top: 0; +} + +.page-ut-gp-list .organization .digirisk-wrap { + padding: 0 !important; +} + +.page-ut-gp-list .organization .navigation-container { + max-height: 1000px; + overflow-y: auto; +} + +.page-ut-gp-list .organization .add-container { + position: absolute; + right: 0; + bottom: 5px; + opacity: 0; + pointer-events: none; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} + +/** Header */ +.page-ut-gp-list .organization .society-header { + padding-top: 27px; + position: relative; + padding-left: 10px; + padding-right: 10px; +} + +.page-ut-gp-list .organization .society-header .title { + font-weight: 700; +} + +.page-ut-gp-list .organization .society-header .linkElement { + line-height: 1; + border-bottom: 1px solid rgba(0, 0, 0, 0.2); + padding-bottom: 10px; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + width: 100%; +} + +.page-ut-gp-list .organization .society-header:hover .add-container { + opacity: 1; + pointer-events: all; +} + +/** Toolbar */ +.page-ut-gp-list .organization .toolbar { + padding-left: 10px; + padding-right: 10px; +} + +.page-ut-gp-list .organization .toolbar .toggle-plus, .page-ut-gp-list .organization .toolbar .toggle-minus { + display: inline-block; + padding: 3px; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + color: rgba(0, 0, 0, 0.6); +} + +.page-ut-gp-list .organization .toolbar .toggle-plus:hover, .page-ut-gp-list .organization .toolbar .toggle-minus:hover { + cursor: pointer; + opacity: 0.6; +} + +/** Content */ +.page-ut-gp-list .organization .workunit-list { + padding-left: 0; + /** Toggle */ +} + +.page-ut-gp-list .organization .workunit-list ul, .page-ut-gp-list .organization .workunit-list li { + list-style-type: none; + margin: 0; +} + +.page-ut-gp-list .organization .workunit-list .unit-container { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + position: relative; +} + +.page-ut-gp-list .organization .workunit-list .unit-container:hover .add-container { + opacity: 1; + pointer-events: all; +} + +.page-ut-gp-list .organization .workunit-list .unit-container .toggle-unit { + color: rgba(0, 0, 0, 0.6); + line-height: 40px; + font-size: 18px; + min-width: 30px; + width: 30px; + text-align: center; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} + +.page-ut-gp-list .organization .workunit-list .unit-container .toggle-unit:hover { + cursor: pointer; +} + +.page-ut-gp-list .organization .workunit-list .unit-container .toggle-unit .toggle-icon { + line-height: 40px; +} + +.page-ut-gp-list .organization .workunit-list .unit-container .spacer { + position: relative; + min-width: 30px; + width: 30px; +} + +.page-ut-gp-list .organization .workunit-list .unit-container .spacer::before { + display: block; + position: absolute; + content: ""; + height: 1px; + left: 0; + right: 10px; + top: 20px; + background: rgba(0, 0, 0, 0.3); +} + +.page-ut-gp-list .organization .workunit-list .unit-container .photodigiriskdolibarr { + display: block; + width: 40px; + min-width: 40px; + height: 40px; + position: relative; + background: #fff; + text-align: center; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} + +.page-ut-gp-list .organization .workunit-list .unit-container .title { + width: 100%; + padding-left: 1em; + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} + +.page-ut-gp-list .organization .workunit-list .unit-container .title .title-container { + margin: auto 0; +} + +.page-ut-gp-list .organization .workunit-list .unit-container .title .ref { + font-size: 10px; + color: #fff; + text-transform: uppercase; + font-weight: 600; + display: inline-block; + background: #263C5C; + padding: 0.2em 0.4em; +} + +.page-ut-gp-list .organization .workunit-list .unit-container .title .name { + font-size: 14px; + color: #000; + display: block; +} + +.page-ut-gp-list .organization .workunit-list .unit > .unit-container { + padding: 4px 0 0 0; + border: solid; +} + +.page-ut-gp-list .organization .workunit-list .unit > .sub-list { + padding: 0 0 0 7px; + display: none; +} + +.page-ut-gp-list .organization .workunit-list .unit > .sub-list > .unit:last-child::before { + height: 24px; +} + +.page-ut-gp-list .organization .workunit-list .unit > .sub-list .toggle-unit { + position: relative; +} + +.page-ut-gp-list .organization .workunit-list .unit > .sub-list .toggle-unit::before { + right: 20px; + display: block; + position: absolute; + content: ""; + height: 1px; + left: 0; + top: 20px; + background: rgba(0, 0, 0, 0.3); +} + +.page-ut-gp-list .organization .workunit-list .unit > .sub-list .unit { + position: relative; + margin-left: 0.6em; +} + +.page-ut-gp-list .organization .workunit-list .unit > .sub-list .unit::before { + display: block; + position: absolute; + content: ""; + width: 1px; + height: 100%; + left: 0; + top: 0; + background: rgba(0, 0, 0, 0.3); +} + +.page-ut-gp-list .organization .workunit-list .unit.active > .unit-container .title { + background: rgba(0, 0, 0, 0.1); +} + +.page-ut-gp-list .organization .workunit-list .unit.active > .unit-container .title .name { + font-weight: 600; +} + +.page-ut-gp-list .organization .workunit-list .unit.type-workunit .unit-container .ref { + background: #0d8aff; +} + +.page-ut-gp-list .organization .workunit-list .unit.toggled > .sub-list { + display: block; +} + +@media (max-width: 1200px) { + #id-container.page-ut-gp-list .organization { + position: static; + height: auto; + padding: 0 2em; + background: none; + border: 0; + } + #id-container.page-ut-gp-list .organization .side-nav-responsive { + display: block; + background: #263C5C; + color: #fff; + border-radius: 6px; + padding: 0.6em 1em; + font-weight: 600; + font-size: 14px; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + } + #id-container.page-ut-gp-list .organization .side-nav-responsive:hover { + cursor: pointer; + background: #446ba4; + } + #id-container.page-ut-gp-list .organization #id-left { + opacity: 0; + pointer-events: none; + position: absolute; + z-index: 999; + background: #efefef; + border: 1px solid rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.1); + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + -webkit-transform: translateY(-10px); + transform: translateY(-10px); + max-height: 500px; + overflow-y: auto; + } + #id-container.page-ut-gp-list .organization #id-left.active { + opacity: 1; + pointer-events: auto; + -webkit-transform: translateY(0px); + transform: translateY(0px); + } + #id-container.page-ut-gp-list #id-right { + padding-left: 0; + } +} +.container { + position: relative; + min-height: 500px; +} + +.container h3 { + position: absolute; + border: 0; + margin: 0; + padding: 20px 0; + width: 400px; + pointer-events: none; + margin-left: 0px; + width: 100%; +} + +.route { + position: relative; + list-style-type: none; + border: 0; + margin: 0; + padding: 0; + top: 0px; + margin-top: 0px; + max-height: 100% !important; + width: 100%; + background: #bcf; + border-radius: 2px; + z-index: -1; +} + +.route span { + position: absolute; + top: 26px; + left: 20px; + -webkit-transform: scale(2); + transform: scale(2); + z-index: 10; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.route span:hover { + cursor: pointer; + opacity: 0.6; +} + +.route .title { + font-size: 16px; +} +.route .title .ref { + position: static; + top: auto; + left: auto; + -webkit-transform: none; + transform: none; + font-size: 12px; + border-radius: 4px; + padding: 4px 6px; + margin-right: 0.8em; +} + +.route .title.workunit { + position: absolute; + border: 0; + margin: 0; + padding: 20px 0; + width: 400px; + text-indent: 60px; + background: #ebebeb; + border: 1px solid rgba(0, 0, 0, 0.2); + pointer-events: none; +} +.route .title.workunit > .ref { + background: #0d8aff; + color: #fff; +} + +.route .title.groupment { + position: absolute; + border: 0; + margin: 0; + width: 400px; + text-indent: 60px; + background: #ebebeb; + border: 1px solid rgba(0, 0, 0, 0.2); + pointer-events: none; +} +.route .title.groupment > .ref { + background: #263C5C; + color: #fff; +} + +.first-title { + margin-left: 10px; +} + +.space { + position: relative; + list-style-type: none; + border: 0; + margin: 0; + padding: 0; + margin-left: 40px; + width: 30px; + top: 68px; + padding-bottom: 68px; + height: 100%; + z-index: 1; +} +.space.space-0 { + margin-left: 0; +} + +/** Cell header */ +.table-cell-header { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; + margin-bottom: 0.5em; +} +.table-cell-header > * { + margin: auto 0; +} +.table-cell-header .wpeo-button { + margin: 0; +} + +.risk-container .risk-edit { + color: #263C5C; +} +.risk-container .risk-edit:hover { + cursor: pointer; + text-decoration: underline; +} + +.risk-container .risk-edit-no-perm { + color: #333333; +} +.risk-container .risk-edit-no-perm:hover { + cursor: auto; + text-decoration: none; +} + +.risk-category { + text-align: center; +} + +.risk-description { + width: 25% !important; +} + +.risksign-container .risksign-edit { + color: #263C5C; +} +.risksign-container .risksign-edit:hover { + cursor: pointer; + text-decoration: underline; +} + +.risksign-content { + width: 100%; +} + +.risksign-add { + min-width: 40px; + margin-left: 0.5em; +} + +.riskassessment-tasks .riskassessment-task-container, .riskassessment-task-container { + min-width: 430px; + border: 1px solid rgba(0, 0, 0, 0.1); + background: rgba(0, 0, 0, 0.05); + padding: 0.5em; +} + +.riskassessment-tasks { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} +.riskassessment-tasks .riskassessment-task-container { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; +} +.riskassessment-tasks .riskassessment-task-add-wrapper { + min-width: calc(40px + 0.5em); + margin: auto 0; + text-align: center; +} + +.riskassessment-task-listing-wrapper .riskassessment-task-container { + margin-bottom: 0.5em; +} + +.riskassessment-task-container .riskassessment-task-single { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.riskassessment-task-container .riskassessment-task-single * { + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.riskassessment-task-container .riskassessment-task-single > * { + margin-top: auto; + margin-bottom: auto; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content { + width: 100%; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-author { + display: inline-block; + width: 25px; + min-width: 25px; + height: 25px; + line-height: 25px; + background: rgba(0, 0, 0, 0.5); + overflow: hidden; + text-transform: uppercase; + font-size: 14px; + font-weight: 600; + border-radius: 50%; + vertical-align: sub; + text-align: center; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-author a { + color: #fff !important; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-author-label { + word-break: break-all; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + font-size: 14px; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data > * { + margin: auto 0.2em; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-reference { + color: #263C5C; + font-weight: 600; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-reference:hover { + text-decoration: underline; + cursor: pointer; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-count { + background: rgba(0, 0, 0, 0.2); + font-size: 12px; + border-radius: 4px; + padding: 0.2em 0.4em; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress { + background: rgba(0, 0, 0, 0.2); + font-size: 12px; + border-radius: 4px; + padding: 0.2em 0.4em; + font-weight: 700; + color: rgba(0, 0, 0, 0.6); +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-0 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-1 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-2 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-3 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-4 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-5 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-6 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-7 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-8 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-9 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-10 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-11 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-12 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-13 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-14 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-15 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-16 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-17 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-18 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-19 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-20 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-21 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-22 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-23 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-24 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-25 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-26 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-27 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-28 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-29 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-30 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-31 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-32 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-33 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-34 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-35 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-36 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-37 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-38 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-39 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-40 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-41 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-42 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-43 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-44 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-45 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-46 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-47 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-48 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-49 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-50 { + background: #e05353; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-51 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-52 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-53 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-54 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-55 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-56 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-57 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-58 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-59 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-60 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-61 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-62 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-63 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-64 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-65 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-66 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-67 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-68 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-69 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-70 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-71 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-72 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-73 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-74 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-75 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-76 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-77 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-78 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-79 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-80 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-81 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-82 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-83 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-84 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-85 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-86 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-87 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-88 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-89 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-90 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-91 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-92 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-93 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-94 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-95 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-96 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-97 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-98 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-99 { + background: #e9ad4f; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-100 { + background: #47e58e; + color: #fff; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-title { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-title .riskassessment-task-progress-checkbox { + margin: auto 0; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-title .riskassessment-task-progress-checkbox input { + width: 20px; + height: 20px; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-add { + min-width: 40px; + margin-left: 0.5em; +} +.riskassessment-task-container .riskassessment-task-single .riskassessment-task-delete { + margin-right: -0.5em; +} + +.riskassessment-task-listing-wrapper { + width: 100%; +} + +.riskassessment-task-add { + margin: 5px; +} + +.riskassessment-task-list { + margin: 5px; +} + +/** Add comment in modal */ +.riskassessment-task-timespent-add-container { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + background: rgba(0, 0, 0, 0.1); + padding: 10px; + margin-bottom: 25px; +} +.riskassessment-task-timespent-add-container > * { + margin: auto 5px; +} +.riskassessment-task-timespent-add-container .timespent-comment { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; +} +.riskassessment-task-timespent-add-container .timespent-date { + min-width: 250px; +} +.riskassessment-task-timespent-add-container .timespent-duration { + max-width: 100px; +} +.riskassessment-task-timespent-add-container .timespent-add-button { + min-width: 30px; +} +.riskassessment-task-timespent-add-container .timespent-add-button .wpeo-button { + margin-top: 20px; +} + +/** List of comments */ +.riskassessment-task-timespent-container .riskassessment-task .riskassessment-task-container { + background: #fff; + border: 0; +} + +td > .risk-evaluation-container { + min-width: 340px; + border: 1px solid rgba(0, 0, 0, 0.1); + background: rgba(0, 0, 0, 0.05); + padding: 0.5em; + margin-bottom: 0.5em; +} + +.risk-evaluation-container .risk-evaluation-single { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.risk-evaluation-container .risk-evaluation-single * { + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.risk-evaluation-container .risk-evaluation-single > * { + margin-top: auto; + margin-bottom: auto; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-cotation { + width: 40px; + min-width: 40px; + height: 40px; + line-height: 40px; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo { + width: 40px; + min-width: 40px; + height: 40px; + line-height: 40px; + text-align: center; + background: #ececec; + color: rgba(0, 0, 0, 0.3); + margin-right: 0.5em; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo .photodigiriskdolibarr { + width: 100%; + height: auto; + background: #fff; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo a, .risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo .divphotoref { + width: 40px; + min-width: 40px; + height: 40px; + position: relative; + display: block; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo a .photo, .risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo .divphotoref .photo { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + -o-object-fit: cover; + object-fit: cover; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content { + width: 100%; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-author { + display: inline-block; + width: 25px; + min-width: 25px; + height: 25px; + line-height: 25px; + background: rgba(0, 0, 0, 0.5); + overflow: hidden; + text-transform: uppercase; + font-size: 14px; + font-weight: 600; + border-radius: 50%; + vertical-align: sub; + text-align: center; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-author a { + color: #fff !important; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-data { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-data > * { + margin: auto 0.2em; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-data .risk-evaluation-reference { + color: #263C5C; + font-weight: 600; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-data .risk-evaluation-reference:hover { + text-decoration: underline; + cursor: pointer; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-data .risk-evaluation-count { + background: rgba(0, 0, 0, 0.2); + font-size: 12px; + border-radius: 4px; + padding: 0.2em 0.4em; +} +.risk-evaluation-container .risk-evaluation-single .risk-evaluation-button { + margin-left: 0.5em; +} + +/** + * .cotation -> classe de base + * .default-cotation -> par défaut + * .level1 -> cotaiton 0 + * .level2 -> cotation 48 + * .level4 -> cotation 51 + * .level5 -> cotation 80 + * .method -> cotation personnalisée + */ +.wpeo-table.evaluation-method { + background: none !important; +} +@media (max-width: 480px) { + .wpeo-table.evaluation-method .table-row.table-header { + display: none; + } +} +.wpeo-table.evaluation-method .table-cell { + margin: 0; + text-align: center; + border: 1px solid rgba(0, 0, 0, 0.1); + padding: 0.8em 0.4em; + position: relative; +} +@media (max-width: 480px) { + .wpeo-table.evaluation-method .table-cell { + width: 100% !important; + } +} +.wpeo-table.evaluation-method .table-cell.can-select::after, .wpeo-table.evaluation-method .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .table-cell.risk-evaluation-cotation::after, .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .wpeo-table.evaluation-method .table-cell.risk-evaluation-cotation::after { + display: block; + content: ""; + position: absolute; + top: 0.4em; + right: 0.4em; + bottom: 0.4em; + left: 0.4em; + background: rgba(0, 0, 0, 0.1); + -webkit-transform: scale(0); + transform: scale(0); + opacity: 0; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.wpeo-table.evaluation-method .table-cell.can-select:hover, .wpeo-table.evaluation-method .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .table-cell.risk-evaluation-cotation:hover, .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .wpeo-table.evaluation-method .table-cell.risk-evaluation-cotation:hover { + cursor: pointer; +} +.wpeo-table.evaluation-method .table-cell.can-select:hover::after, .wpeo-table.evaluation-method .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .table-cell.risk-evaluation-cotation:hover::after, .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .wpeo-table.evaluation-method .table-cell.risk-evaluation-cotation:hover::after { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; +} +.wpeo-table.evaluation-method .table-cell.can-select.active, .wpeo-table.evaluation-method .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .table-cell.active.risk-evaluation-cotation, .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .wpeo-table.evaluation-method .table-cell.active.risk-evaluation-cotation { + color: #fff; +} +.wpeo-table.evaluation-method .table-cell.can-select.active::after, .wpeo-table.evaluation-method .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .table-cell.active.risk-evaluation-cotation::after, .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .wpeo-table.evaluation-method .table-cell.active.risk-evaluation-cotation::after { + -webkit-transform: scale(1) !important; + transform: scale(1) !important; + opacity: 1 !important; + background: #0d8aff; + z-index: -1; +} +.wpeo-table.evaluation-method .table-row > .table-cell:first-child { + background: #263C5C; + color: #fff; +} +@media (max-width: 480px) { + .wpeo-table.evaluation-method .table-row > .table-cell:first-child { + background: #263C5C; + } +} +.wpeo-table.evaluation-method .table-row:not(.header) .table-cell:nth-of-type(2).active::after { + background: #0d8aff; +} +.wpeo-table.evaluation-method .table-row:not(.header) .table-cell:nth-of-type(3).active::after { + background: #0063c0; +} +.wpeo-table.evaluation-method .table-row:not(.header) .table-cell:nth-of-type(4).active::after { + background: #003b73; +} +.wpeo-table.evaluation-method .table-row:not(.header) .table-cell:nth-of-type(5).active::after { + background: #001427; +} +.wpeo-table.evaluation-method .table-row:not(.header) .table-cell:nth-of-type(6).active::after { + background: black; +} + +.wpeo-modal[class*=modal-risk] .modal-container .title { + display: block; + font-weight: 600; + font-size: 13px; + margin-bottom: 0.6em; + color: rgba(0, 0, 0, 0.8); +} +.wpeo-modal[class*=modal-risk] .modal-container .title required { + font-size: 18px; + color: #0d8aff; + vertical-align: text-top; + line-height: 0.9; +} +.wpeo-modal[class*=modal-risk] .modal-container .section-title { + font-size: 16px; + color: rgba(0, 0, 0, 0.8); + font-weight: 600; + margin-bottom: 0.6em; + display: block; +} +.wpeo-modal[class*=modal-risk] .modal-container .maxwidthdate { + max-width: 125px; +} + +.wpeo-modal[class*=modal-risk] .modal-container .risk-content { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + padding-bottom: 1em; + margin-bottom: 1em; + border-bottom: 1px solid rgba(0, 0, 0, 0.2); +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-content .risk-category { + margin-right: 1.5em; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-content .risk-category .dropdown-toggle::after { + display: none; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-content .risk-description { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-content .risk-description textarea { + width: 100%; +} + +.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container { + padding-bottom: 1em; + margin-bottom: 1em; + border-bottom: 1px solid rgba(0, 0, 0, 0.2); +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-header { + margin-bottom: 1em; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard { + margin-right: 1em; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .risk-evaluation-photo img { + max-width: 50px; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .risk-evaluation-comment { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + margin-left: 1em; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .risk-evaluation-comment textarea { + width: 100%; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container.advanced .risk-evaluation-content-wrapper { + -ms-flex-wrap: wrap; + flex-wrap: wrap; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container.advanced .risk-evaluation-content { + width: 100%; + margin-bottom: 1em; +} +.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container.advanced .risk-evaluation-photo { + margin-right: 1em; +} + +/** Listing */ +.wpeo-modal .modal-container .risk-evaluations-list .risk-evaluation > .risk-evaluation-container { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} +.wpeo-modal .modal-container .risk-evaluations-list .risk-evaluation > .risk-evaluation-container .risk-evaluation-single { + width: 100%; +} +.wpeo-modal .modal-container .risk-evaluations-list .risk-evaluation > .risk-evaluation-container .risk-evaluation-single .risk-evaluation-reference { + color: #333333; +} +.wpeo-modal .modal-container .risk-evaluations-list .risk-evaluation > .risk-evaluation-container .risk-evaluation-single .risk-evaluation-reference:hover { + cursor: auto; + text-decoration: none; +} +.wpeo-modal .modal-container .risk-evaluations-list .risk-evaluation > .risk-evaluation-container .risk-evaluation-actions { + margin-left: auto; +} + +.wpeo-modal[class*=modal-risksign] .modal-container .title { + display: block; + font-weight: 600; + font-size: 13px; + margin-bottom: 0.6em; + color: rgba(0, 0, 0, 0.8); +} +.wpeo-modal[class*=modal-risksign] .modal-container .title required { + font-size: 18px; + color: #0d8aff; + vertical-align: text-top; + line-height: 0.9; +} +.wpeo-modal[class*=modal-risksign] .modal-container .section-title { + font-size: 16px; + color: rgba(0, 0, 0, 0.8); + font-weight: 600; + margin-bottom: 0.6em; + display: block; +} + +.wpeo-modal[class*=modal-risksign] .modal-container .risksign-content { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + padding-bottom: 1em; + margin-bottom: 1em; + border-bottom: 1px solid rgba(0, 0, 0, 0.2); +} +.wpeo-modal[class*=modal-risksign] .modal-container .risksign-content .risksign-category { + margin-right: 1.5em; +} +.wpeo-modal[class*=modal-risksign] .modal-container .risksign-content .risksign-category .dropdown-toggle::after { + display: none; +} +.wpeo-modal[class*=modal-risksign] .modal-container .risksign-content .risksign-description { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; +} +.wpeo-modal[class*=modal-risksign] .modal-container .risksign-content .risksign-description textarea { + width: 100%; +} + +.wpeo-modal[class*=modal-riskassessment-task] .modal-container .title { + display: block; + font-weight: 600; + font-size: 13px; + margin-bottom: 0.6em; + color: rgba(0, 0, 0, 0.8); +} +.wpeo-modal[class*=modal-riskassessment-task] .modal-container .title required { + font-size: 18px; + color: #0d8aff; + vertical-align: text-top; + line-height: 0.9; +} +.wpeo-modal[class*=modal-riskassessment-task] .modal-container .section-title { + font-size: 16px; + color: rgba(0, 0, 0, 0.8); + font-weight: 600; + margin-bottom: 0.6em; + display: block; +} +.wpeo-modal[class*=modal-riskassessment-task] .modal-container .riskassessment-task-single { + display: block !important; +} + +.wpeo-modal[class*=modal-riskassessment-task] .modal-container .riskassessment-task-container { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + padding-bottom: 1em; + margin-bottom: 1em; + border-bottom: 1px solid rgba(0, 0, 0, 0.2); +} +.wpeo-modal[class*=modal-riskassessment-task] .modal-container .riskassessment-task-container .riskassessment-task { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; +} +.wpeo-modal[class*=modal-riskassessment-task] .modal-container .riskassessment-task-container .riskassessment-task input { + width: 100%; +} + +/** Listing */ +.wpeo-modal .modal-container .riskassessment-task-list .riskassessment-task > .riskassessment-task-container { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} +.wpeo-modal .modal-container .riskassessment-task-list .riskassessment-task > .riskassessment-task-container .riskassessment-task-single { + width: 100%; +} +.wpeo-modal .modal-container .riskassessment-task-list .riskassessment-task > .riskassessment-task-container .riskassessment-task-actions { + margin-left: auto; +} + +#dialog-confirm-actionButtonImportSharedRisks .confirmtext { + text-align: center; + padding: 0.2em 0 0.4em 0; +} +#dialog-confirm-actionButtonImportSharedRisks .tagtable { + border-collapse: collapse; +} +#dialog-confirm-actionButtonImportSharedRisks .tagtr { + border-bottom: 1px solid rgba(0, 0, 0, 0.2); +} +#dialog-confirm-actionButtonImportSharedRisks .tagtd { + padding: 0.3em 0; +} +#dialog-confirm-actionButtonImportSharedRisks .tagtr > .tagtd:first-child { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} +#dialog-confirm-actionButtonImportSharedRisks .tagtr > .tagtd:first-child .importsharedrisk:not(.imported):not(.risk-evaluation-cotation) { + width: 30%; +} +#dialog-confirm-actionButtonImportSharedRisks .tagtr > .tagtd:first-child .importsharedrisk.imported { + width: 10%; + text-align: center; + font-size: 12px; +} +#dialog-confirm-actionButtonImportSharedRisks .tagtr > .tagtd:first-child .importsharedrisk img { + float: left; + margin-right: 0.4em; + max-width: 35px; +} +#dialog-confirm-actionButtonImportSharedRisks .tagtr > .tagtd:first-child .importsharedrisk > span { + display: block; +} +#dialog-confirm-actionButtonImportSharedRisks .tagtr > .tagtd:first-child .importsharedrisk .importsharedrisk-ref { + font-weight: 600; +} +#dialog-confirm-actionButtonImportSharedRisks .tagtr > .tagtd:last-child { + vertical-align: middle; +} + +#dialog-confirm-actionButtonImportSharedRiskSigns .confirmtext { + text-align: center; + padding: 0.2em 0 0.4em 0; +} +#dialog-confirm-actionButtonImportSharedRiskSigns .tagtable { + border-collapse: collapse; +} +#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr { + border-bottom: 1px solid rgba(0, 0, 0, 0.2); +} +#dialog-confirm-actionButtonImportSharedRiskSigns .tagtd { + padding: 0.3em 0; +} +#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr > .tagtd:first-child { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} +#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr > .tagtd:first-child .importsharedrisksign:not(.imported) { + width: 30%; +} +#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr > .tagtd:first-child .importsharedrisksign.imported { + width: 10%; + text-align: center; + font-size: 12px; +} +#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr > .tagtd:first-child .importsharedrisksign img { + float: left; + margin-right: 0.4em; + max-width: 35px; +} +#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr > .tagtd:first-child .importsharedrisksign > span { + display: block; +} +#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr > .tagtd:first-child .importsharedrisksign .importsharedrisksign-ref { + font-weight: 600; +} +#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr > .tagtd:last-child { + vertical-align: middle; +} + +.wpeo-modal.modal-photo.modal-active { + z-index: 2014; +} +.wpeo-modal.modal-photo .clickable-photo { + border: 5px solid #fff; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + width: 100%; +} +.wpeo-modal.modal-photo .clickable-photo:hover { + cursor: pointer; +} +.wpeo-modal.modal-photo .clickable-photo:hover .photo-image .photo { + opacity: 0.8; +} +.wpeo-modal.modal-photo .clickable-photo .photo-image { + position: relative; + width: 100%; + max-width: 120px; + height: 120px; + margin: auto; +} +.wpeo-modal.modal-photo .clickable-photo .photo-image .photo { + position: absolute; + top: 0; + left: 0; + width: 100%; + -o-object-fit: cover; + object-fit: cover; + max-width: none !important; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.wpeo-modal.modal-photo .clickable-photo .photo-image .clicked-photo-preview { + position: absolute; + display: inline-block; + top: 1em; + right: 1em; + z-index: 900; + height: 25px; + line-height: 25px; + background: #fff; + color: #0d8aff; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; +} +.wpeo-modal.modal-photo .clickable-photo .photo-image .clicked-photo-preview:hover { + -webkit-transform: scale(1.1); + transform: scale(1.1); +} +.wpeo-modal.modal-photo .clickable-photo .photo-image .clicked-photo-preview i { + line-height: 25px; + font-size: 14px; +} +.wpeo-modal.modal-photo .clickable-photo .title { + word-break: break-all; +} + +.wpeo-modal.modal-photo .formattachnewfile { + padding-bottom: 0.5em; +} +.wpeo-modal.modal-photo input[type=file] { + border-bottom: 0 !important; +} + +.evaluator-add-modal .time { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.risk-evaluation-add-modal .modal-active, .risk-evaluation-edit-modal .modal-active { + z-index: 1005; +} +.risk-evaluation-add-modal .modal-container, .risk-evaluation-edit-modal .modal-container { + max-height: 750px; +} + +.wpeo-modal .modal-container ul, .wpeo-modal .modal-container li { + margin: 0; + list-style-type: none; + padding: 0; +} + +@media (max-width: 1200px) { + #id-container .side-nav .vmenu { + width: 30px; + padding-right: 0 !important; + overflow: hidden; + } + #id-container .side-nav .vmenu .menu_titre .vmenu i { + margin-right: 2em; + } + #id-container .side-nav .vmenu #blockvmenusearch .select2-container--default .select2-selection--single .select2-selection__placeholder::before { + display: inline-block; + content: "\f002"; + font-family: "Font Awesome 5 Free"; + font-weight: 600; + margin-right: 2em; + } +} +@media (max-width: 1200px) { + #id-container.page-ut-gp-list .side-nav { + position: static; + height: auto; + padding: 0 2em; + background: none; + border: 0; + } + #id-container.page-ut-gp-list .side-nav .side-nav-responsive { + display: block; + background: #263C5C; + color: #fff; + border-radius: 6px; + padding: 0.6em 1em; + font-weight: 600; + font-size: 14px; + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + } + #id-container.page-ut-gp-list .side-nav .side-nav-responsive:hover { + cursor: pointer; + background: #446ba4; + } + #id-container.page-ut-gp-list .side-nav #id-left { + position: absolute; + z-index: 999; + background: #efefef; + border: 1px solid rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 0 40px 0 rgba(0, 0, 0, 0.1); + -webkit-transition: all 0.2s ease-out; + transition: all 0.2s ease-out; + max-height: 500px; + overflow-y: auto; + } + #id-container.page-ut-gp-list .side-nav #id-left:not(.active) { + opacity: 0; + pointer-events: none; + -webkit-transform: translateY(-10px); + transform: translateY(-10px); + } + #id-container.page-ut-gp-list .side-nav #id-left:not(.active) .wpeo-button { + pointer-events: none; + } + #id-container.page-ut-gp-list #id-right { + padding-left: 0; + } +} +@media (max-width: 1200px) { + td > .riskassessment-task-container { + min-width: 0; + } +} +@media (max-width: 1200px) { + td > .risk-evaluation-container { + min-width: 0; + } +} +.preview-photo { + z-index: 2100 !important; +} + +.imgTabTitle { + max-height: 32px !important; +} + +.dropdown-toggle::after { + display: none; +} + +.favorite-photo { + border: 5px solid #0d8aff; +} + +tr.liste_titre th.liste_titre:not(.maxwidthsearch), tr.liste_titre td.liste_titre:not(.maxwidthsearch) { + opacity: 1; +} + +/* Force values on one colum for small screen */ +@media only screen and (max-width: 1600px) { + div.fichecenter { + width: 100%; + clear: both; /* This is to have div fichecenter that are true rectangles */ + } + div.fichecenterbis { + margin-top: 8px; + } + div.fichethirdleft { + float: none; + width: auto; + padding-bottom: 6px; + } + div.fichetwothirdright { + float: none; + width: auto; + padding-bottom: 6px; + } + div.fichehalfleft { + float: none; + width: auto; + } + div.fichehalfright { + float: none; + width: auto; + } + div.fichehalfright { + margin-top: 10px; + } + div.firstcolumn div.box { + padding-right: 0px; + } + div.secondcolumn div.box { + padding-left: 0px; + } +} \ No newline at end of file diff --git a/css/dolimeet.css.php b/css/dolimeet.css.php new file mode 100644 index 0000000..4b98833 --- /dev/null +++ b/css/dolimeet.css.php @@ -0,0 +1,82 @@ +. + */ + +/** + * \file css/dolimeet.css.php + * \ingroup dolimeet + * \brief CSS file for module DoliMeet. + */ + +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled because need to load personalized language +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled. Language code is found on url. +if ( ! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); +//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations +if ( ! defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); +if ( ! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); +if ( ! defined('NOLOGIN')) define('NOLOGIN', 1); // File must be accessed by logon page so without login +//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We need top menu content +if ( ! defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); +if ( ! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); + +session_cache_limiter('public'); +// false or '' = keep cache instruction added by server +// 'public' = remove cache instruction added by server +// and if no cache-control added later, a default cache delay (10800) will be added by PHP. + +// Load Dolibarr environment +$res = 0; +// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) +if ( ! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"] . "/main.inc.php"; +// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME +$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; +while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } +if ( ! $res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1)) . "/main.inc.php"; +if ( ! $res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/../main.inc.php")) $res = @include substr($tmp, 0, ($i + 1)) . "/../main.inc.php"; +// Try main.inc.php using relative path +if ( ! $res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; +if ( ! $res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; +if ( ! $res) die("Include of main fails"); + +require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; + +// Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS +/*if (empty($user->id) && ! empty($_SESSION['dol_login'])) +{ + $user->fetch('',$_SESSION['dol_login']); + $user->getrights(); +}*/ + + +// Define css type +top_httphead('text/css'); +//// Important: Following code is to cache this file to avoid page request by browser at each Dolibarr page access. +//// You can use CTRL+F5 to refresh your browser cache. +if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate'); +else header('Cache-Control: no-cache'); + +require DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php'; +if (defined('THEME_ONLY_CONSTANT')) return; + +?> + +.pictoDigirisk { + vertical-align: middle; + width: 24px; + margin-right: 2px; +} + diff --git a/css/dolimeet.min.css b/css/dolimeet.min.css new file mode 100644 index 0000000..ee54520 --- /dev/null +++ b/css/dolimeet.min.css @@ -0,0 +1 @@ +.risk-evaluation-cotation{width:50px;min-width:50px;height:50px;line-height:50px;text-align:center;border-radius:6px;background:#ececec;color:rgba(0,0,0,.8);font-size:16px;font-weight:600;margin-right:.5em}.risk-evaluation-cotation[data-scale="1"]{background:#ececec}.risk-evaluation-cotation[data-scale="2"]{background:#e9ad4f;color:#fff}.risk-evaluation-cotation[data-scale="3"]{background:#e05353;color:#fff}.risk-evaluation-cotation[data-scale="4"]{background:#2b2b2b;color:#fff}.risk-evaluation-cotation.selected-cotation{-webkit-box-shadow:0 0 0 2px #0d8aff;box-shadow:0 0 0 2px #0d8aff}.can-select,.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .risk-evaluation-cotation{-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.can-select:hover,.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .risk-evaluation-cotation:hover{cursor:pointer;opacity:.8}.wpeo-modal .title{display:block;font-weight:600;font-size:13px;margin-bottom:.6em;color:rgba(0,0,0,.8)}.wpeo-modal input[type=text],.wpeo-modal input[type=email],.wpeo-modal input[type=url],.wpeo-modal input[type=password],.wpeo-modal input[type=search],.wpeo-modal input[type=number],.wpeo-modal input[type=tel],.wpeo-modal input[type=range],.wpeo-modal input[type=date],.wpeo-modal input[type=month],.wpeo-modal input[type=week],.wpeo-modal input[type=time],.wpeo-modal input[type=datetime],.wpeo-modal input[type=datetime-local],.wpeo-modal input[type=color],.wpeo-modal select,.wpeo-modal textarea{width:100%;border:1px solid rgba(0,0,0,.2);padding:1em}.wpeo-modal input[type=text]:focus,.wpeo-modal input[type=email]:focus,.wpeo-modal input[type=url]:focus,.wpeo-modal input[type=password]:focus,.wpeo-modal input[type=search]:focus,.wpeo-modal input[type=number]:focus,.wpeo-modal input[type=tel]:focus,.wpeo-modal input[type=range]:focus,.wpeo-modal input[type=date]:focus,.wpeo-modal input[type=month]:focus,.wpeo-modal input[type=week]:focus,.wpeo-modal input[type=time]:focus,.wpeo-modal input[type=datetime]:focus,.wpeo-modal input[type=datetime-local]:focus,.wpeo-modal input[type=color]:focus,.wpeo-modal select:focus,.wpeo-modal textarea:focus{border:1px solid rgba(0,0,0,.6)}.wpeo-modal select{padding:1em 0}.form-label-required::after{display:inline-block;content:"*";color:#e05353;font-size:22px;line-height:0;position:relative;top:4px;left:4px}.digirisk-page-container{max-width:1000px;background:#fff;-webkit-box-shadow:0 0 40px 0 rgba(0,0,0,.1);box-shadow:0 0 40px 0 rgba(0,0,0,.1);margin:1.5em auto 0 auto;padding:2em;-webkit-box-sizing:border-box;box-sizing:border-box}.digirisk-page-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.pictoDigirisk{vertical-align:middle;width:24px;margin-right:2px}.wpeo-dropdown{position:relative;display:inline-block}.wpeo-dropdown .dropdown-toggle{display:inline-block}.wpeo-dropdown .dropdown-toggle span~*[class*=icon]{margin-left:10px}.wpeo-dropdown .dropdown-content{opacity:0;pointer-events:none;-webkit-transform:translateY(-10px);transform:translateY(-10px);-webkit-transition:all .2s ease-out;transition:all .2s ease-out;position:absolute;background:#fff;z-index:99;border:1px solid rgba(0,0,0,.1);-webkit-box-shadow:0 0 10px 0px rgba(0,0,0,.3);box-shadow:0 0 10px 0px rgba(0,0,0,.3);width:220px;padding:.6em}.wpeo-dropdown.dropdown-active .dropdown-content{opacity:1;pointer-events:auto;-webkit-transform:translateY(0);transform:translateY(0)}.wpeo-dropdown ul,.wpeo-dropdown li{margin:0;list-style-type:none;padding:0}.wpeo-dropdown .dropdown-item{display:block;color:rgba(0,0,0,.7);text-decoration:none}.wpeo-dropdown .dropdown-item::before{display:none;content:""}.wpeo-dropdown .dropdown-item .dropdown-result-title,.wpeo-dropdown .dropdown-item .dropdown-result-subtitle{display:block}.wpeo-dropdown .dropdown-item .dropdown-result-title{font-size:14px}.wpeo-dropdown .dropdown-item .dropdown-result-subtitle{font-size:12px;color:rgba(0,0,0,.5)}.wpeo-dropdown.dropdown-small .dropdown-content{width:60px}.wpeo-dropdown.dropdown-medium .dropdown-content{width:220px}.wpeo-dropdown.dropdown-large .dropdown-content{width:360px}.wpeo-dropdown.dropdown-padding-0 .dropdown-content{padding:0}.wpeo-dropdown.dropdown-padding-1 .dropdown-content{padding:.6em}.wpeo-dropdown.dropdown-padding-2 .dropdown-content{padding:1.2em}.wpeo-dropdown.dropdown-left .dropdown-content{left:0}.wpeo-dropdown.dropdown-right .dropdown-content{right:0}.wpeo-dropdown.dropdown-horizontal.dropdown-left .dropdown-content{left:100%}.wpeo-dropdown.dropdown-horizontal.dropdown-right .dropdown-content{right:100%}.wpeo-dropdown.dropdown-horizontal .dropdown-content{top:0;width:auto !important;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.wpeo-dropdown .dropdown-item.dropdown-item-disable{opacity:.6;cursor:default !important;pointer-events:none}.wpeo-dropdown .dropdown-content .dropdown-item{padding:.6em;background:#fff;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.wpeo-dropdown .dropdown-content .dropdown-item:hover{cursor:pointer;background:rgba(0,0,0,.1)}.wpeo-dropdown.dropdown-list .dropdown-content{text-align:left}.wpeo-dropdown.dropdown-list .dropdown-item::after{display:block;content:"";clear:both}.wpeo-dropdown.dropdown-list .dropdown-item img{float:left;margin-right:.4em}.wpeo-dropdown.dropdown-grid .dropdown-item img{width:100%;height:auto;display:block;margin:0}.wpeo-button{display:inline-block;border:0;-webkit-box-shadow:none;box-shadow:none;background:none;text-decoration:none;padding:6px 14px;line-height:1.4;vertical-align:middle;height:auto;border-radius:0;-webkit-transition:all .2s ease-out;transition:all .2s ease-out;position:relative;border-width:3px;border-style:solid;font-size:16px;-webkit-box-sizing:border-box;box-sizing:border-box;background:#0d8aff;border-color:#0d8aff;color:#fff}.wpeo-button:focus,.wpeo-button:visited{color:#fff}.wpeo-button:hover{color:#fff;-webkit-box-shadow:inset 0 -2.6em rgba(255,255,255,.25);box-shadow:inset 0 -2.6em rgba(255,255,255,.25);cursor:pointer;text-decoration:none}.wpeo-button:focus,.wpeo-button:active{outline:none}.wpeo-button{background:#0d8aff;border-color:#0d8aff;color:#fff}.wpeo-button.button-main{background:#0d8aff;border-color:#0d8aff;color:#fff}.wpeo-button.button-secondary{background:#263c5c;border-color:#263c5c;color:#fff}.wpeo-button.button-light{background:#fff;border-color:#fff;color:#333}.wpeo-button.button-light:hover{-webkit-box-shadow:inset 0 -2.6em rgba(0,0,0,.1);box-shadow:inset 0 -2.6em rgba(0,0,0,.1);color:#333}.wpeo-button.button-dark{background:#2b2b2b;border-color:#2b2b2b}.wpeo-button.button-grey{background:#ececec;border-color:#ececec;color:#333}.wpeo-button.button-grey:hover{-webkit-box-shadow:inset 0 -2.6em rgba(0,0,0,.1);box-shadow:inset 0 -2.6em rgba(0,0,0,.1);color:#333}.wpeo-button.button-red{background:#e05353;border-color:#e05353}.wpeo-button.button-yellow{background:#e9ad4f;border-color:#e9ad4f}.wpeo-button.button-blue{background:#0d8aff;border-color:#0d8aff}.wpeo-button.button-green{background:#47e58e;border-color:#47e58e}.wpeo-button.button-transparent{background:rgba(0,0,0,0);border-color:rgba(0,0,0,0);color:rgba(51,51,51,.4)}.wpeo-button.button-transparent:hover{color:#333;-webkit-box-shadow:inset 0 -2.6em rgba(255,255,255,0);box-shadow:inset 0 -2.6em rgba(255,255,255,0)}.wpeo-button.button-bordered{background:none;border-color:#0d8aff;color:#0d8aff}.wpeo-button.button-bordered.button-main{border-color:#0d8aff;color:#0d8aff}.wpeo-button.button-bordered.button-main:hover{-webkit-box-shadow:inset 0 -2.6em #0d8aff;box-shadow:inset 0 -2.6em #0d8aff;color:#fff}.wpeo-button.button-bordered.button-light{border-color:#fff;color:#fff}.wpeo-button.button-bordered.button-light:hover{-webkit-box-shadow:inset 0 -2.6em #fff;box-shadow:inset 0 -2.6em #fff;color:#333}.wpeo-button.button-bordered.button-dark{border-color:#2b2b2b;color:#2b2b2b}.wpeo-button.button-bordered.button-dark:hover{-webkit-box-shadow:inset 0 -2.6em #2b2b2b;box-shadow:inset 0 -2.6em #2b2b2b}.wpeo-button.button-bordered.button-grey{border-color:#ececec;color:#a0a0a0}.wpeo-button.button-bordered.button-grey:hover{-webkit-box-shadow:inset 0 -2.6em #ececec;box-shadow:inset 0 -2.6em #ececec;color:#333}.wpeo-button.button-bordered.button-red{border-color:#e05353;color:#e05353}.wpeo-button.button-bordered.button-red:hover{-webkit-box-shadow:inset 0 -2.6em #e05353;box-shadow:inset 0 -2.6em #e05353}.wpeo-button.button-bordered.button-yellow{border-color:#e9ad4f;color:#e9ad4f}.wpeo-button.button-bordered.button-yellow:hover{-webkit-box-shadow:inset 0 -2.6em #e9ad4f;box-shadow:inset 0 -2.6em #e9ad4f}.wpeo-button.button-bordered.button-blue{border-color:#0d8aff;color:#0d8aff}.wpeo-button.button-bordered.button-blue:hover{-webkit-box-shadow:inset 0 -2.6em #0d8aff;box-shadow:inset 0 -2.6em #0d8aff}.wpeo-button.button-bordered.button-green{border-color:#47e58e;color:#47e58e}.wpeo-button.button-bordered.button-green:hover{-webkit-box-shadow:inset 0 -2.6em #47e58e;box-shadow:inset 0 -2.6em #47e58e}.wpeo-button.button-bordered:hover{-webkit-box-shadow:inset 0 -2.6em #0d8aff;box-shadow:inset 0 -2.6em #0d8aff;color:#fff}.wpeo-button .button-add{position:absolute;top:.4em;right:.2em;opacity:.6;font-size:14px;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.wpeo-button:hover .button-add{opacity:.8}.wpeo-button.button-square-40 .button-add{top:.1em;right:0}.wpeo-button .button-icon,.wpeo-button span{position:relative}.wpeo-button .button-icon~span{margin-left:10px}.wpeo-button span~.button-icon{margin-left:10px}.wpeo-button.button-strong span{font-weight:800}.wpeo-button.button-uppercase span{text-transform:uppercase;font-size:14px}.wpeo-button[class*=button-square-]{text-align:center;overflow:hidden;padding:0}.wpeo-button.button-square-30{width:30px;height:30px;line-height:24px}.wpeo-button.button-square-30 .button-icon{font-size:12px;line-height:24px}.wpeo-button.button-square-40{width:40px;height:40px;line-height:34px}.wpeo-button.button-square-40 .button-icon{line-height:34px}.wpeo-button.button-square-50{width:50px;height:50px;line-height:44px}.wpeo-button.button-square-50 .button-icon{line-height:44px}.wpeo-button.button-square-60{width:60px;height:60px;line-height:54px}.wpeo-button.button-square-60 .button-icon{line-height:54px}.wpeo-button.button-float-left{float:left}.wpeo-button.button-float-right{float:right}.wpeo-button.button-margin{margin:1em 0}.wpeo-button.button-radius-1{border-radius:2px}.wpeo-button.button-radius-2{border-radius:4px}.wpeo-button.button-radius-3{border-radius:6px}.wpeo-button.button-rounded{border-radius:50%}.wpeo-button.button-disable{background:#ececec !important;border-color:#ececec !important;color:rgba(0,0,0,.4) !important;pointer-events:none}.wpeo-button.button-disable:hover{-webkit-box-shadow:none !important;box-shadow:none !important}.wpeo-button.button-disable.button-event{pointer-events:all}.wpeo-button.button-size-small{font-size:14px}.wpeo-button.button-size-small.button-uppercase span{font-size:12px}.wpeo-button.button-size-large{font-size:18px}.wpeo-button.button-size-large.button-uppercase span{font-size:16px}.wpeo-modal{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1000;background:rgba(39,42,53,.9);opacity:0;pointer-events:none;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.wpeo-modal textarea{resize:none}.wpeo-modal.modal-active{opacity:1;pointer-events:auto;z-index:1002}.wpeo-modal.modal-active .modal-container{-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.wpeo-modal.modal-active textarea{resize:both}.wpeo-modal.modal-active .modal-active{z-index:1003}.wpeo-modal.modal-active .modal-active .modal-active{z-index:1004}.wpeo-modal.modal-force-display .modal-close{display:none}.wpeo-modal .modal-container{position:absolute;-webkit-transition:all .2s ease-out;transition:all .2s ease-out;width:100%;max-width:860px;height:100%;max-height:560px;background:#fff;padding:1em 0;margin:auto;top:50%;left:50%;-webkit-transform:translate(-50%, -60%);transform:translate(-50%, -60%)}@media(max-width: 480px){.wpeo-modal .modal-container{padding:1em}}.wpeo-modal .modal-container .modal-header{height:10%;display:-webkit-box;display:-ms-flexbox;display:flex;padding:0 2em}.wpeo-modal .modal-container .modal-content{height:78%;padding:0 2em}.wpeo-modal .modal-container .modal-footer{height:12%;padding:0 2em}.wpeo-modal .modal-container .modal-header .modal-title,.wpeo-modal .modal-container .modal-header .modal-close{margin:auto 0}.wpeo-modal .modal-container .modal-header .modal-title{text-transform:uppercase;font-size:18px;white-space:normal}@media(max-width: 770px){.wpeo-modal .modal-container .modal-header .modal-title{font-size:16px}}@media(max-width: 480px){.wpeo-modal .modal-container .modal-header .modal-title{font-size:14px}}.wpeo-modal .modal-container .modal-header .modal-close{margin-left:auto;color:rgba(0,0,0,.3);padding:4px;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.wpeo-modal .modal-container .modal-header .modal-close:hover{cursor:pointer;color:#0d8aff}.wpeo-modal .modal-container .modal-content{overflow-y:auto;font-size:14px}@media(max-width: 480px){.wpeo-modal .modal-container .modal-content{font-size:12px}}.wpeo-modal .modal-container .modal-footer{text-align:right;padding-top:1em}.wpeo-modal .modal-container .modal-footer.left{text-align:left}.wpeo-modal .modal-container .modal-footer.center{text-align:center}.wpeo-loader{-webkit-transition:all .2s ease-out;transition:all .2s ease-out;pointer-events:none;opacity:.5;position:relative}.wpeo-loader .loader-spin{position:absolute;border:3px solid #a7a7a7;border-top:3px solid #002140;border-radius:50%;width:20px;height:20px;z-index:99;left:50%;top:50%;margin:0 !important;padding:0 !important;-webkit-animation:loader-spin 1s ease-out infinite;animation:loader-spin 1s ease-out infinite}@-webkit-keyframes loader-spin{0%{-webkit-transform:translate(-50%, -50%) rotate(0deg);transform:translate(-50%, -50%) rotate(0deg)}100%{-webkit-transform:translate(-50%, -50%) rotate(360deg);transform:translate(-50%, -50%) rotate(360deg)}}@keyframes loader-spin{0%{-webkit-transform:translate(-50%, -50%) rotate(0deg);transform:translate(-50%, -50%) rotate(0deg)}100%{-webkit-transform:translate(-50%, -50%) rotate(360deg);transform:translate(-50%, -50%) rotate(360deg)}}.wpeo-gridlayout{display:grid;grid-gap:1em 1em;grid-template-columns:repeat(4, 1fr)}.wpeo-gridlayout.grid-1{grid-template-columns:repeat(1, 1fr)}.wpeo-gridlayout.grid-1>.gridw-1{grid-column:auto/span 1}.wpeo-gridlayout.grid-2{grid-template-columns:repeat(2, 1fr)}.wpeo-gridlayout.grid-2>.gridw-1{grid-column:auto/span 1}.wpeo-gridlayout.grid-2>.gridw-2{grid-column:auto/span 2}@media(max-width: 770px){.wpeo-gridlayout.grid-2>.gridw-2{grid-column:auto/span 2}}.wpeo-gridlayout.grid-3{grid-template-columns:repeat(3, 1fr)}.wpeo-gridlayout.grid-3>.gridw-1{grid-column:auto/span 1}.wpeo-gridlayout.grid-3>.gridw-2{grid-column:auto/span 2}@media(max-width: 770px){.wpeo-gridlayout.grid-3>.gridw-2{grid-column:auto/span 2}}.wpeo-gridlayout.grid-3>.gridw-3{grid-column:auto/span 3}@media(max-width: 770px){.wpeo-gridlayout.grid-3>.gridw-3{grid-column:auto/span 2}}.wpeo-gridlayout.grid-4{grid-template-columns:repeat(4, 1fr)}.wpeo-gridlayout.grid-4>.gridw-1{grid-column:auto/span 1}.wpeo-gridlayout.grid-4>.gridw-2{grid-column:auto/span 2}@media(max-width: 770px){.wpeo-gridlayout.grid-4>.gridw-2{grid-column:auto/span 2}}.wpeo-gridlayout.grid-4>.gridw-3{grid-column:auto/span 3}@media(max-width: 770px){.wpeo-gridlayout.grid-4>.gridw-3{grid-column:auto/span 2}}.wpeo-gridlayout.grid-4>.gridw-4{grid-column:auto/span 4}@media(max-width: 770px){.wpeo-gridlayout.grid-4>.gridw-4{grid-column:auto/span 2}}.wpeo-gridlayout.grid-5{grid-template-columns:repeat(5, 1fr)}.wpeo-gridlayout.grid-5>.gridw-1{grid-column:auto/span 1}.wpeo-gridlayout.grid-5>.gridw-2{grid-column:auto/span 2}@media(max-width: 770px){.wpeo-gridlayout.grid-5>.gridw-2{grid-column:auto/span 2}}.wpeo-gridlayout.grid-5>.gridw-3{grid-column:auto/span 3}@media(max-width: 770px){.wpeo-gridlayout.grid-5>.gridw-3{grid-column:auto/span 2}}.wpeo-gridlayout.grid-5>.gridw-4{grid-column:auto/span 4}@media(max-width: 770px){.wpeo-gridlayout.grid-5>.gridw-4{grid-column:auto/span 2}}.wpeo-gridlayout.grid-5>.gridw-5{grid-column:auto/span 5}@media(max-width: 770px){.wpeo-gridlayout.grid-5>.gridw-5{grid-column:auto/span 2}}.wpeo-gridlayout.grid-6{grid-template-columns:repeat(6, 1fr)}.wpeo-gridlayout.grid-6>.gridw-1{grid-column:auto/span 1}.wpeo-gridlayout.grid-6>.gridw-2{grid-column:auto/span 2}@media(max-width: 770px){.wpeo-gridlayout.grid-6>.gridw-2{grid-column:auto/span 2}}.wpeo-gridlayout.grid-6>.gridw-3{grid-column:auto/span 3}@media(max-width: 770px){.wpeo-gridlayout.grid-6>.gridw-3{grid-column:auto/span 2}}.wpeo-gridlayout.grid-6>.gridw-4{grid-column:auto/span 4}@media(max-width: 770px){.wpeo-gridlayout.grid-6>.gridw-4{grid-column:auto/span 2}}.wpeo-gridlayout.grid-6>.gridw-5{grid-column:auto/span 5}@media(max-width: 770px){.wpeo-gridlayout.grid-6>.gridw-5{grid-column:auto/span 2}}.wpeo-gridlayout.grid-6>.gridw-6{grid-column:auto/span 6}@media(max-width: 770px){.wpeo-gridlayout.grid-6>.gridw-6{grid-column:auto/span 2}}.wpeo-gridlayout>.gridh-1{grid-row:auto/span 1}@media(max-width: 770px){.wpeo-gridlayout>.gridh-1{grid-row:auto/span 1 !important}}.wpeo-gridlayout>.gridh-2{grid-row:auto/span 2}@media(max-width: 770px){.wpeo-gridlayout>.gridh-2{grid-row:auto/span 1 !important}}.wpeo-gridlayout>.gridh-3{grid-row:auto/span 3}@media(max-width: 770px){.wpeo-gridlayout>.gridh-3{grid-row:auto/span 1 !important}}.wpeo-gridlayout>.gridh-4{grid-row:auto/span 4}@media(max-width: 770px){.wpeo-gridlayout>.gridh-4{grid-row:auto/span 1 !important}}.wpeo-gridlayout>.gridh-5{grid-row:auto/span 5}@media(max-width: 770px){.wpeo-gridlayout>.gridh-5{grid-row:auto/span 1 !important}}.wpeo-gridlayout>.gridh-6{grid-row:auto/span 6}@media(max-width: 770px){.wpeo-gridlayout>.gridh-6{grid-row:auto/span 1 !important}}.wpeo-gridlayout.grid-margin-0{margin:0em 0}.wpeo-gridlayout.grid-margin-1{margin:1em 0}.wpeo-gridlayout.grid-margin-2{margin:2em 0}.wpeo-gridlayout.grid-margin-3{margin:3em 0}.wpeo-gridlayout.grid-margin-4{margin:4em 0}.wpeo-gridlayout.grid-margin-5{margin:5em 0}.wpeo-gridlayout.grid-margin-6{margin:6em 0}.wpeo-gridlayout.grid-gap-0{grid-gap:0em 0em}.wpeo-gridlayout.grid-gap-1{grid-gap:1em 1em}.wpeo-gridlayout.grid-gap-2{grid-gap:2em 2em}.wpeo-gridlayout.grid-gap-3{grid-gap:3em 3em}.wpeo-gridlayout.grid-gap-4{grid-gap:4em 4em}.wpeo-gridlayout.grid-gap-5{grid-gap:5em 5em}.wpeo-gridlayout.grid-gap-6{grid-gap:6em 6em}.wpeo-gridlayout .grid-align-center{margin-left:auto;margin-right:auto}.wpeo-gridlayout .grid-align-right{margin-left:auto}.wpeo-gridlayout .grid-align-middle{margin-top:auto;margin-bottom:auto}.wpeo-gridlayout .grid-align-bottom{margin-top:auto}@media(max-width: 480px){.wpeo-gridlayout:not(.dropdown-content).grid-2{grid-template-columns:repeat(1, 1fr) !important}}@media(max-width: 770px){.wpeo-gridlayout:not(.dropdown-content).grid-3{grid-template-columns:repeat(2, 1fr) !important}}@media(max-width: 480px){.wpeo-gridlayout:not(.dropdown-content).grid-3{grid-template-columns:repeat(1, 1fr) !important}}@media(max-width: 770px){.wpeo-gridlayout:not(.dropdown-content).grid-4{grid-template-columns:repeat(2, 1fr) !important}}@media(max-width: 480px){.wpeo-gridlayout:not(.dropdown-content).grid-4{grid-template-columns:repeat(1, 1fr) !important}}@media(max-width: 770px){.wpeo-gridlayout:not(.dropdown-content).grid-5{grid-template-columns:repeat(2, 1fr) !important}}@media(max-width: 480px){.wpeo-gridlayout:not(.dropdown-content).grid-5{grid-template-columns:repeat(1, 1fr) !important}}@media(max-width: 770px){.wpeo-gridlayout:not(.dropdown-content).grid-6{grid-template-columns:repeat(2, 1fr) !important}}@media(max-width: 480px){.wpeo-gridlayout:not(.dropdown-content).grid-6{grid-template-columns:repeat(1, 1fr) !important}}@media(max-width: 480px){.wpeo-gridlayout:not(.dropdown-content)>*{grid-column:auto/span 1 !important}}.wpeo-table.table-flex{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;font-size:14px}.wpeo-table.table-flex .table-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.wpeo-table.table-flex .table-row:not(.table-header):nth-of-type(odd){background:rgba(0,0,0,.05)}.wpeo-table.table-flex .table-row.table-header{background:#263c5c}.wpeo-table.table-flex .table-row.table-header .table-cell{font-weight:700;color:#fff}.wpeo-table.table-flex .table-cell{margin:auto 0;width:100%;padding:.8em .6em}@media(max-width: 770px){.wpeo-table.table-flex .table-cell{padding:.4em}}.wpeo-table.table-flex.table-1 .table-cell{width:100%}.wpeo-table.table-flex.table-2 .table-cell{width:50%}.wpeo-table.table-flex.table-3 .table-cell{width:33.3333333333%}.wpeo-table.table-flex.table-4 .table-cell{width:25%}.wpeo-table.table-flex.table-5 .table-cell{width:20%}.wpeo-table.table-flex.table-6 .table-cell{width:16.6666666667%}.wpeo-table.table-flex.table-7 .table-cell{width:14.2857142857%}.wpeo-table.table-flex.table-8 .table-cell{width:12.5%}.wpeo-table.table-flex.table-9 .table-cell{width:11.1111111111%}.wpeo-table.table-flex.table-10 .table-cell{width:10%}.wpeo-table.table-flex .table-cell.table-25{max-width:25px;min-width:25px}.wpeo-table.table-flex .table-cell.table-50{max-width:50px;min-width:50px}.wpeo-table.table-flex .table-cell.table-75{max-width:75px;min-width:75px}.wpeo-table.table-flex .table-cell.table-100{max-width:100px;min-width:100px}.wpeo-table.table-flex .table-cell.table-125{max-width:125px;min-width:125px}.wpeo-table.table-flex .table-cell.table-150{max-width:150px;min-width:150px}.wpeo-table.table-flex .table-cell.table-175{max-width:175px;min-width:175px}.wpeo-table.table-flex .table-cell.table-200{max-width:200px;min-width:200px}.wpeo-table.table-flex .table-cell.table-225{max-width:225px;min-width:225px}.wpeo-table.table-flex .table-cell.table-250{max-width:250px;min-width:250px}.wpeo-table.table-flex .table-cell.table-275{max-width:275px;min-width:275px}.wpeo-table.table-flex .table-cell.table-300{max-width:300px;min-width:300px}.wpeo-table.table-flex .table-cell.table-325{max-width:325px;min-width:325px}.wpeo-table.table-flex .table-cell.table-350{max-width:350px;min-width:350px}.wpeo-table.table-flex .table-cell.table-375{max-width:375px;min-width:375px}.wpeo-table.table-flex .table-cell.table-400{max-width:400px;min-width:400px}.wpeo-table.table-flex .table-cell.table-425{max-width:425px;min-width:425px}.wpeo-table.table-flex .table-cell.table-450{max-width:450px;min-width:450px}.wpeo-table.table-flex .table-cell.table-475{max-width:475px;min-width:475px}.wpeo-table.table-flex .table-cell.table-500{max-width:500px;min-width:500px}.wpeo-table.table-flex .table-cell.table-full{width:100%}.wpeo-table.table-flex .table-cell.table-end{text-align:right;margin-left:auto}.wpeo-table.table-flex .table-cell.table-padding-0{padding:0}@media(max-width: 480px){.wpeo-table.table-flex .table-row{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.wpeo-table.table-flex .table-cell{width:100%}}.wpeo-tooltip{display:block;position:absolute;bottom:0;left:0;opacity:0;pointer-events:none;z-index:99999;white-space:nowrap;background:#2b2b2b;color:#fff;border-radius:6px;font-size:.8rem;padding:0 1em;height:2.2em;line-height:2.2em}.wpeo-tooltip::before{display:block;content:"";width:0;height:0;border-style:solid;position:absolute}.wpeo-tooltip:focus{outline:none}.wpeo-tooltip.tooltip-dark{background:#2b2b2b}.wpeo-tooltip.tooltip-dark.tooltip-top::before{border-color:#2b2b2b rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0)}.wpeo-tooltip.tooltip-dark.tooltip-right::before{border-color:rgba(0,0,0,0) #2b2b2b rgba(0,0,0,0) rgba(0,0,0,0)}.wpeo-tooltip.tooltip-dark.tooltip-bottom::before{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #2b2b2b rgba(0,0,0,0)}.wpeo-tooltip.tooltip-dark.tooltip-left::before{border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #2b2b2b}.wpeo-tooltip.tooltip-primary{background:#0d8aff}.wpeo-tooltip.tooltip-primary.tooltip-top::before{border-color:#0d8aff rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0)}.wpeo-tooltip.tooltip-primary.tooltip-right::before{border-color:rgba(0,0,0,0) #0d8aff rgba(0,0,0,0) rgba(0,0,0,0)}.wpeo-tooltip.tooltip-primary.tooltip-bottom::before{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #0d8aff rgba(0,0,0,0)}.wpeo-tooltip.tooltip-primary.tooltip-left::before{border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #0d8aff}.wpeo-tooltip.tooltip-light{background:#ececec;color:rgba(0,0,0,.6)}.wpeo-tooltip.tooltip-light.tooltip-top::before{border-color:#ececec rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0)}.wpeo-tooltip.tooltip-light.tooltip-right::before{border-color:rgba(0,0,0,0) #ececec rgba(0,0,0,0) rgba(0,0,0,0)}.wpeo-tooltip.tooltip-light.tooltip-bottom::before{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #ececec rgba(0,0,0,0)}.wpeo-tooltip.tooltip-light.tooltip-left::before{border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #ececec}.wpeo-tooltip.tooltip-red{background:#e05353}.wpeo-tooltip.tooltip-red.tooltip-top::before{border-color:#e05353 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0)}.wpeo-tooltip.tooltip-red.tooltip-right::before{border-color:rgba(0,0,0,0) #e05353 rgba(0,0,0,0) rgba(0,0,0,0)}.wpeo-tooltip.tooltip-red.tooltip-bottom::before{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #e05353 rgba(0,0,0,0)}.wpeo-tooltip.tooltip-red.tooltip-left::before{border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #e05353}.wpeo-tooltip.tooltip-top::before{border-width:6px 6px 0 6px;border-color:#2b2b2b rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);bottom:-6px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.wpeo-tooltip.tooltip-right::before{border-width:6px 6px 6px 0;border-color:rgba(0,0,0,0) #2b2b2b rgba(0,0,0,0) rgba(0,0,0,0);top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:-6px}.wpeo-tooltip.tooltip-bottom::before{border-width:0 6px 6px 6px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #2b2b2b rgba(0,0,0,0);top:-6px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.wpeo-tooltip.tooltip-left::before{border-width:6px 0 6px 6px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #2b2b2b;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);right:-6px}.wpeo-notice{position:relative;font-size:1em;padding:1em;overflow:hidden;border-radius:3px;border:solid #eee 1px;margin:1em 0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-transition:all .2s ease-out;transition:all .2s ease-out;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.wpeo-notice::before{display:block;font-family:"Font Awesome 5 Free";font-weight:900;font-size:24px}.wpeo-notice .notice-content{width:100%;padding:0 1em;color:rgba(0,0,0,.6)}.wpeo-notice .notice-title{font-size:20px;font-weight:600;color:rgba(0,0,0,.9)}.wpeo-notice .notice-subtitle{font-size:14px}.wpeo-notice .notice-close{color:rgba(0,0,0,.3);-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.wpeo-notice .notice-close:hover{color:#0d8aff;cursor:pointer}.wpeo-notice ul{padding:0 0 0 1.4em;margin:.4em 0}.wpeo-notice.notice-info{border-left:solid #0d8aff 6px;color:#0d8aff;background:rgba(13,138,255,.05)}.wpeo-notice.notice-info::before{content:""}.wpeo-notice.notice-info .notice-title,.wpeo-notice.notice-info .notice-subtitle,.wpeo-notice.notice-info a{color:#0d8aff}.wpeo-notice.notice-error{border-left:solid #e05353 6px;color:#e05353;background:rgba(224,83,83,.05)}.wpeo-notice.notice-error::before{content:""}.wpeo-notice.notice-error .notice-title,.wpeo-notice.notice-error .notice-subtitle,.wpeo-notice.notice-error a{color:#e05353}.wpeo-notice.notice-warning{border-left:solid #e9ad4f 6px;color:#e9ad4f;background:rgba(233,173,79,.05)}.wpeo-notice.notice-warning::before{content:""}.wpeo-notice.notice-warning .notice-title,.wpeo-notice.notice-warning .notice-subtitle,.wpeo-notice.notice-warning a{color:#e9ad4f}.wpeo-notice.notice-success{border-left:solid #47e58e 6px;color:#47e58e;background:rgba(71,229,142,.05)}.wpeo-notice.notice-success::before{content:""}.wpeo-notice.notice-success .notice-title,.wpeo-notice.notice-success .notice-subtitle,.wpeo-notice.notice-success a{color:#47e58e}.tns-outer{position:relative}.tns-outer .tns-nav{text-align:center;position:absolute;width:100%;bottom:.5em;z-index:50}.tns-outer .tns-nav button{display:inline-block;margin:0 4px;padding:0;width:15px;height:15px;background:#fff;border-radius:50%;-webkit-box-shadow:0px 1px 6px 0px rgba(0,0,0,.2);box-shadow:0px 1px 6px 0px rgba(0,0,0,.2);-webkit-transition:all .2s ease-out;transition:all .2s ease-out;border:2px solid #fff}.tns-outer .tns-nav button:hover{-webkit-box-shadow:none;box-shadow:none}.tns-outer .tns-nav button.tns-nav-active{border:2px solid #0d8aff;-webkit-box-shadow:0px 0px 0px 2px #0d8aff;box-shadow:0px 0px 0px 2px #0d8aff}.tns-outer .tns-controls button[data-controls=prev],.tns-outer .tns-controls button[data-controls=next]{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);background:none;padding:0;border:0;z-index:60}.tns-outer .tns-controls button[data-controls=prev] .icon,.tns-outer .tns-controls button[data-controls=next] .icon{color:#3a3a3a;background:#fff;border-radius:50%;width:28px;height:28px;text-align:center;line-height:28px;opacity:.7;-webkit-transition:opacity .3s cubic-bezier(0.77, 0, 0.175, 1);transition:opacity .3s cubic-bezier(0.77, 0, 0.175, 1)}.tns-outer .tns-controls button[data-controls=prev]:hover,.tns-outer .tns-controls button[data-controls=next]:hover{-webkit-box-shadow:none;box-shadow:none}.tns-outer .tns-controls button[data-controls=prev]:hover .icon,.tns-outer .tns-controls button[data-controls=next]:hover .icon{opacity:1}.tns-outer .tns-controls button[data-controls=prev]:active .icon,.tns-outer .tns-controls button[data-controls=next]:active .icon{-webkit-transform:translateY(2px);transform:translateY(2px)}.tns-outer .tns-controls button[data-controls=prev][disabled] .icon,.tns-outer .tns-controls button[data-controls=next][disabled] .icon{opacity:.2}.tns-outer .tns-controls button[data-controls=prev][disabled]:active .icon,.tns-outer .tns-controls button[data-controls=next][disabled]:active .icon{-webkit-transform:none;transform:none}.tns-outer .tns-controls button[data-controls=prev]{left:15px}.tns-outer .tns-controls button[data-controls=next]{right:15px}.wpeo-form input,.wpeo-form textarea,.wpeo-form select{border:1px solid rgba(0,0,0,.2);font-size:14px;background:rgba(0,0,0,0);padding:0;margin:0;width:100%;padding:1em .5em;-webkit-box-shadow:none;box-shadow:none}.wpeo-form input:focus,.wpeo-form input:active,.wpeo-form textarea:focus,.wpeo-form textarea:active,.wpeo-form select:focus,.wpeo-form select:active{outline:none;-webkit-box-shadow:none;box-shadow:none}.wpeo-form select{padding:1em 0}.wpeo-form input[type=submit]{width:auto}.wpeo-form .group-date .mysql-date{display:none}.wpeo-form .wpeo-dropdown{display:block;width:100%}.wpeo-form .wpeo-dropdown .dropdown-toggle{width:100%;display:block;-webkit-transition:all .2s ease-out;transition:all .2s ease-out;border:0;font-size:14px;padding:1em 2em 1em 1em;margin:0}.wpeo-form .wpeo-dropdown .dropdown-toggle:hover{cursor:pointer}.wpeo-form .wpeo-dropdown .dropdown-toggle>.svg-inline--fa{position:absolute;right:1em;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.wpeo-form .form-element.disable .dropdown-toggle>.svg-inline--fa{display:none}.wpeo-form .wpeo-autocomplete{display:block;width:100%}.wpeo-form .wpeo-autocomplete .autocomplete-label{-webkit-box-shadow:none;box-shadow:none;padding:.74em 1em}.wpeo-form.form-light .wpeo-autocomplete .autocomplete-label{background:#fff}.wpeo-form.form-light .wpeo-autocomplete .autocomplete-label:hover{background:#ececec}.wpeo-form .form-element input[type=radio].form-field{display:inline-block;width:auto}.wpeo-form .form-element input[type=radio].form-field{-webkit-appearance:none;-moz-appearance:none;appearance:none;border-radius:50%;width:16px;height:16px;padding:0;border:0;background:rgba(0,0,0,0) !important;border:1px solid rgba(0,0,0,.4);-webkit-transition:.2s all linear;transition:.2s all linear;outline:none;position:relative;top:2px}.wpeo-form .form-element input[type=radio].form-field::before{display:none !important;content:"" !important}.wpeo-form .form-element input[type=radio].form-field:hover{cursor:pointer;border:1px solid #0d8aff;-webkit-box-shadow:0 0 0 1px #0d8aff inset;box-shadow:0 0 0 1px #0d8aff inset;background:rgba(0,0,0,0) !important}.wpeo-form .form-element input[type=radio].form-field:checked{border:1px solid #0d8aff;-webkit-box-shadow:0 0 0 4px #0d8aff inset;box-shadow:0 0 0 4px #0d8aff inset}.wpeo-form .form-element input[type=radio].form-field+label{text-transform:none;font-weight:400;font-size:14px;display:inline-block;margin-right:1em}.wpeo-form .form-element input[type=radio].form-field+label:hover{cursor:pointer}.wpeo-form .form-element input[type=radio].form-field+label:active{outline:none}.wpeo-form .form-element input[type=checkbox].form-field{display:inline-block;width:auto}.wpeo-form .form-element input[type=checkbox].form-field{width:auto;visibility:hidden;display:none}.wpeo-form .form-element input[type=checkbox].form-field+label{text-transform:none;font-weight:400;font-size:14px;display:inline-block;margin-right:1em;position:relative}.wpeo-form .form-element input[type=checkbox].form-field+label:hover{cursor:pointer}.wpeo-form .form-element input[type=checkbox].form-field+label:active{outline:none}.wpeo-form .form-element input[type=checkbox].form-field+label::before{display:inline-block;content:"";width:14px;height:14px;background:rgba(0,0,0,0);-webkit-box-shadow:0 0 0 1px rgba(0,0,0,.4);box-shadow:0 0 0 1px rgba(0,0,0,.4);border:2px solid #fff;-webkit-transition:all .2s ease-out;transition:all .2s ease-out;margin-right:.6em}.wpeo-form .form-element input[type=checkbox].form-field:not(:checked)+label:hover::before{-webkit-box-shadow:0 0 0 2px #0d8aff;box-shadow:0 0 0 2px #0d8aff}.wpeo-form .form-element input[type=checkbox].form-field:checked+label::before{-webkit-box-shadow:0 0 0 2px #0d8aff;box-shadow:0 0 0 2px #0d8aff;background:#0d8aff}.wpeo-form .form-element{width:100%}.wpeo-form .form-element .form-label{display:block;font-size:14px;font-weight:600;margin:.6em 0;color:rgba(0,0,0,.9)}.wpeo-form .form-element .form-field-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.wpeo-form .form-element .form-field-container:hover{-webkit-box-shadow:none;box-shadow:none}.wpeo-form .form-element .form-field{-webkit-transition:all .2s ease-out;transition:all .2s ease-out;border-radius:0}.wpeo-form .form-element .form-field:hover{-webkit-box-shadow:none;box-shadow:none}.wpeo-form .form-element .form-sublabel{font-size:12px;font-style:italic;color:rgba(0,0,0,.6)}.wpeo-form .form-element .form-field-inline{margin-right:.4em}.wpeo-form .form-element.form-align-vertical .form-field-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.wpeo-form .form-element.form-align-horizontal .form-field-container{-ms-flex-wrap:wrap;flex-wrap:wrap}.wpeo-form .form-element .form-field-container .form-field,.wpeo-form .form-element .form-field-container [class*=form-field-icon]{background:#ececec}.wpeo-form .form-element .form-field-container:hover .form-field,.wpeo-form .form-element .form-field-container:hover [class*=form-field-icon]{background:#dfdfdf}.wpeo-form .form-element [class*=form-field-label]{background:#dfdfdf}.wpeo-form.form-light .form-element .form-field-container .form-field,.wpeo-form.form-light .form-element .form-field-container [class*=form-field-icon]{background:#fff}.wpeo-form.form-light .form-element .form-field-container:hover .form-field,.wpeo-form.form-light .form-element .form-field-container:hover [class*=form-field-icon]{background:#ececec}.wpeo-form.form-light .form-element [class*=form-field-label]{background:#ececec}.wpeo-form .form-element [class*=form-field-icon]{padding:.8em 0 .8em .8em;color:rgba(0,0,0,.4);font-size:16px;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.wpeo-form .form-element [class*=form-field-icon] [class*=fa]{vertical-align:middle}.wpeo-form .form-element .form-field-icon-prev{padding:.8em 0 .8em .8em}.wpeo-form .form-element .form-field-icon-next{padding:.8em .8em .8em 0}.wpeo-form .form-element [class*=form-field-label]{padding:1.2em 1em;font-size:12px}.wpeo-form .form-element .form-field-label-prev{border-right:1px solid rgba(0,0,0,.1)}.wpeo-form .form-element .form-field-label-next{border-left:1px solid rgba(0,0,0,.1)}.wpeo-form .form-element.form-element-required .form-label::after{display:inline-block;content:"*";color:#e05353;padding:0 .4em}.wpeo-form .form-element.form-element-error .form-field-container{border:1px solid #e05353}.wpeo-form .form-element.form-element-disable .form-field-container{opacity:.6;pointer-events:none}.page-ut-gp-list{margin-left:-30px;-webkit-box-sizing:border-box;box-sizing:border-box;display:block !important;width:100%}.page-ut-gp-list *{-webkit-box-sizing:border-box;box-sizing:border-box}.page-ut-gp-list .fiche{margin-right:0 !important}.page-ut-gp-list #id-right{padding-left:300px;width:calc(100% + 30px);display:block}.page-ut-gp-list .side-nav{position:absolute;height:100%;top:0;padding-top:50px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:none;box-shadow:none}.page-ut-gp-list .side-nav .side-nav-responsive{display:none}.page-ut-gp-list .side-nav #id-left{width:300px;padding-top:0}.page-ut-gp-list .side-nav .digirisk-wrap{padding:0 !important}.page-ut-gp-list .side-nav .navigation-container{max-height:1000px;overflow-y:auto}.page-ut-gp-list .side-nav .add-container{position:absolute;right:0;bottom:5px;opacity:0;pointer-events:none;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.page-ut-gp-list .side-nav #id-left.active .add-container{opacity:1}.page-ut-gp-list .side-nav .society-header{padding-top:27px;position:relative;padding-left:10px;padding-right:10px}.page-ut-gp-list .side-nav .society-header .title{font-weight:700}.page-ut-gp-list .side-nav .society-header .linkElement{line-height:1;border-bottom:1px solid rgba(0,0,0,.2);padding-bottom:10px;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.page-ut-gp-list .side-nav .society-header:hover .add-container{opacity:1;pointer-events:all}.page-ut-gp-list .side-nav .toolbar{padding-left:10px;padding-right:10px}.page-ut-gp-list .side-nav .toolbar .toggle-plus,.page-ut-gp-list .side-nav .toolbar .toggle-minus{display:inline-block;padding:3px;-webkit-transition:all .2s ease-out;transition:all .2s ease-out;color:rgba(0,0,0,.6)}.page-ut-gp-list .side-nav .toolbar .toggle-plus:hover,.page-ut-gp-list .side-nav .toolbar .toggle-minus:hover{cursor:pointer;opacity:.6}.page-ut-gp-list .side-nav .workunit-list{padding-left:0}.page-ut-gp-list .side-nav .workunit-list ul,.page-ut-gp-list .side-nav .workunit-list li{list-style-type:none;margin:0}.page-ut-gp-list .side-nav .workunit-list>.unit:first-child>.unit-container:first-child>.title{border-top:1px solid rgba(0,0,0,.1)}.page-ut-gp-list .side-nav .workunit-list .unit-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.page-ut-gp-list .side-nav .workunit-list .unit-container:hover .add-container{opacity:1;pointer-events:all}.page-ut-gp-list .side-nav .workunit-list .unit-container .toggle-unit{color:rgba(0,0,0,.6);line-height:40px;font-size:18px;min-width:30px;width:30px;text-align:center;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.page-ut-gp-list .side-nav .workunit-list .unit-container .toggle-unit:hover{cursor:pointer}.page-ut-gp-list .side-nav .workunit-list .unit-container .toggle-unit .toggle-icon{line-height:40px}.page-ut-gp-list .side-nav .workunit-list .unit-container .spacer{position:relative;min-width:30px;width:30px}.page-ut-gp-list .side-nav .workunit-list .unit-container .spacer::before{display:block;position:absolute;content:"";height:1px;left:0;right:10px;top:20px;background:rgba(0,0,0,.3)}.page-ut-gp-list .side-nav .workunit-list .unit-container .photodigiriskdolibarr{display:block;width:40px;min-width:40px;height:40px;position:relative;background:#fff;text-align:center;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.page-ut-gp-list .side-nav .workunit-list .unit-container .divphotoref{max-width:50px;position:relative}.page-ut-gp-list .side-nav .workunit-list .unit-container .divphotoref .photo{-o-object-fit:cover;object-fit:cover;margin:0}.page-ut-gp-list .side-nav .workunit-list .unit-container .title{width:100%;padding-left:1em;display:-webkit-box;display:-ms-flexbox;display:flex;border-bottom:1px solid rgba(0,0,0,.1)}.page-ut-gp-list .side-nav .workunit-list .unit-container .title .linkElement{width:100%;padding-top:.5em;text-decoration:none}.page-ut-gp-list .side-nav .workunit-list .unit-container .title .linkElement:hover .name{color:#0d8aff}.page-ut-gp-list .side-nav .workunit-list .unit-container .title .title-container{margin:auto 0}.page-ut-gp-list .side-nav .workunit-list .unit-container .title .ref{font-size:10px;color:#fff;text-transform:uppercase;font-weight:600;display:inline-block;background:#263c5c;padding:.2em .4em}.page-ut-gp-list .side-nav .workunit-list .unit-container .title .name{font-size:14px;color:#000;display:block;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.page-ut-gp-list .side-nav .workunit-list .unit>.sub-list{padding:0 0 0 7px;display:none}.page-ut-gp-list .side-nav .workunit-list .unit>.sub-list>.unit:last-child::before{height:24px}.page-ut-gp-list .side-nav .workunit-list .unit>.sub-list .toggle-unit{position:relative}.page-ut-gp-list .side-nav .workunit-list .unit>.sub-list .toggle-unit::before{right:20px;display:block;position:absolute;content:"";height:1px;left:0;top:20px;background:rgba(0,0,0,.3)}.page-ut-gp-list .side-nav .workunit-list .unit>.sub-list .unit{position:relative;margin-left:.6em}.page-ut-gp-list .side-nav .workunit-list .unit>.sub-list .unit::before{display:block;position:absolute;content:"";width:1px;height:100%;left:0;top:0;background:rgba(0,0,0,.3)}.page-ut-gp-list .side-nav .workunit-list .unit.active>.unit-container .title{background:rgba(0,0,0,.1)}.page-ut-gp-list .side-nav .workunit-list .unit.active>.unit-container .title .name{font-weight:600}.page-ut-gp-list .side-nav .workunit-list .unit.type-workunit .unit-container .ref{background:#0d8aff}.page-ut-gp-list .side-nav .workunit-list .unit.toggled>.sub-list{display:block}.digirisk-signature-container{max-width:800px;background:#fff;-webkit-box-shadow:0 0 40px 0 rgba(0,0,0,.1);box-shadow:0 0 40px 0 rgba(0,0,0,.1);margin:1.5em auto 0 auto;padding:2em;-webkit-box-sizing:border-box;box-sizing:border-box}.digirisk-signature-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.digirisk-signature-container .signature .signature-element .wpeo-button.modal-signature-open{display:none}.digirisk-signature-container .signature .signature-element img{width:100%;height:auto;border:1px solid rgba(0,0,0,.4) !important}.ticketpublicarea .ticket-parentCategory{width:100%;height:100%}.ticketpublicarea .ticket-parentCategory .wpeo-button{width:100%;height:100%;padding:12px 14px}.ticketpublicarea .ticket-parentCategory .wpeo-button:hover{-webkit-box-shadow:inset 0 -4.6em rgba(255,255,255,.25);box-shadow:inset 0 -4.6em rgba(255,255,255,.25)}.ticketpublicarea .ticket-parentCategory .wpeo-button.button-yellow{border-color:#e88740;background:#e88740}.ticketpublicarea .ticket-parentCategory .wpeo-button.button-blue{border-color:#009cc2;background:#009cc2}.ticketpublicarea .ticket-parentCategory .wpeo-button.button-red{border-color:#c44b2a;background:#c44b2a}.ticketpublicarea .ticket-parentCategory.active .wpeo-button{border-color:#000 !important}.ticketpublicarea .ticket-subCategory{border:1px solid rgba(0,0,0,.2);padding:1em;text-align:center;width:100%;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.ticketpublicarea .ticket-subCategory:hover{cursor:pointer;background:rgba(0,0,0,.1)}.ticketpublicarea .ticket-subCategory.active{-webkit-box-shadow:inset 0 0 0px 3px #0d8aff;box-shadow:inset 0 0 0px 3px #0d8aff}.ticketpublicarea .ticket-subCategory .button-label{display:block;margin-top:.5em}.ticketpublicarea .form-registre .wpeo-button{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.ticketpublicarea .form-registre .wpeo-button>*{margin-top:auto;margin-bottom:auto}.ticketpublicarea .form-registre .wpeo-button .button-label{margin-left:.5em}.ticketpublicarea .tableforinputfields{margin-top:1em}.ticketpublicarea .tableforinputfields input{display:block;clear:both;width:100%;max-width:none;margin-bottom:1em}@media(max-width: 480px){.ticketpublicarea .tableforinputfields .inline-block{display:block}}.ticketpublicarea .tableforinputfields .inline-block input{display:inline-block}.ticketpublicarea .tableforinputfields .inline-block #options_digiriskdolibarr_ticket_date{max-width:80px}.page-ut-gp-list .organization{position:absolute;height:100%;top:0;padding-top:50px;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:none;box-shadow:none}.page-ut-gp-list .organization .side-nav-responsive{display:none}.page-ut-gp-list .organization #id-left{width:300px;padding-top:0}.page-ut-gp-list .organization .digirisk-wrap{padding:0 !important}.page-ut-gp-list .organization .navigation-container{max-height:1000px;overflow-y:auto}.page-ut-gp-list .organization .add-container{position:absolute;right:0;bottom:5px;opacity:0;pointer-events:none;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.page-ut-gp-list .organization .society-header{padding-top:27px;position:relative;padding-left:10px;padding-right:10px}.page-ut-gp-list .organization .society-header .title{font-weight:700}.page-ut-gp-list .organization .society-header .linkElement{line-height:1;border-bottom:1px solid rgba(0,0,0,.2);padding-bottom:10px;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.page-ut-gp-list .organization .society-header:hover .add-container{opacity:1;pointer-events:all}.page-ut-gp-list .organization .toolbar{padding-left:10px;padding-right:10px}.page-ut-gp-list .organization .toolbar .toggle-plus,.page-ut-gp-list .organization .toolbar .toggle-minus{display:inline-block;padding:3px;-webkit-transition:all .2s ease-out;transition:all .2s ease-out;color:rgba(0,0,0,.6)}.page-ut-gp-list .organization .toolbar .toggle-plus:hover,.page-ut-gp-list .organization .toolbar .toggle-minus:hover{cursor:pointer;opacity:.6}.page-ut-gp-list .organization .workunit-list{padding-left:0}.page-ut-gp-list .organization .workunit-list ul,.page-ut-gp-list .organization .workunit-list li{list-style-type:none;margin:0}.page-ut-gp-list .organization .workunit-list .unit-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.page-ut-gp-list .organization .workunit-list .unit-container:hover .add-container{opacity:1;pointer-events:all}.page-ut-gp-list .organization .workunit-list .unit-container .toggle-unit{color:rgba(0,0,0,.6);line-height:40px;font-size:18px;min-width:30px;width:30px;text-align:center;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.page-ut-gp-list .organization .workunit-list .unit-container .toggle-unit:hover{cursor:pointer}.page-ut-gp-list .organization .workunit-list .unit-container .toggle-unit .toggle-icon{line-height:40px}.page-ut-gp-list .organization .workunit-list .unit-container .spacer{position:relative;min-width:30px;width:30px}.page-ut-gp-list .organization .workunit-list .unit-container .spacer::before{display:block;position:absolute;content:"";height:1px;left:0;right:10px;top:20px;background:rgba(0,0,0,.3)}.page-ut-gp-list .organization .workunit-list .unit-container .photodigiriskdolibarr{display:block;width:40px;min-width:40px;height:40px;position:relative;background:#fff;text-align:center;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.page-ut-gp-list .organization .workunit-list .unit-container .title{width:100%;padding-left:1em;display:-webkit-box;display:-ms-flexbox;display:flex}.page-ut-gp-list .organization .workunit-list .unit-container .title .title-container{margin:auto 0}.page-ut-gp-list .organization .workunit-list .unit-container .title .ref{font-size:10px;color:#fff;text-transform:uppercase;font-weight:600;display:inline-block;background:#263c5c;padding:.2em .4em}.page-ut-gp-list .organization .workunit-list .unit-container .title .name{font-size:14px;color:#000;display:block}.page-ut-gp-list .organization .workunit-list .unit>.unit-container{padding:4px 0 0 0;border:solid}.page-ut-gp-list .organization .workunit-list .unit>.sub-list{padding:0 0 0 7px;display:none}.page-ut-gp-list .organization .workunit-list .unit>.sub-list>.unit:last-child::before{height:24px}.page-ut-gp-list .organization .workunit-list .unit>.sub-list .toggle-unit{position:relative}.page-ut-gp-list .organization .workunit-list .unit>.sub-list .toggle-unit::before{right:20px;display:block;position:absolute;content:"";height:1px;left:0;top:20px;background:rgba(0,0,0,.3)}.page-ut-gp-list .organization .workunit-list .unit>.sub-list .unit{position:relative;margin-left:.6em}.page-ut-gp-list .organization .workunit-list .unit>.sub-list .unit::before{display:block;position:absolute;content:"";width:1px;height:100%;left:0;top:0;background:rgba(0,0,0,.3)}.page-ut-gp-list .organization .workunit-list .unit.active>.unit-container .title{background:rgba(0,0,0,.1)}.page-ut-gp-list .organization .workunit-list .unit.active>.unit-container .title .name{font-weight:600}.page-ut-gp-list .organization .workunit-list .unit.type-workunit .unit-container .ref{background:#0d8aff}.page-ut-gp-list .organization .workunit-list .unit.toggled>.sub-list{display:block}@media(max-width: 1200px){#id-container.page-ut-gp-list .organization{position:static;height:auto;padding:0 2em;background:none;border:0}#id-container.page-ut-gp-list .organization .side-nav-responsive{display:block;background:#263c5c;color:#fff;border-radius:6px;padding:.6em 1em;font-weight:600;font-size:14px;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}#id-container.page-ut-gp-list .organization .side-nav-responsive:hover{cursor:pointer;background:#446ba4}#id-container.page-ut-gp-list .organization #id-left{opacity:0;pointer-events:none;position:absolute;z-index:999;background:#efefef;border:1px solid rgba(0,0,0,.1);-webkit-box-shadow:0 0 40px 0 rgba(0,0,0,.1);box-shadow:0 0 40px 0 rgba(0,0,0,.1);-webkit-transition:all .2s ease-out;transition:all .2s ease-out;-webkit-transform:translateY(-10px);transform:translateY(-10px);max-height:500px;overflow-y:auto}#id-container.page-ut-gp-list .organization #id-left.active{opacity:1;pointer-events:auto;-webkit-transform:translateY(0px);transform:translateY(0px)}#id-container.page-ut-gp-list #id-right{padding-left:0}}.container{position:relative;min-height:500px}.container h3{position:absolute;border:0;margin:0;padding:20px 0;width:400px;pointer-events:none;margin-left:0px;width:100%}.route{position:relative;list-style-type:none;border:0;margin:0;padding:0;top:0px;margin-top:0px;max-height:100% !important;width:100%;background:#bcf;border-radius:2px;z-index:-1}.route span{position:absolute;top:26px;left:20px;-webkit-transform:scale(2);transform:scale(2);z-index:10;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.route span:hover{cursor:pointer;opacity:.6}.route .title{font-size:16px}.route .title .ref{position:static;top:auto;left:auto;-webkit-transform:none;transform:none;font-size:12px;border-radius:4px;padding:4px 6px;margin-right:.8em}.route .title.workunit{position:absolute;border:0;margin:0;padding:20px 0;width:400px;text-indent:60px;background:#ebebeb;border:1px solid rgba(0,0,0,.2);pointer-events:none}.route .title.workunit>.ref{background:#0d8aff;color:#fff}.route .title.groupment{position:absolute;border:0;margin:0;width:400px;text-indent:60px;background:#ebebeb;border:1px solid rgba(0,0,0,.2);pointer-events:none}.route .title.groupment>.ref{background:#263c5c;color:#fff}.first-title{margin-left:10px}.space{position:relative;list-style-type:none;border:0;margin:0;padding:0;margin-left:40px;width:30px;top:68px;padding-bottom:68px;height:100%;z-index:1}.space.space-0{margin-left:0}.table-cell-header{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:.5em}.table-cell-header>*{margin:auto 0}.table-cell-header .wpeo-button{margin:0}.risk-container .risk-edit{color:#263c5c}.risk-container .risk-edit:hover{cursor:pointer;text-decoration:underline}.risk-container .risk-edit-no-perm{color:#333}.risk-container .risk-edit-no-perm:hover{cursor:auto;text-decoration:none}.risk-category{text-align:center}.risk-description{width:25% !important}.risksign-container .risksign-edit{color:#263c5c}.risksign-container .risksign-edit:hover{cursor:pointer;text-decoration:underline}.risksign-content{width:100%}.risksign-add{min-width:40px;margin-left:.5em}.riskassessment-tasks .riskassessment-task-container,.riskassessment-task-container{min-width:430px;border:1px solid rgba(0,0,0,.1);background:rgba(0,0,0,.05);padding:.5em}.riskassessment-tasks{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.riskassessment-tasks .riskassessment-task-container{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.riskassessment-tasks .riskassessment-task-add-wrapper{min-width:calc(40px + .5em);margin:auto 0;text-align:center}.riskassessment-task-listing-wrapper .riskassessment-task-container{margin-bottom:.5em}.riskassessment-task-container .riskassessment-task-single{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box}.riskassessment-task-container .riskassessment-task-single *{-webkit-box-sizing:border-box;box-sizing:border-box}.riskassessment-task-container .riskassessment-task-single>*{margin-top:auto;margin-bottom:auto}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content{width:100%}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-author{display:inline-block;width:25px;min-width:25px;height:25px;line-height:25px;background:rgba(0,0,0,.5);overflow:hidden;text-transform:uppercase;font-size:14px;font-weight:600;border-radius:50%;vertical-align:sub;text-align:center}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-author a{color:#fff !important}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-author-label{word-break:break-all}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;font-size:14px}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data>*{margin:auto .2em}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-reference{color:#263c5c;font-weight:600}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-reference:hover{text-decoration:underline;cursor:pointer}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-count{background:rgba(0,0,0,.2);font-size:12px;border-radius:4px;padding:.2em .4em}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress{background:rgba(0,0,0,.2);font-size:12px;border-radius:4px;padding:.2em .4em;font-weight:700;color:rgba(0,0,0,.6)}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-0{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-1{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-2{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-3{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-4{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-5{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-6{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-7{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-8{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-9{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-10{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-11{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-12{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-13{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-14{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-15{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-16{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-17{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-18{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-19{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-20{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-21{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-22{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-23{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-24{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-25{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-26{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-27{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-28{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-29{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-30{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-31{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-32{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-33{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-34{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-35{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-36{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-37{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-38{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-39{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-40{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-41{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-42{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-43{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-44{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-45{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-46{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-47{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-48{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-49{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-50{background:#e05353;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-51{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-52{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-53{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-54{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-55{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-56{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-57{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-58{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-59{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-60{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-61{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-62{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-63{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-64{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-65{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-66{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-67{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-68{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-69{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-70{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-71{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-72{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-73{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-74{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-75{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-76{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-77{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-78{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-79{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-80{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-81{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-82{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-83{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-84{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-85{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-86{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-87{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-88{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-89{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-90{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-91{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-92{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-93{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-94{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-95{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-96{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-97{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-98{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-99{background:#e9ad4f;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-content .riskassessment-task-data .riskassessment-task-progress.progress-100{background:#47e58e;color:#fff}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-title{display:-webkit-box;display:-ms-flexbox;display:flex}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-title .riskassessment-task-progress-checkbox{margin:auto 0}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-title .riskassessment-task-progress-checkbox input{width:20px;height:20px}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-add{min-width:40px;margin-left:.5em}.riskassessment-task-container .riskassessment-task-single .riskassessment-task-delete{margin-right:-0.5em}.riskassessment-task-listing-wrapper{width:100%}.riskassessment-task-add{margin:5px}.riskassessment-task-list{margin:5px}.riskassessment-task-timespent-add-container{display:-webkit-box;display:-ms-flexbox;display:flex;background:rgba(0,0,0,.1);padding:10px;margin-bottom:25px}.riskassessment-task-timespent-add-container>*{margin:auto 5px}.riskassessment-task-timespent-add-container .timespent-comment{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.riskassessment-task-timespent-add-container .timespent-date{min-width:250px}.riskassessment-task-timespent-add-container .timespent-duration{max-width:100px}.riskassessment-task-timespent-add-container .timespent-add-button{min-width:30px}.riskassessment-task-timespent-add-container .timespent-add-button .wpeo-button{margin-top:20px}.riskassessment-task-timespent-container .riskassessment-task .riskassessment-task-container{background:#fff;border:0}td>.risk-evaluation-container{min-width:340px;border:1px solid rgba(0,0,0,.1);background:rgba(0,0,0,.05);padding:.5em;margin-bottom:.5em}.risk-evaluation-container .risk-evaluation-single{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box}.risk-evaluation-container .risk-evaluation-single *{-webkit-box-sizing:border-box;box-sizing:border-box}.risk-evaluation-container .risk-evaluation-single>*{margin-top:auto;margin-bottom:auto}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-cotation{width:40px;min-width:40px;height:40px;line-height:40px}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo{width:40px;min-width:40px;height:40px;line-height:40px;text-align:center;background:#ececec;color:rgba(0,0,0,.3);margin-right:.5em}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo .photodigiriskdolibarr{width:100%;height:auto;background:#fff}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo a,.risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo .divphotoref{width:40px;min-width:40px;height:40px;position:relative;display:block}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo a .photo,.risk-evaluation-container .risk-evaluation-single .risk-evaluation-photo .divphotoref .photo{position:absolute;top:0;left:0;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content{width:100%}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-author{display:inline-block;width:25px;min-width:25px;height:25px;line-height:25px;background:rgba(0,0,0,.5);overflow:hidden;text-transform:uppercase;font-size:14px;font-weight:600;border-radius:50%;vertical-align:sub;text-align:center}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-author a{color:#fff !important}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-data{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-data>*{margin:auto .2em}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-data .risk-evaluation-reference{color:#263c5c;font-weight:600}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-data .risk-evaluation-reference:hover{text-decoration:underline;cursor:pointer}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-content .risk-evaluation-data .risk-evaluation-count{background:rgba(0,0,0,.2);font-size:12px;border-radius:4px;padding:.2em .4em}.risk-evaluation-container .risk-evaluation-single .risk-evaluation-button{margin-left:.5em}.wpeo-table.evaluation-method{background:none !important}@media(max-width: 480px){.wpeo-table.evaluation-method .table-row.table-header{display:none}}.wpeo-table.evaluation-method .table-cell{margin:0;text-align:center;border:1px solid rgba(0,0,0,.1);padding:.8em .4em;position:relative}@media(max-width: 480px){.wpeo-table.evaluation-method .table-cell{width:100% !important}}.wpeo-table.evaluation-method .table-cell.can-select::after,.wpeo-table.evaluation-method .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .table-cell.risk-evaluation-cotation::after,.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .wpeo-table.evaluation-method .table-cell.risk-evaluation-cotation::after{display:block;content:"";position:absolute;top:.4em;right:.4em;bottom:.4em;left:.4em;background:rgba(0,0,0,.1);-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.wpeo-table.evaluation-method .table-cell.can-select:hover,.wpeo-table.evaluation-method .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .table-cell.risk-evaluation-cotation:hover,.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .wpeo-table.evaluation-method .table-cell.risk-evaluation-cotation:hover{cursor:pointer}.wpeo-table.evaluation-method .table-cell.can-select:hover::after,.wpeo-table.evaluation-method .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .table-cell.risk-evaluation-cotation:hover::after,.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .wpeo-table.evaluation-method .table-cell.risk-evaluation-cotation:hover::after{-webkit-transform:scale(1);transform:scale(1);opacity:1}.wpeo-table.evaluation-method .table-cell.can-select.active,.wpeo-table.evaluation-method .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .table-cell.active.risk-evaluation-cotation,.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .wpeo-table.evaluation-method .table-cell.active.risk-evaluation-cotation{color:#fff}.wpeo-table.evaluation-method .table-cell.can-select.active::after,.wpeo-table.evaluation-method .wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .table-cell.active.risk-evaluation-cotation::after,.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard .wpeo-table.evaluation-method .table-cell.active.risk-evaluation-cotation::after{-webkit-transform:scale(1) !important;transform:scale(1) !important;opacity:1 !important;background:#0d8aff;z-index:-1}.wpeo-table.evaluation-method .table-row>.table-cell:first-child{background:#263c5c;color:#fff}@media(max-width: 480px){.wpeo-table.evaluation-method .table-row>.table-cell:first-child{background:#263c5c}}.wpeo-table.evaluation-method .table-row:not(.header) .table-cell:nth-of-type(2).active::after{background:#0d8aff}.wpeo-table.evaluation-method .table-row:not(.header) .table-cell:nth-of-type(3).active::after{background:#0063c0}.wpeo-table.evaluation-method .table-row:not(.header) .table-cell:nth-of-type(4).active::after{background:#003b73}.wpeo-table.evaluation-method .table-row:not(.header) .table-cell:nth-of-type(5).active::after{background:#001427}.wpeo-table.evaluation-method .table-row:not(.header) .table-cell:nth-of-type(6).active::after{background:#000}.wpeo-modal[class*=modal-risk] .modal-container .title{display:block;font-weight:600;font-size:13px;margin-bottom:.6em;color:rgba(0,0,0,.8)}.wpeo-modal[class*=modal-risk] .modal-container .title required{font-size:18px;color:#0d8aff;vertical-align:text-top;line-height:.9}.wpeo-modal[class*=modal-risk] .modal-container .section-title{font-size:16px;color:rgba(0,0,0,.8);font-weight:600;margin-bottom:.6em;display:block}.wpeo-modal[class*=modal-risk] .modal-container .maxwidthdate{max-width:125px}.wpeo-modal[class*=modal-risk] .modal-container .risk-content{display:-webkit-box;display:-ms-flexbox;display:flex;padding-bottom:1em;margin-bottom:1em;border-bottom:1px solid rgba(0,0,0,.2)}.wpeo-modal[class*=modal-risk] .modal-container .risk-content .risk-category{margin-right:1.5em}.wpeo-modal[class*=modal-risk] .modal-container .risk-content .risk-category .dropdown-toggle::after{display:none}.wpeo-modal[class*=modal-risk] .modal-container .risk-content .risk-description{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.wpeo-modal[class*=modal-risk] .modal-container .risk-content .risk-description textarea{width:100%}.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container{padding-bottom:1em;margin-bottom:1em;border-bottom:1px solid rgba(0,0,0,.2)}.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-header{margin-bottom:1em}.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .cotation-standard{margin-right:1em}.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .risk-evaluation-photo img{max-width:50px}.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .risk-evaluation-comment{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;margin-left:1em}.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container .risk-evaluation-content-wrapper .risk-evaluation-comment textarea{width:100%}.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container.advanced .risk-evaluation-content-wrapper{-ms-flex-wrap:wrap;flex-wrap:wrap}.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container.advanced .risk-evaluation-content{width:100%;margin-bottom:1em}.wpeo-modal[class*=modal-risk] .modal-container .risk-evaluation-container.advanced .risk-evaluation-photo{margin-right:1em}.wpeo-modal .modal-container .risk-evaluations-list .risk-evaluation>.risk-evaluation-container{display:-webkit-box;display:-ms-flexbox;display:flex}.wpeo-modal .modal-container .risk-evaluations-list .risk-evaluation>.risk-evaluation-container .risk-evaluation-single{width:100%}.wpeo-modal .modal-container .risk-evaluations-list .risk-evaluation>.risk-evaluation-container .risk-evaluation-single .risk-evaluation-reference{color:#333}.wpeo-modal .modal-container .risk-evaluations-list .risk-evaluation>.risk-evaluation-container .risk-evaluation-single .risk-evaluation-reference:hover{cursor:auto;text-decoration:none}.wpeo-modal .modal-container .risk-evaluations-list .risk-evaluation>.risk-evaluation-container .risk-evaluation-actions{margin-left:auto}.wpeo-modal[class*=modal-risksign] .modal-container .title{display:block;font-weight:600;font-size:13px;margin-bottom:.6em;color:rgba(0,0,0,.8)}.wpeo-modal[class*=modal-risksign] .modal-container .title required{font-size:18px;color:#0d8aff;vertical-align:text-top;line-height:.9}.wpeo-modal[class*=modal-risksign] .modal-container .section-title{font-size:16px;color:rgba(0,0,0,.8);font-weight:600;margin-bottom:.6em;display:block}.wpeo-modal[class*=modal-risksign] .modal-container .risksign-content{display:-webkit-box;display:-ms-flexbox;display:flex;padding-bottom:1em;margin-bottom:1em;border-bottom:1px solid rgba(0,0,0,.2)}.wpeo-modal[class*=modal-risksign] .modal-container .risksign-content .risksign-category{margin-right:1.5em}.wpeo-modal[class*=modal-risksign] .modal-container .risksign-content .risksign-category .dropdown-toggle::after{display:none}.wpeo-modal[class*=modal-risksign] .modal-container .risksign-content .risksign-description{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.wpeo-modal[class*=modal-risksign] .modal-container .risksign-content .risksign-description textarea{width:100%}.wpeo-modal[class*=modal-riskassessment-task] .modal-container .title{display:block;font-weight:600;font-size:13px;margin-bottom:.6em;color:rgba(0,0,0,.8)}.wpeo-modal[class*=modal-riskassessment-task] .modal-container .title required{font-size:18px;color:#0d8aff;vertical-align:text-top;line-height:.9}.wpeo-modal[class*=modal-riskassessment-task] .modal-container .section-title{font-size:16px;color:rgba(0,0,0,.8);font-weight:600;margin-bottom:.6em;display:block}.wpeo-modal[class*=modal-riskassessment-task] .modal-container .riskassessment-task-single{display:block !important}.wpeo-modal[class*=modal-riskassessment-task] .modal-container .riskassessment-task-container{display:-webkit-box;display:-ms-flexbox;display:flex;padding-bottom:1em;margin-bottom:1em;border-bottom:1px solid rgba(0,0,0,.2)}.wpeo-modal[class*=modal-riskassessment-task] .modal-container .riskassessment-task-container .riskassessment-task{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.wpeo-modal[class*=modal-riskassessment-task] .modal-container .riskassessment-task-container .riskassessment-task input{width:100%}.wpeo-modal .modal-container .riskassessment-task-list .riskassessment-task>.riskassessment-task-container{display:-webkit-box;display:-ms-flexbox;display:flex}.wpeo-modal .modal-container .riskassessment-task-list .riskassessment-task>.riskassessment-task-container .riskassessment-task-single{width:100%}.wpeo-modal .modal-container .riskassessment-task-list .riskassessment-task>.riskassessment-task-container .riskassessment-task-actions{margin-left:auto}#dialog-confirm-actionButtonImportSharedRisks .confirmtext{text-align:center;padding:.2em 0 .4em 0}#dialog-confirm-actionButtonImportSharedRisks .tagtable{border-collapse:collapse}#dialog-confirm-actionButtonImportSharedRisks .tagtr{border-bottom:1px solid rgba(0,0,0,.2)}#dialog-confirm-actionButtonImportSharedRisks .tagtd{padding:.3em 0}#dialog-confirm-actionButtonImportSharedRisks .tagtr>.tagtd:first-child{display:-webkit-box;display:-ms-flexbox;display:flex}#dialog-confirm-actionButtonImportSharedRisks .tagtr>.tagtd:first-child .importsharedrisk:not(.imported):not(.risk-evaluation-cotation){width:30%}#dialog-confirm-actionButtonImportSharedRisks .tagtr>.tagtd:first-child .importsharedrisk.imported{width:10%;text-align:center;font-size:12px}#dialog-confirm-actionButtonImportSharedRisks .tagtr>.tagtd:first-child .importsharedrisk img{float:left;margin-right:.4em;max-width:35px}#dialog-confirm-actionButtonImportSharedRisks .tagtr>.tagtd:first-child .importsharedrisk>span{display:block}#dialog-confirm-actionButtonImportSharedRisks .tagtr>.tagtd:first-child .importsharedrisk .importsharedrisk-ref{font-weight:600}#dialog-confirm-actionButtonImportSharedRisks .tagtr>.tagtd:last-child{vertical-align:middle}#dialog-confirm-actionButtonImportSharedRiskSigns .confirmtext{text-align:center;padding:.2em 0 .4em 0}#dialog-confirm-actionButtonImportSharedRiskSigns .tagtable{border-collapse:collapse}#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr{border-bottom:1px solid rgba(0,0,0,.2)}#dialog-confirm-actionButtonImportSharedRiskSigns .tagtd{padding:.3em 0}#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr>.tagtd:first-child{display:-webkit-box;display:-ms-flexbox;display:flex}#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr>.tagtd:first-child .importsharedrisksign:not(.imported){width:30%}#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr>.tagtd:first-child .importsharedrisksign.imported{width:10%;text-align:center;font-size:12px}#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr>.tagtd:first-child .importsharedrisksign img{float:left;margin-right:.4em;max-width:35px}#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr>.tagtd:first-child .importsharedrisksign>span{display:block}#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr>.tagtd:first-child .importsharedrisksign .importsharedrisksign-ref{font-weight:600}#dialog-confirm-actionButtonImportSharedRiskSigns .tagtr>.tagtd:last-child{vertical-align:middle}.wpeo-modal.modal-photo.modal-active{z-index:2014}.wpeo-modal.modal-photo .clickable-photo{border:5px solid #fff;-webkit-transition:all .2s ease-out;transition:all .2s ease-out;width:100%}.wpeo-modal.modal-photo .clickable-photo:hover{cursor:pointer}.wpeo-modal.modal-photo .clickable-photo:hover .photo-image .photo{opacity:.8}.wpeo-modal.modal-photo .clickable-photo .photo-image{position:relative;width:100%;max-width:120px;height:120px;margin:auto}.wpeo-modal.modal-photo .clickable-photo .photo-image .photo{position:absolute;top:0;left:0;width:100%;-o-object-fit:cover;object-fit:cover;max-width:none !important;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.wpeo-modal.modal-photo .clickable-photo .photo-image .clicked-photo-preview{position:absolute;display:inline-block;top:1em;right:1em;z-index:900;height:25px;line-height:25px;background:#fff;color:#0d8aff;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}.wpeo-modal.modal-photo .clickable-photo .photo-image .clicked-photo-preview:hover{-webkit-transform:scale(1.1);transform:scale(1.1)}.wpeo-modal.modal-photo .clickable-photo .photo-image .clicked-photo-preview i{line-height:25px;font-size:14px}.wpeo-modal.modal-photo .clickable-photo .title{word-break:break-all}.wpeo-modal.modal-photo .formattachnewfile{padding-bottom:.5em}.wpeo-modal.modal-photo input[type=file]{border-bottom:0 !important}.evaluator-add-modal .time{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.risk-evaluation-add-modal .modal-active,.risk-evaluation-edit-modal .modal-active{z-index:1005}.risk-evaluation-add-modal .modal-container,.risk-evaluation-edit-modal .modal-container{max-height:750px}.wpeo-modal .modal-container ul,.wpeo-modal .modal-container li{margin:0;list-style-type:none;padding:0}@media(max-width: 1200px){#id-container .side-nav .vmenu{width:30px;padding-right:0 !important;overflow:hidden}#id-container .side-nav .vmenu .menu_titre .vmenu i{margin-right:2em}#id-container .side-nav .vmenu #blockvmenusearch .select2-container--default .select2-selection--single .select2-selection__placeholder::before{display:inline-block;content:"";font-family:"Font Awesome 5 Free";font-weight:600;margin-right:2em}}@media(max-width: 1200px){#id-container.page-ut-gp-list .side-nav{position:static;height:auto;padding:0 2em;background:none;border:0}#id-container.page-ut-gp-list .side-nav .side-nav-responsive{display:block;background:#263c5c;color:#fff;border-radius:6px;padding:.6em 1em;font-weight:600;font-size:14px;-webkit-transition:all .2s ease-out;transition:all .2s ease-out}#id-container.page-ut-gp-list .side-nav .side-nav-responsive:hover{cursor:pointer;background:#446ba4}#id-container.page-ut-gp-list .side-nav #id-left{position:absolute;z-index:999;background:#efefef;border:1px solid rgba(0,0,0,.1);-webkit-box-shadow:0 0 40px 0 rgba(0,0,0,.1);box-shadow:0 0 40px 0 rgba(0,0,0,.1);-webkit-transition:all .2s ease-out;transition:all .2s ease-out;max-height:500px;overflow-y:auto}#id-container.page-ut-gp-list .side-nav #id-left:not(.active){opacity:0;pointer-events:none;-webkit-transform:translateY(-10px);transform:translateY(-10px)}#id-container.page-ut-gp-list .side-nav #id-left:not(.active) .wpeo-button{pointer-events:none}#id-container.page-ut-gp-list #id-right{padding-left:0}}@media(max-width: 1200px){td>.riskassessment-task-container{min-width:0}}@media(max-width: 1200px){td>.risk-evaluation-container{min-width:0}}.preview-photo{z-index:2100 !important}.imgTabTitle{max-height:32px !important}.dropdown-toggle::after{display:none}.favorite-photo{border:5px solid #0d8aff}tr.liste_titre th.liste_titre:not(.maxwidthsearch),tr.liste_titre td.liste_titre:not(.maxwidthsearch){opacity:1}@media only screen and (max-width: 1600px){div.fichecenter{width:100%;clear:both}div.fichecenterbis{margin-top:8px}div.fichethirdleft{float:none;width:auto;padding-bottom:6px}div.fichetwothirdright{float:none;width:auto;padding-bottom:6px}div.fichehalfleft{float:none;width:auto}div.fichehalfright{float:none;width:auto}div.fichehalfright{margin-top:10px}div.firstcolumn div.box{padding-right:0px}div.secondcolumn div.box{padding-left:0px}} \ No newline at end of file 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 @@ + classe de base pour un bouton + * .primary + * .light + * .dark + * .red + * .yellow + * .blue + * .green + * .transparent + * .bordered -> Change l'affichage du bouton. Fonctionne avec les même couleurs + * .strong -> texte en gras + * .uppercase -> texte en majuscule + * .float-right -> float right + * .float-left -> float left + * .square-30 -> bouton carré 30px + * .square-40 -> bouton carré 40px + * .square-50 -> bouton carré 50px + * .square-60 -> bouton carré 60px + * .margin -> margin haut et bas sur le bouton + * .radius-1 -> Arrondis les bords + * .radius-3 -> Arrondis les bords + * .radius-3 -> Arrondis les bords + * .rounded -> bouton en forme de rond + * .disable -> désactive les actions sur le bouton + * .size-small -> petite taille + * .size-large -> grande taille +--------------------------------------------------------------*/ + +.wpeo-button { + display: inline-block; + border: 0; + box-shadow: none; + background: none; + text-decoration: none; + padding: 6px 14px; + line-height: 1.4; + vertical-align: middle; + height: auto; + border-radius: 0; + transition: all 0.2s ease-out; + position: relative; + border-width: 3px; + border-style: solid; + font-size: 16px; + box-sizing: border-box; + + background: $color__primary; + border-color: $color__primary; + color: #fff; + + &:focus, &:visited { + color: #fff; + } + &:hover { + color: #fff; + box-shadow: inset 0 -2.6em rgba(255,255,255,0.25); + cursor: pointer; + text-decoration: none; + } + &:focus, &:active { + outline: none; + } +} + +/** Colors */ +@import "colors"; +@import "button-add"; + +// Icon +.wpeo-button { + .button-icon, span { + position: relative; + } + .button-icon ~ span { + margin-left: 10px; + } + span ~ .button-icon { + margin-left: 10px; + } +} + +// Strong +.wpeo-button.button-strong { + span { + font-weight: 800; + } +} + +// Uppercase +.wpeo-button.button-uppercase { + span { + text-transform: uppercase; + font-size: 14px; + } +} + +// Squared +.wpeo-button[class*="button-square-"] { + text-align: center; + overflow: hidden; + padding: 0; +} +.wpeo-button.button-square-30 { + width: 30px; + height: 30px; + line-height: 24px; // ne pas oublier les bordures : 6px + + .button-icon { + font-size: 12px; + line-height: 24px; + } +} +.wpeo-button.button-square-40 { + width: 40px; + height: 40px; + line-height: 34px; // ne pas oublier les bordures : 6px + + .button-icon { + line-height: 34px; + } +} +.wpeo-button.button-square-50 { + width: 50px; + height: 50px; + line-height: 44px; // ne pas oublier les bordures : 6px + + .button-icon { + line-height: 44px; + } +} +.wpeo-button.button-square-60 { + width: 60px; + height: 60px; + line-height: 54px; // ne pas oublier les bordures : 6px + + .button-icon { + line-height: 54px; + } +} + +// Floats +.wpeo-button { + &.button-float-left { + float: left; + } + &.button-float-right { + float: right; + } +} + +// margin +.wpeo-button.button-margin { + margin: 1em 0; +} + +// radius +.wpeo-button { + &.button-radius-1 { + border-radius: 2px; + } + &.button-radius-2 { + border-radius: 4px; + } + &.button-radius-3 { + border-radius: 6px; + } + &.button-rounded { + border-radius: 50%; + } +} + +// disable +.wpeo-button.button-disable { + background: $color__grey !important; + border-color: $color__grey !important; + color: rgba(0,0,0,0.4) !important; + pointer-events: none; + + &:hover { + box-shadow: none !important; + } + &.button-event { + pointer-events: all; + } +} + +// Taille +.wpeo-button.button-size-small { + font-size: 14px; + &.button-uppercase span { + font-size: 12px; + } +} +.wpeo-button.button-size-large { + font-size: 18px; + &.button-uppercase span { + font-size: 16px; + } +} diff --git a/css/scss/module/button/_colors.scss b/css/scss/module/button/_colors.scss new file mode 100644 index 0000000..7c0e446 --- /dev/null +++ b/css/scss/module/button/_colors.scss @@ -0,0 +1,138 @@ +// Bouton plein +.wpeo-button { + /* par défaut */ + background: $color__primary; + border-color: $color__primary; + color: $color__primary-text; + + &.button-main { + background: $color__primary; + border-color: $color__primary; + color: $color__primary-text; + } + &.button-secondary { + background: $color__secondary; + border-color: $color__secondary; + color: $color__secondary-text; + } + &.button-light { + background: #fff; + border-color: #fff; + color: $color__text-main; + &:hover { + box-shadow: inset 0 -2.6em rgba(0,0,0,0.1); + color: $color__text-main; + } + } + &.button-dark { + background: $color__dark; + border-color: $color__dark; + } + &.button-grey { + background: $color__grey; + border-color: $color__grey; + color: $color__text-main; + &:hover { + box-shadow: inset 0 -2.6em rgba(0,0,0,0.1); + color: $color__text-main; + } + } + &.button-red { + background: $color__red; + border-color: $color__red; + } + &.button-yellow { + background: $color__yellow; + border-color: $color__yellow; + } + &.button-blue { + background: $color__blue; + border-color: $color__blue; + } + &.button-green { + background: $color__green; + border-color: $color__green; + } + &.button-transparent { + background: transparent; + border-color: transparent; + color: rgba($color__text-main, 0.4); + &:hover { + color: $color__text-main; + box-shadow: inset 0 -2.6em rgba(255,255,255,0); + } + } +} + +// Bordered +.wpeo-button.button-bordered { + background: none; + /* Par defaut */ + border-color: $color__primary; + color: $color__primary; + + &.button-main { + border-color: $color__primary; + color: $color__primary; + &:hover { + box-shadow: inset 0 -2.6em $color__primary; + color: $color__primary-text; + } + } + &.button-light { + border-color: #fff; + color: #fff; + &:hover { + box-shadow: inset 0 -2.6em #fff; + color: $color__text-main; + } + } + &.button-dark { + border-color: $color__dark; + color: $color__dark; + &:hover { + box-shadow: inset 0 -2.6em $color__dark; + } + } + &.button-grey { + border-color: $color__grey; + color: darken($color__grey, 30%); + &:hover { + box-shadow: inset 0 -2.6em $color__grey; + color: $color__text-main; + } + } + &.button-red { + border-color: $color__red; + color: $color__red; + &:hover { + box-shadow: inset 0 -2.6em $color__red; + } + } + &.button-yellow { + border-color: $color__yellow; + color: $color__yellow; + &:hover { + box-shadow: inset 0 -2.6em $color__yellow; + } + } + &.button-blue { + border-color: $color__blue; + color: $color__blue; + &:hover { + box-shadow: inset 0 -2.6em $color__blue; + } + } + &.button-green { + border-color: $color__green; + color: $color__green; + &:hover { + box-shadow: inset 0 -2.6em $color__green; + } + } + + &:hover { + box-shadow: inset 0 -2.6em $color__primary; + color: #fff; + } +} diff --git a/css/scss/module/button/index.php b/css/scss/module/button/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/css/scss/module/button/index.php @@ -0,0 +1,2 @@ + classe de base du mobule + .grid -> Affichage en grille + .list -> Affichage en liste +--------------------------------------------------------------*/ + +.wpeo-dropdown { + position: relative; + display: inline-block; + + .dropdown-toggle { + display: inline-block; + + span ~ *[class*="icon"]{ + margin-left: 10px; + } + } + .dropdown-content { + opacity: 0; + pointer-events: none; + transform: translateY(-10px); + transition: all 0.2s ease-out; + position: absolute; + background: #fff; + z-index: 99; + border: 1px solid rgba(0,0,0,0.1); + box-shadow: 0 0 10px 0px rgba(0,0,0,0.3); + width: 220px; + padding: 0.6em; + } + &.dropdown-active .dropdown-content { + opacity: 1; + pointer-events: auto; + transform: translateY(0); + } + ul, li { + margin: 0; + list-style-type: none; + padding: 0; + } + .dropdown-item { + display: block; + color: rgba(0,0,0,0.7); + text-decoration: none; + + &::before { + display: none; + content: ''; + } + + .dropdown-result-title, .dropdown-result-subtitle { + display: block; + } + .dropdown-result-title { + font-size: 14px; + } + .dropdown-result-subtitle { + font-size: 12px; + color: rgba(0,0,0,0.5); + } + } +} + +/** Taille */ +.wpeo-dropdown { + &.dropdown-small .dropdown-content { + width: 60px; + } + &.dropdown-medium .dropdown-content { + width: 220px; + } + &.dropdown-large .dropdown-content { + width: 360px; + } +} + +/** Padding */ +.wpeo-dropdown { + &.dropdown-padding-0 .dropdown-content { + padding: 0; + } + &.dropdown-padding-1 .dropdown-content { + padding: 0.6em; + } + &.dropdown-padding-2 .dropdown-content { + padding: 1.2em; + } +} + +/** Alignement */ +.wpeo-dropdown { + &.dropdown-left .dropdown-content { + left: 0; + } + &.dropdown-right .dropdown-content { + right: 0; + } + + &.dropdown-horizontal.dropdown-left .dropdown-content { + left: 100%; + } + &.dropdown-horizontal.dropdown-right .dropdown-content { + right: 100%; + } +} + +/** Sens */ +.wpeo-dropdown { + &.dropdown-horizontal .dropdown-content { + top: 0; + width: auto !important; + display: flex; + flex-wrap: nowrap; + flex-direction: row; + } +} + +/** Disable */ +.wpeo-dropdown .dropdown-item { + &.dropdown-item-disable { + opacity: 0.6; + cursor: default !important; + pointer-events: none; + // Pointer events: none; seulement sur les enfants pour permettre l'utilisation d'une tooltip ou autre module. + > * { + } + } +} + +@import "list"; +@import "grid"; diff --git a/css/scss/module/dropdown/_grid.scss b/css/scss/module/dropdown/_grid.scss new file mode 100644 index 0000000..b601371 --- /dev/null +++ b/css/scss/module/dropdown/_grid.scss @@ -0,0 +1,11 @@ +.wpeo-dropdown.dropdown-grid { + .dropdown-item { + + img { + width: 100%; + height: auto; + display: block; + margin: 0; + } + } +} diff --git a/css/scss/module/dropdown/_list.scss b/css/scss/module/dropdown/_list.scss new file mode 100644 index 0000000..a2ca76a --- /dev/null +++ b/css/scss/module/dropdown/_list.scss @@ -0,0 +1,30 @@ +.wpeo-dropdown { + .dropdown-content { + .dropdown-item { + padding: 0.6em; + background: #fff; + transition: all 0.2s ease-out; + &:hover { + cursor: pointer; + background: rgba(0,0,0,0.1); + } + } + } +} + +.wpeo-dropdown.dropdown-list { + .dropdown-content { + text-align: left; + } + .dropdown-item { + &::after { + display: block; + content: ''; + clear: both; + } + img { + float: left; + margin-right: 0.4em; + } + } +} diff --git a/css/scss/module/dropdown/index.php b/css/scss/module/dropdown/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/css/scss/module/dropdown/index.php @@ -0,0 +1,2 @@ + .svg-inline--fa { + position: absolute; + right: 1em; + top: 50%; + transform: translateY(-50%); + } +} +.wpeo-form .form-element.disable { + .dropdown-toggle > .svg-inline--fa { + display: none; + } +} + +/* Compatibility Autocomplete */ +.wpeo-form .wpeo-autocomplete { + display: block; + width: 100%; + .autocomplete-label { + box-shadow: none; + padding: 0.74em 1em; + } +} +.wpeo-form.form-light { + .wpeo-autocomplete .autocomplete-label { + background: #fff; + &:hover { + background: $color__grey; + } + } +} diff --git a/css/scss/module/form/_radio.scss b/css/scss/module/form/_radio.scss new file mode 100644 index 0000000..7849110 --- /dev/null +++ b/css/scss/module/form/_radio.scss @@ -0,0 +1,53 @@ +/** Général */ +.wpeo-form .form-element { + input[type="radio"].form-field { + display: inline-block; + width: auto; + } +} + +/** Design */ +.wpeo-form .form-element { + input[type="radio"].form-field { + appearance: none; + border-radius: 50%; + width: 16px; + height: 16px; + padding: 0; + border: 0; + background: transparent !important; + border: 1px solid rgba(0,0,0,0.4); + transition: 0.2s all linear; + outline: none; + position: relative; + top: 2px; + + &::before { + display: none !important; + content: '' !important; + } + &:hover { + cursor: pointer; + border: 1px solid $color__primary; + box-shadow: 0 0 0 1px $color__primary inset; + background: transparent !important; + } + &:checked { + border: 1px solid $color__primary; + box-shadow: 0 0 0 4px $color__primary inset; + } + & + label { + text-transform: none; + font-weight: 400; + font-size: 14px; + display: inline-block; + margin-right: 1em; + &:hover { + cursor: pointer; + } + &:active { + outline: none; + } + } + } +} diff --git a/css/scss/module/gridlayout/_gridlayout.scss b/css/scss/module/gridlayout/_gridlayout.scss new file mode 100644 index 0000000..e73cb7c --- /dev/null +++ b/css/scss/module/gridlayout/_gridlayout.scss @@ -0,0 +1,120 @@ +/*-------------------------------------------------------------- + Module : Gridlayout + Version : 1.5.0 + + * Classes pour l'élément parent + .wpeo-gridlayout -> classe de base du mobule + .grid-X -> Définit le nombre de colonnes + .grid-margin-X -> Ajoute des marges au dessus et en dessous du parent + .grid-gap-X -> Définit les gouttières des colonnes + + * Classes pour les enfants direct + .gridw-X -> Change la largeur du bloc enfant (gridw-2 = 2 fois la taille initiale) + .gridh-X -> Change la hauteur du bloc enfant (gridh-2 = 2 fois la taille initiale) +--------------------------------------------------------------*/ + +.wpeo-gridlayout { + display: grid; + grid-gap: 1em 1em; + grid-template-columns: repeat( 4, 1fr ); +} + +/** Définition des tailles */ +.wpeo-gridlayout { + /** Du parent */ + @for $i from 1 through 6 { + &.grid-#{$i} { + grid-template-columns: repeat( $i, 1fr ); + } + + /** Chaque enfant peut modifier sa propre taille */ + @for $y from 1 through 6 { + @if ( $y <= $i ) { + &.grid-#{$i} > .gridw-#{$y} { + grid-column: auto / span $y; + + @if ( $y > 1 ) { + @media ( max-width: $media__medium ) { + grid-column: auto / span 2; + } + } + } + } + } + } +} + +/** Définition des hauteur des enfants */ +.wpeo-gridlayout { + @for $i from 1 through 6 { + > .gridh-#{$i} { + grid-row: auto / span $i; + + @media ( max-width: $media__medium ) { + grid-row: auto / span 1 !important; + } + } + } +} + +/** Marges */ +.wpeo-gridlayout { + @for $i from 0 through 6 { + &.grid-margin-#{$i} { + margin: #{$i}em 0; + } + } +} + +/** Gouttières */ +.wpeo-gridlayout { + @for $i from 0 through 6 { + &.grid-gap-#{$i} { + grid-gap: #{$i}em #{$i}em; + } + } +} + +/** Alignements */ +.wpeo-gridlayout { + .grid-align-center { + margin-left: auto; + margin-right: auto; + } + .grid-align-right { + margin-left: auto; + } + .grid-align-middle { + margin-top: auto; + margin-bottom: auto; + } + .grid-align-bottom { + margin-top: auto; + } +} + +/** Media queries */ +.wpeo-gridlayout:not(.dropdown-content) { + @for $i from 1 through 6 { + @if ( $i > 2 ) { + @media ( max-width: $media__medium ) { + &.grid-#{$i} { + grid-template-columns: repeat( 2, 1fr ) !important; + } + } + } + @if ( $i > 1 ) { + @media ( max-width: $media__small ) { + &.grid-#{$i} { + grid-template-columns: repeat( 1, 1fr ) !important; + } + } + } + + } + > * { + @media ( max-width: $media__small ) { + grid-column: auto / span 1 !important; + } + } +} diff --git a/css/scss/module/gridlayout/index.php b/css/scss/module/gridlayout/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/css/scss/module/gridlayout/index.php @@ -0,0 +1,2 @@ + classe de base pour le module + .loader-spin => icone de chargement +--------------------------------------------------------------*/ + +.wpeo-loader { + transition: all 0.2s ease-out; + pointer-events: none; + opacity: 0.5; + position: relative; + + .loader-spin { + position: absolute; + border: 3px solid #a7a7a7; + border-top: 3px solid darken($color__primary, 40%); + border-radius: 50%; + width: 20px; + height: 20px; + z-index: 99; + left: 50%; + top: 50%; + margin: 0 !important; + padding: 0 !important; + animation: loader-spin 1s ease-out infinite; + } +} + + + @keyframes loader-spin { + 0% { transform: translate(-50%, -50%) rotate(0deg); } + 100% { transform: translate(-50%, -50%) rotate(360deg); } + } diff --git a/css/scss/module/loader/index.php b/css/scss/module/loader/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/css/scss/module/loader/index.php @@ -0,0 +1,2 @@ + classe de base du mobule + .modalactive -> lance l'apparition de la modal + .no-modal-close -> désactive l'icone fermeture +--------------------------------------------------------------*/ + +.wpeo-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; + background: rgba(39,42,53,.9); + opacity: 0; + pointer-events: none; + transition: all 0.2s ease-out; + + // Fix pointer event on textarea field. + textarea { + resize: none; + } + + &.modal-active { + opacity: 1; + pointer-events: auto; + z-index: 1002; + + .modal-container { + transform: translate(-50%, -50%); + } + textarea { + resize: both; + } + } + + // Fix 2eme niveau modal. + &.modal-active .modal-active { + z-index: 1003; + } + // Fix 3eme niveau modal. + &.modal-active .modal-active .modal-active { + z-index: 1004; + } + + &.modal-force-display { + .modal-close { + display: none; + } + } +} + +.wpeo-modal { + .modal-container { + position: absolute; + transition: all 0.2s ease-out; + width: 100%; + max-width: 860px; + height: 100%; + max-height: 560px; + background: #fff; + padding: 1em 0; + margin: auto; + top: 50%; + left: 50%; + transform: translate(-50%, -60%); + @media ( max-width: $media__small ) { + padding: 1em; + } + } + + .modal-container { + .modal-header { + height: 10%; + display: flex; + padding: 0 2em; + } + .modal-content { + height: 78%; + padding: 0 2em; + } + .modal-footer { + height: 12%; + padding: 0 2em; + } + } + .modal-container .modal-header { + .modal-title, .modal-close { + margin: auto 0; + } + .modal-title { + text-transform: uppercase; + font-size: 18px; + white-space: normal; + @media ( max-width: $media__medium ) { + font-size: 16px; + } + @media ( max-width: $media__small ) { + font-size: 14px; + } + } + .modal-close { + margin-left: auto; + color: rgba(0,0,0,0.3); + padding: 4px; + transition: all 0.2s ease-out; + &:hover { + cursor: pointer; + color: $color__primary; + } + } + } + .modal-container .modal-content { + overflow-y: auto; + font-size: 14px; + @media ( max-width: $media__small ) { + font-size: 12px; + } + } + .modal-container .modal-footer { + text-align: right; + padding-top: 1em; + &.left { + text-align: left; + } + &.center { + text-align: center; + } + } +} diff --git a/css/scss/module/modal/index.php b/css/scss/module/modal/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/css/scss/module/modal/index.php @@ -0,0 +1,2 @@ + classe de base du mobule +--------------------------------------------------------------*/ + +/* General */ +.wpeo-notice { + position: relative; + font-size: 1em; + padding: 1em; + overflow: hidden; + border-radius: 3px; + border: solid #eee 1px; + margin: 1em 0; + display: flex; + transition: all 0.2s ease-out; + align-items: center; + + &::before { + display: block; + font-family: 'Font Awesome 5 Free'; + font-weight: 900; + font-size: 24px; + } + .notice-content { + width: 100%; + padding: 0 1em; + color: rgba(0,0,0,0.6); + } + .notice-title { + font-size: 20px; + font-weight: 600; + color: rgba(0,0,0,0.9); + } + .notice-subtitle { + font-size: 14px; + } + .notice-close { + color: rgba(0,0,0,0.3); + transition: all 0.2s ease-out; + + &:hover { + color: $color__primary; + cursor: pointer; + } + } + ul { + padding: 0 0 0 1.4em; + margin: 0.4em 0; + } +} + +/** Status */ +@import "status"; diff --git a/css/scss/module/notice/_status.scss b/css/scss/module/notice/_status.scss new file mode 100644 index 0000000..ba3f02e --- /dev/null +++ b/css/scss/module/notice/_status.scss @@ -0,0 +1,55 @@ +/** Info */ +.wpeo-notice.notice-info { + border-left: solid $color__blue 6px; + color: $color__blue; + background: rgba( $color__blue, 0.05 ); + + &::before { + content: '\f05a'; + } + .notice-title, .notice-subtitle, a { + color: $color__blue; + } +} + +/** Error */ +.wpeo-notice.notice-error { + border-left: solid $color__red 6px; + color: $color__red; + background: rgba( $color__red, 0.05 ); + + &::before { + content: '\f057'; + } + .notice-title, .notice-subtitle, a { + color: $color__red; + } +} + +/** Warning */ +.wpeo-notice.notice-warning { + border-left: solid $color__yellow 6px; + color: $color__yellow; + background: rgba( $color__yellow, 0.05 ); + + &::before { + content: '\f071'; + } + .notice-title, .notice-subtitle, a { + color: $color__yellow; + } +} + +/** Success */ +.wpeo-notice.notice-success { + border-left: solid $color__green 6px; + color: $color__green; + background: rgba( $color__green, 0.05 ); + + &::before { + content: '\f058'; + } + .notice-title, .notice-subtitle, a { + color: $color__green; + } +} diff --git a/css/scss/module/notice/index.php b/css/scss/module/notice/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/css/scss/module/notice/index.php @@ -0,0 +1,2 @@ + classe de base du mobule +--------------------------------------------------------------*/ + + +@import "flex"; diff --git a/css/scss/module/table/index.php b/css/scss/module/table/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/css/scss/module/table/index.php @@ -0,0 +1,2 @@ + classe de base du mobule + .tooltip-primary -> tooltip sur fond rouge + .tooltip-light -> tooltip sur fond rouge + .tooltip-red -> tooltip sur fond rouge +--------------------------------------------------------------*/ + +.wpeo-tooltip { + display: block; + position: absolute; + bottom: 0; + left: 0; + opacity: 0; + pointer-events: none; + z-index: 99999; + white-space: nowrap; + background: $color__dark; + color: #fff; + border-radius: 6px; + font-size: 0.8rem; + padding: 0 1em; + height: 2.2em; + line-height: 2.2em; + + &::before { + display: block; + content: ''; + width: 0; + height: 0; + border-style: solid; + position: absolute; + } + &:focus { + outline: none; + } +} + +/* Couleurs */ +@mixin set-arrow-color($color) { + &.tooltip-top::before { + border-color: $color transparent transparent transparent; + } + &.tooltip-right::before { + border-color: transparent $color transparent transparent; + } + &.tooltip-bottom::before { + border-color: transparent transparent $color transparent; + } + &.tooltip-left::before { + border-color: transparent transparent transparent $color; + } +} + +.wpeo-tooltip { + &.tooltip-dark { + background: $color__dark; + @include set-arrow-color($color__dark); + } + &.tooltip-primary { + background: $color__primary; + @include set-arrow-color($color__primary); + } + &.tooltip-light { + background: $color__grey; + color: rgba(0,0,0,0.6); + @include set-arrow-color($color__grey); + } + &.tooltip-red { + background: $color__red; + @include set-arrow-color($color__red); + } +} + +/* Position de la fleche */ +.wpeo-tooltip { + &.tooltip-top::before { + border-width: 6px 6px 0 6px; + border-color: $color__dark transparent transparent transparent; + bottom: -6px; + left: 50%; + transform: translateX(-50%); + } + &.tooltip-right::before { + border-width: 6px 6px 6px 0; + border-color: transparent $color__dark transparent transparent; + top: 50%; + transform: translateY(-50%); + left: -6px; + } + &.tooltip-bottom::before { + border-width: 0 6px 6px 6px; + border-color: transparent transparent $color__dark transparent; + top: -6px; + left: 50%; + transform: translateX(-50%); + } + &.tooltip-left::before { + border-width: 6px 0 6px 6px; + border-color: transparent transparent transparent $color__dark; + top: 50%; + transform: translateY(-50%); + right: -6px; + } +} diff --git a/css/scss/module/tooltip/index.php b/css/scss/module/tooltip/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/css/scss/module/tooltip/index.php @@ -0,0 +1,2 @@ +: px; + // margin-: px; + //} + div.fichecenter { + width: 100%; + clear: both; /* This is to have div fichecenter that are true rectangles */ + } + div.fichecenterbis { + margin-top: 8px; + } + div.fichethirdleft { + float: none; + width: auto; + padding-bottom: 6px; + } + div.fichetwothirdright { + float: none; + width: auto; + padding-bottom: 6px; + } + div.fichehalfleft { + float: none; + width: auto; + } + div.fichehalfright { + float: none; + width: auto; + } + div.fichehalfright { + margin-top: 10px; + } + div.firstcolumn div.box { + padding-right: 0px; + } + div.secondcolumn div.box { + padding-left: 0px; + } +} diff --git a/css/scss/table/_table.scss b/css/scss/table/_table.scss new file mode 100644 index 0000000..24e4fd0 --- /dev/null +++ b/css/scss/table/_table.scss @@ -0,0 +1,6 @@ +@import "general"; +@import "risk"; +@import "risksign"; +@import "riskassessment-task"; +@import "evaluation"; +@import "evaluation-method"; diff --git a/css/scss/table/index.php b/css/scss/table/index.php new file mode 100644 index 0000000..cd6990e --- /dev/null +++ b/css/scss/table/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 . + * + * Library javascript to enable Browser notifications + */ + 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } +if ( ! $res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1)) . "/main.inc.php"; +if ( ! $res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)) . "/../main.inc.php")) $res = @include substr($tmp, 0, ($i + 1)) . "/../main.inc.php"; +// Try main.inc.php using relative path +if ( ! $res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php"; +if ( ! $res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php"; +if ( ! $res) die("Include of main fails"); + +// Define javascript type +top_httphead('text/javascript; charset=UTF-8'); +// 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'); +} else { + header('Cache-Control: no-cache'); +} +?> + +/** + * \file js/digiriskdolibarr.js.php + * \ingroup digiriskdolibarr + * \brief JavaScript file for module DigiriskDolibarr. + */ + +/* Javascript library of module DigiriskDolibarr */ + +'use strict'; +/** + * @namespace EO_Framework_Init + * + * @author Eoxia + * @copyright 2015-2021 Eoxia + */ + +if ( ! window.eoxiaJS ) { + /** + * [eoxiaJS description] + * + * @memberof EO_Framework_Init + * + * @type {Object} + */ + window.eoxiaJS = {}; + + /** + * [scriptsLoaded description] + * + * @memberof EO_Framework_Init + * + * @type {Boolean} + */ + window.eoxiaJS.scriptsLoaded = false; +} + +if ( ! window.eoxiaJS.scriptsLoaded ) { + /** + * [description] + * + * @memberof EO_Framework_Init + * + * @returns {void} [description] + */ + window.eoxiaJS.init = function() { + window.eoxiaJS.load_list_script(); + }; + + /** + * [description] + * + * @memberof EO_Framework_Init + * + * @returns {void} [description] + */ + window.eoxiaJS.load_list_script = function() { + if ( ! window.eoxiaJS.scriptsLoaded) { + var key = undefined, slug = undefined; + for ( key in window.eoxiaJS ) { + + if ( window.eoxiaJS[key].init ) { + window.eoxiaJS[key].init(); + } + + for ( slug in window.eoxiaJS[key] ) { + + if ( window.eoxiaJS[key] && window.eoxiaJS[key][slug] && window.eoxiaJS[key][slug].init ) { + window.eoxiaJS[key][slug].init(); + } + + } + } + + window.eoxiaJS.scriptsLoaded = true; + } + }; + + /** + * [description] + * + * @memberof EO_Framework_Init + * + * @returns {void} [description] + */ + window.eoxiaJS.refresh = function() { + var key = undefined; + var slug = undefined; + for ( key in window.eoxiaJS ) { + if ( window.eoxiaJS[key].refresh ) { + window.eoxiaJS[key].refresh(); + } + + for ( slug in window.eoxiaJS[key] ) { + + if ( window.eoxiaJS[key] && window.eoxiaJS[key][slug] && window.eoxiaJS[key][slug].refresh ) { + window.eoxiaJS[key][slug].refresh(); + } + } + } + }; + + $( document ).ready( window.eoxiaJS.init ); +} + +/** + * Initialise l'objet "modal" ainsi que la méthode "init" obligatoire pour la bibliothèque EoxiaJS. + * + * @since 1.0.0 + * @version 1.0.0 + */ +window.eoxiaJS.modal = {}; + +/** + * La méthode appelée automatiquement par la bibliothèque EoxiaJS. + * + * @since 1.0.0 + * @version 1.0.0 + * + * @return {void} + */ +window.eoxiaJS.modal.init = function() { + window.eoxiaJS.modal.event(); +}; + +/** + * La méthode contenant tous les événements pour la modal. + * + * @since 1.0.0 + * @version 1.0.0 + * + * @return {void} + */ +window.eoxiaJS.modal.event = function() { + $( document ).on( 'click', '.modal-close', window.eoxiaJS.modal.closeModal ); + $( document ).on( 'click', '.modal-open', window.eoxiaJS.modal.openModal ); + $( document ).on( 'click', '.modal-refresh', window.eoxiaJS.modal.refreshModal ); +}; + +/** + * Open Modal. + * + * @since 1.0.0 + * @version 1.0.0 + * + * @param {MouseEvent} event Les attributs lors du clic. + * @return {void} + */ +window.eoxiaJS.modal.openModal = function ( event ) { + let idSelected = $(this).attr('value'); + if (document.URL.match(/#/)) { + var urlWithoutTag = document.URL.split(/#/)[0] + } else { + var urlWithoutTag = document.URL + } + history.pushState({ path: document.URL}, '', urlWithoutTag); + + // Open modal evaluation. + if ($(this).hasClass('risk-evaluation-add')) { + $('#risk_evaluation_add'+idSelected).addClass('modal-active'); + $('.risk-evaluation-create'+idSelected).attr('value', idSelected); + } else if ($(this).hasClass('risk-evaluation-list')) { + $('#risk_evaluation_list' + idSelected).addClass('modal-active'); + } else if ($(this).hasClass('open-media-gallery')) { + $('#media_gallery').addClass('modal-active'); + $('#media_gallery').attr('value', idSelected); + $('#media_gallery').find('.type-from').attr('value', $(this).find('.type-from').val()); + $('#media_gallery').find('.wpeo-button').attr('value', idSelected); + $('#media_gallery').find('.clicked-photo').attr('style', '') + $('#media_gallery').find('.clicked-photo').removeClass('clicked-photo') + } else if ($(this).hasClass('risk-evaluation-edit')) { + $('#risk_evaluation_edit' + idSelected).addClass('modal-active'); + } else if ($(this).hasClass('evaluator-add')) { + $('#evaluator_add' + idSelected).addClass('modal-active'); + } else if ($(this).hasClass('open-medias-linked') && $(this).hasClass('digirisk-element')) { + $('#digirisk_element_medias_modal_' + idSelected).addClass('modal-active'); + } + + // Open modal risk. + if ($(this).hasClass('risk-add')) { + $('#risk_add' + idSelected).addClass('modal-active'); + } + if ($(this).hasClass('risk-edit')) { + $('#risk_edit' + idSelected).addClass('modal-active'); + } + + // Open modal riskassessment task. + if ($(this).hasClass('riskassessment-task-add')) { + $('#risk_assessment_task_add' + idSelected).addClass('modal-active'); + } + if ($(this).hasClass('riskassessment-task-edit')) { + $('#risk_assessment_task_edit' + idSelected).addClass('modal-active'); + } + if ($(this).hasClass('riskassessment-task-list')) { + $('#risk_assessment_task_list' + idSelected).addClass('modal-active'); + } + if ($(this).hasClass('riskassessment-task-timespent-edit')) { + $('#risk_assessment_task_timespent_edit' + idSelected).addClass('modal-active'); + } + + // Open modal risksign. + if ($(this).hasClass('risksign-add')) { + $('#risksign_add' + idSelected).addClass('modal-active'); + } + if ($(this).hasClass('risksign-edit')) { + $('#risksign_edit' + idSelected).addClass('modal-active'); + } + if ($(this).hasClass('risksign-photo')) { + $(this).closest('.risksign-photo-container').find('#risksign_photo' + idSelected).addClass('modal-active'); + } + + // Open modal signature. + if ($(this).hasClass('modal-signature-open')) { + $('#modal-signature' + idSelected).addClass('modal-active'); + window.eoxiaJS.signature.modalSignatureOpened( $(this) ); + } + + $('.notice').addClass('hidden'); +}; + +/** + * Close Modal. + * + * @since 1.0.0 + * @version 1.0.0 + * + * @param {MouseEvent} event Les attributs lors du clic. + * @return {void} + */ +window.eoxiaJS.modal.closeModal = function ( event ) { + $(this).closest('.modal-active').removeClass('modal-active') + $('.clicked-photo').attr('style', ''); + $('.clicked-photo').removeClass('clicked-photo'); + $('.notice').addClass('hidden'); +}; + +/** + * Refresh Modal. + * + * @since 1.0.0 + * @version 1.0.0 + * + * @param {MouseEvent} event Les attributs lors du clic. + * @return {void} + */ +window.eoxiaJS.modal.refreshModal = function ( event ) { + window.location.reload(); +}; + + +// Dropdown +/** + * [dropdown description] + * + * @memberof EO_Framework_Dropdown + * + * @type {Object} + */ +window.eoxiaJS.dropdown = {}; + +/** + * [description] + * + * @memberof EO_Framework_Dropdown + * + * @returns {void} [description] + */ +window.eoxiaJS.dropdown.init = function() { + window.eoxiaJS.dropdown.event(); +}; + +/** + * [description] + * + * @memberof EO_Framework_Dropdown + * + * @returns {void} [description] + */ +window.eoxiaJS.dropdown.event = function() { + $( document ).on( 'keyup', window.eoxiaJS.dropdown.keyup ); + $( document ).on( 'keypress', window.eoxiaJS.dropdown.keypress ); + $( document ).on( 'click', '.wpeo-dropdown:not(.dropdown-active) .dropdown-toggle:not(.disabled)', window.eoxiaJS.dropdown.open ); + $( document ).on( 'click', '.wpeo-dropdown.dropdown-active .dropdown-content', function(e) { e.stopPropagation() } ); + $( document ).on( 'click', '.wpeo-dropdown.dropdown-active:not(.dropdown-force-display) .dropdown-content .dropdown-item', window.eoxiaJS.dropdown.close ); + $( document ).on( 'click', '.wpeo-dropdown.dropdown-active', function ( e ) { window.eoxiaJS.dropdown.close( e ); e.stopPropagation(); } ); + $( document ).on( 'click', 'body', window.eoxiaJS.dropdown.close ); +}; + +/** + * [description] + * + * @memberof EO_Framework_Dropdown + * + * @param {void} event [description] + * @returns {void} [description] + */ +window.eoxiaJS.dropdown.keyup = function( event ) { + if ( 27 === event.keyCode ) { + window.eoxiaJS.dropdown.close(); + } +} + +/** + * Do a barrel roll! + * + * @memberof EO_Framework_Dropdown + * + * @param {void} event [description] + * @returns {void} [description] + */ +window.eoxiaJS.dropdown.keypress = function( event ) { + + let currentString = localStorage.currentString ? localStorage.currentString : '' + let keypressNumber = localStorage.keypressNumber ? +localStorage.keypressNumber : 0 + + currentString += event.keyCode + keypressNumber += +1 + + localStorage.setItem('currentString', currentString) + localStorage.setItem('keypressNumber', keypressNumber) + + if (keypressNumber > 9) { + localStorage.setItem('currentString', '') + localStorage.setItem('keypressNumber', 0) + } + + if (currentString === '9897114114101108114111108108') { + var a="-webkit-", + b='transform:rotate(1turn);', + c='transition:4s;'; + + document.head.innerHTML += '
    '; + print $form->select_dolusers($fromtype == 'user' ? $fromid : GETPOST('search_society_attendants'), 'search_society_attendants', 1); + print ''; + print $form->selectcontacts(0, $fromtype == 'socpeople' ? $fromid : GETPOST('search_external_attendants'), 'search_external_attendants', 1); + print ''; + print $form->select_company($fromtype == 'thirdparty' ? $fromid : GETPOST('search_attendant_thirdparties'), 'search_attendant_thirdparties', '',1); + print '
    '; + print $langs->trans($resource['label']); + print '
    '; + if (is_array($signatories) && !empty($signatories)) { + foreach($signatories as $object_signatory) { + $usertmp = $user; + $usertmp->fetch($object_signatory->element_id); + print $usertmp->getNomUrl(1); + print '
    '; + } + } + print '
    '; + if (is_array($signatories) && !empty($signatories)) { + foreach($signatories as $object_signatory) { + $contact->fetch($object_signatory->element_id); + print $contact->getNomUrl(1); + print '
    '; + } + } + print '
    '; + if (is_array($signatories) && !empty($signatories)) { + foreach($signatories as $object_signatory) { + $contact->fetch($object_signatory->element_id); + $thirdparty->fetch($contact->fk_soc); + print $thirdparty->getNomUrl(1); + print '
    '; + } + } + print '
    '; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; if (in_array($object->id, $arrayofselected)) { - $selected = 1; + $selected = 1; } print ''; - } - print '
    '.$langs->trans("NoRecordFound").'
    '.$langs->trans("NoRecordFound").'