diff --git a/README.md b/README.md index 5ccc514..ec5352d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ## Informations - Numéro du module : 436351 -- Dernière mise à jour : 19/12/2023 +- Dernière mise à jour : 05/07/2024 - Éditeur : [Eoxia](https://eoxia.com) - Thème : Eldy Menu - Licence : GPLv3 @@ -11,10 +11,10 @@ - ### Version -- Version : 1.3.0 +- Version : 1.4.0 - PHP : 7.4.33 -- Compatibilité : Dolibarr 16.0.0 - 18.0.3 -- Saturne Framework : 1.2.1 +- Compatibilité : Dolibarr 17.0.2 - 20.0.0 +- Saturne Framework : 1.5.1 ## Liens diff --git a/admin/product.php b/admin/product.php new file mode 100644 index 0000000..34f95df --- /dev/null +++ b/admin/product.php @@ -0,0 +1,78 @@ + + * + * 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 admin/product.php + * \ingroup easycrm + * \brief EasyCRM product config page. + */ + +// Load EasyCRM environment +if (file_exists('../easycrm.main.inc.php')) { + require_once __DIR__ . '/../easycrm.main.inc.php'; +} elseif (file_exists('../../easycrm.main.inc.php')) { + require_once __DIR__ . '/../../easycrm.main.inc.php'; +} else { + die('Include of easycrm main fails'); +} + +// Libraries +require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; + +require_once __DIR__ . '/../lib/easycrm.lib.php'; + +// Global variables definitions +global $langs, $user; + +// Load translation files required by the page +saturne_load_langs(['admin']); + +// Get parameters +$action = GETPOST('action', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); + +// Security check - Protection if external user +$permissiontoread = $user->hasRight('easycrm','adminpage','read'); + +saturne_check_access($permissiontoread); + +/* + * View + */ + +$title = $langs->trans('ModuleSetup', 'EasyCRM'); +$help_url = 'FR:Module_EasyCRM'; + +saturne_header(0,'', $title, $help_url); + +// Subheader +$linkback = '' . $langs->trans('BackToModuleList') . ''; +print load_fiche_titre($title, $linkback, 'easycrm_color@easycrm'); + +// Configuration header +$head = easycrm_admin_prepare_head(); +print dol_get_fiche_head($head, 'product', $title, -1, 'easycrm_color@easycrm'); + +$constArray['easycrm'] = [ + 'controldocument' => [ + 'name' => 'ProductKitConf', + 'description' => 'ProductKitConfDesc', + 'code' => 'EASYCRM_PRODUCTKIT_DESC_ADD_LINE_PROPAL' + ] +]; + +require_once __DIR__ . '/../../saturne/core/tpl/admin/object/object_const_view.tpl.php'; diff --git a/class/actions_easycrm.class.php b/class/actions_easycrm.class.php index 4cbaf52..684cce5 100644 --- a/class/actions_easycrm.class.php +++ b/class/actions_easycrm.class.php @@ -49,7 +49,7 @@ class ActionsEasycrm /** * @var string String displayed by executeHook() immediately after return */ - public string $resprints; + public $resprints; /** * Constructor @@ -254,6 +254,30 @@ public function doActions(array $parameters, $object, string $action): int header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); exit; } + } else if (strpos($parameters['context'], 'projectlist') !== false) { + if ($action == 'reload_opp_percent') { + require_once __DIR__ . '/../../saturne/lib/object.lib.php'; + + $projects = saturne_fetch_all_object_type('Project', '', '', 0, 0, ['customsql' => 't.fk_statut IN (' . Project::STATUS_DRAFT . ',' . Project::STATUS_VALIDATED . ') AND t.fk_opp_status IS NOT NULL AND t.opp_percent IS NULL']); + + if (is_array($projects) && !empty($projects)) { + foreach ($projects as $project) { + if ($project->fk_opp_status > 0) { + $oppPercent = dol_getIdFromCode($this->db, $project->fk_opp_status, 'c_lead_status', 'rowid', 'percent'); + } else if (isModEnabled('agenda')) { + require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; + + $actionComm = new ActionComm($this->db); + + $actionComms = $actionComm->getActions($project->socid, $project->id, 'project'); + $oppPercent = (100 - (count($actionComms) * 20)) < 0 ? 0 : count($actionComms) * 20; + } else { + continue; + } + $project->setValueFrom('opp_percent', $oppPercent); + } + } + } } return 0; // or return 1 to replace standard code @@ -268,7 +292,7 @@ public function doActions(array $parameters, $object, string $action): int */ public function printCommonFooter(array $parameters): int { - global $conf, $db, $langs , $object; + global $conf, $db, $langs, $object, $user; // Do something only for the current context if (preg_match('/thirdpartycomm|projectcard/', $parameters['context'])) { @@ -278,22 +302,39 @@ public function printCommonFooter(array $parameters): int $pictopath = dol_buildpath('/easycrm/img/easycrm_color.png', 1); $picto = img_picto('', $pictopath, '', 1, 0, 0, '', 'pictoModule'); - $actiomcomm = new ActionComm($db); + $actionComm = new ActionComm($db); $filter = ' AND a.id IN (SELECT c.fk_actioncomm FROM ' . MAIN_DB_PREFIX . 'categorie_actioncomm as c WHERE c.fk_categorie = ' . $conf->global->EASYCRM_ACTIONCOMM_COMMERCIAL_RELAUNCH_TAG . ')'; - $actiomcomms = $actiomcomm->getActions(GETPOST('socid'), ((strpos($parameters['context'], 'thirdpartycomm') !== false) ? '' : GETPOST('id')), ((strpos($parameters['context'], 'thirdpartycomm') !== false) ? '' : 'project'), $filter, 'a.datec'); - if (is_array($actiomcomms) && !empty($actiomcomms)) { - $nbActiomcomms = count($actiomcomms); - $lastActiomcomm = array_shift($actiomcomms); + $actionComms = $actionComm->getActions(GETPOST('socid'), ((strpos($parameters['context'], 'thirdpartycomm') !== false) ? '' : GETPOST('id')), ((strpos($parameters['context'], 'thirdpartycomm') !== false) ? '' : 'project'), $filter, 'a.datec'); + if (is_array($actionComms) && !empty($actionComms)) { + $nbActionComms = count($actionComms); + $lastActionComm = array_shift($actionComms); } else { - $nbActiomcomms = 0; + $nbActionComms = 0; } + if ($nbActionComms == 0) { + $badgeClass = 1; + } else if ($nbActionComms == 1 || $nbActionComms == 2) { + $badgeClass = 4; + } else { + $badgeClass = 8; + } + + $url = '?socid=' . $object->socid . '&fromtype=project' . '&project_id=' . $object->id . '&action=create&token=' . newToken(); $out = '' . $picto . $langs->trans('CommercialsRelaunching') . ''; - $out .= '' .'' . $nbActiomcomms . ''; - if ($nbActiomcomms > 0) { - $out .= ' - ' . '' . $langs->trans('LastCommercialReminderDate') . ' : ' . dol_print_date($lastActiomcomm->datec, 'dayhourtext', 'tzuser') . ''; - $out .= ' ' . $lastActiomcomm->getNomUrl(1); + + $picto = img_picto($langs->trans('CommercialsRelaunching'), 'fontawesome_fa-headset_fas'); + + $out .= '' . dolGetBadge($picto . ' : ' . $nbActionComms, '', 'status' . $badgeClass); + if ($nbActionComms > 0) { + $out .= ' - ' . '' . $langs->trans('LastCommercialReminderDate') . ' : ' . dol_print_date($lastActionComm->datec, 'dayhourtext', 'tzuser') . ''; + } + if ($user->hasRight('agenda', 'myactions', 'create')) { + $out .= dolButtonToOpenUrlInDialogPopup('quickEventCreation' . $object->id, $langs->transnoentities('QuickEventCreation'), '', '/custom/easycrm/view/quickevent.php' . $url); + } + if (!empty($lastActionComm)) { + $out .= '
' . dolButtonToOpenUrlInDialogPopup('lastActionComm' . $object->id, $langs->transnoentities('LastEvent') . ' : ' . $lastActionComm->label, img_picto('', $lastActionComm->picto) . ' ' . $lastActionComm->label, '/comm/action/card.php?id=' . $lastActionComm->id); } $out .= ''; @@ -319,7 +360,7 @@ public function printCommonFooter(array $parameters): int if (!empty($project->array_options['options_commtask'])) { $task->fetch($project->array_options['options_commtask']); - $out2 = $task->getNomUrl(1); + $out2 = $task->getNomUrl(1, '', 'task', 1); } ?> + hasRight('projet', 'lire') && isModEnabled('saturne')) { - require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; + if (isModEnabled('project') && $user->hasRight('projet', 'lire') && isModEnabled('saturne')) { require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; - $pictopath = dol_buildpath('/easycrm/img/easycrm_color.png', 1); - $picto = img_picto('', $pictopath, '', 1, 0, 0, '', 'pictoModule'); - - $actiomcomm = new ActionComm($db); - - $filter = ' AND a.id IN (SELECT c.fk_actioncomm FROM ' . MAIN_DB_PREFIX . 'categorie_actioncomm as c WHERE c.fk_categorie = ' . $conf->global->EASYCRM_ACTIONCOMM_COMMERCIAL_RELAUNCH_TAG . ')'; + $picto = img_picto($langs->trans('CommercialsRelaunching'), 'fontawesome_fa-headset_fas'); + $filter = ' AND a.id IN (SELECT c.fk_actioncomm FROM ' . MAIN_DB_PREFIX . 'categorie_actioncomm as c WHERE c.fk_categorie = ' . $conf->global->EASYCRM_ACTIONCOMM_COMMERCIAL_RELAUNCH_TAG . ')'; if (is_object($parameters['obj']) && !empty($parameters['obj'])) { if (!empty($parameters['obj']->id)) { - $actiomcomms = $actiomcomm->getActions($parameters['obj']->socid, $parameters['obj']->id, 'project', $filter, 'a.datec'); - if (is_array($actiomcomms) && !empty($actiomcomms)) { - $nbActiomcomms = count($actiomcomms); - $lastActiomcomm = array_shift($actiomcomms); - } else { - $nbActiomcomms = 0; - } + $out = ''; + if (isModEnabled('agenda')) { + require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; + $actionComm = new ActionComm($db); + + $actionComms = $actionComm->getActions($parameters['obj']->socid, $parameters['obj']->id, 'project', $filter, 'a.datec'); + if (is_array($actionComms) && !empty($actionComms)) { + $nbActionComms = count($actionComms); + $lastActionComm = array_shift($actionComms); + } else { + $nbActionComms = 0; + } + + // @todo is a backward, should be removed one day when corrupted tools repair is added in saturne + if ($parameters['obj']->options_commrelaunch != $nbActionComms) { + $project = new Project($db); + $project->fetch($parameters['obj']->id); + $project->array_options['options_commrelaunch'] = $nbActionComms; + $project->updateExtrafield('commrelaunch'); + } + + if ($nbActionComms == 0) { + $badgeClass = 1; + } else if ($nbActionComms == 1 || $nbActionComms == 2) { + $badgeClass = 4; + } else { + $badgeClass = 8; + } + + $url = '?socid=' . $parameters['obj']->socid . '&fromtype=project' . '&project_id=' . $parameters['obj']->id . '&action=create&token=' . newToken(); + + $out .= dolGetBadge($picto . ' : ' . $nbActionComms, '', 'status' . $badgeClass); + // -- Old design -- + //$out .= '' . $nbActionComms . '  '; + if ($nbActionComms > 0) { + $out .= ' ' . dol_print_date($lastActionComm->datec, '%d/%m/%y %H:%M', 'tzuser') . ''; + } - $out = $picto . $langs->trans('CommercialsRelaunching'); - $out .= ' ' . $nbActiomcomms . ''; - if ($nbActiomcomms > 0) { - $out .= '
' . dol_print_date($lastActiomcomm->datec, 'dayhourtext', 'tzuser') . ''; - $out .= ' ' . $lastActiomcomm->getNomUrl(1); + // Extrafield commRelaunch + if ($user->hasRight('agenda', 'myactions', 'create')) { + $out .= dolButtonToOpenUrlInDialogPopup('quickEventCreation' . $parameters['obj']->id, $langs->transnoentities('QuickEventCreation'), '', '/custom/easycrm/view/quickevent.php' . $url); + // @todo find somewhere to add a user->conf to choose between popup dialog or open in current tab + //$out .= ''; + } + + if (!empty($lastActionComm)) { + $out .= '
' . dolButtonToOpenUrlInDialogPopup('lastActionComm' . $parameters['obj']->id, $langs->transnoentities('LastEvent') . ' : ' . $lastActionComm->label, img_picto('', $lastActionComm->picto) . ' ' . $lastActionComm->label, '/comm/action/card.php?id=' . $lastActionComm->id); + //$out .= ' ' . $lastActionComm->getNomUrl(1); + } + } + $out .= ''; + + // Extrafield commTask + $out2 = ''; + if (!empty($parameters['obj']->options_commtask)) { + $task = new Task($this->db); + $task->fetch($parameters['obj']->options_commtask); + $out2 .= $task->getNomUrl(1, '', 'task', 1); } - $url = '?socid=' . $parameters['obj']->socid . '&fromtype=project' . '&project_id=' . $parameters['obj']->id . '&action=create&token=' . newToken(); - if ($user->hasRight('agenda', 'myactions', 'create')) { - $out .= ''; + $out2 .= ''; + + // projectField opp_percent + $out3 = ''; + if (isset($parameters['obj']->opp_percent)) { + switch ($parameters['obj']->opp_percent) { + case $parameters['obj']->opp_percent < 20: + $statusBadge = 8; + break; + case $parameters['obj']->opp_percent < 60: + $statusBadge = 1; + break; + default: + $statusBadge = 4; + break; + } + $out3 .= dolGetBadge($parameters['obj']->opp_percent . ' %', '', 'status' . $statusBadge); } + $out3 .= ''; } ?> thirdparty->id)) { @@ -543,6 +682,167 @@ public function completeTabsHead(array $parameters): int $this->results = $parameters; } + return 0; // or return 1 to replace standard code + } + + /** + * Overloading the addMoreMassActions function + * + * @param array $parameters Hook metadatas (context, etc...) + * @return int < 0 on error, 0 on success, 1 to replace standard code + */ + public function addMoreMassActions($parameters) + { + global $user, $langs; + + if (strpos($parameters['context'], 'projectlist') !== false && $user->hasRight('projet', 'creer')) { + $selected = ''; + $ret = ''; + + if (GETPOST('massaction') == 'assignOppStatus') { + $selected = ' selected="selected" '; + } + $ret .= ''; + + $this->resprints = $ret; + } + + return 0; // or return 1 to replace standard code + } + + /** + * Overloading the doPreMassActions function + * + * @param array $parameters Hook metadatas (context, etc...) + * @return int < 0 on error, 0 on success, 1 to replace standard code + */ + public function doPreMassActions($parameters) + { + global $user, $langs; + + $massAction = GETPOST('massaction'); + + if (strpos($parameters['context'], 'projectlist') !== false && $user->hasRight('projet', 'creer') && $massAction == 'assignOppStatus') { + require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; + + $formproject = new FormProjets($this->db); + + $out = '
'; + $out .= '
'; + $out .= '' . $langs->trans('SelectOppStatus') . ''; + $out .= ''; + + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + + $out .= '
' . $formproject->selectOpportunityStatus('opp_status', '', 1, 0, 0, 0, '', 0, 1) . '
'; + + $out .= ''; + $out .= ''; + + $out .= '
'; + $out .= ''; + $out .= ''; + $out .= '
'; + + $out .= '
'; + $out .= '
'; + + $this->resprints = $out; + } + + return 0; // or return 1 to replace standard code + } + + /** + * Overloading the doMassActions function + * + * @param array $parameters Hook metadatas (context, etc...) + * @param Object $object + * @return int < 0 on error, 0 on success, 1 to replace standard code + */ + public function doMassActions($parameters, $object) + { + global $user, $langs; + + $massActionConfirm = GETPOST('massaction_confirm'); + $oppStatus = GETPOST('opp_status'); + + // MASS ACTION + if (strpos($parameters['context'], 'projectlist') !== false && $user->hasRight('projet', 'creer') && $massActionConfirm == 'assignOppStatus') { + + $toSelect = $parameters['toselect']; + + if (empty($toSelect)) { + $this->error = $langs->trans('ErrorSelectAtLeastOne'); + return 0; + } + + if ($toSelect > 0) { + $count = 0; + $res = 0; + + foreach ($toSelect as $selectedId) { + $object->fetch($selectedId); + $object->fk_opp_status = $oppStatus; + + $res = $object->setValueFrom('fk_opp_status', $oppStatus, 'projet'); + + if ($res <= 0) { + $this->errors[] = $object->errorsToString(); + return -1; + } else { + $count++; + } + } + + if ($res > 0) { + setEventMessages($langs->trans('OppStatusAssignedTo', $count), []); + header('Location:' . $_SERVER['PHP_SELF']); + } + } + } + + return 0; // or return 1 to replace standard code + } + + /** + * Overloading the saturneAdminPWAAdditionalConfig 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 saturneAdminPWAAdditionalConfig(array $parameters): int + { + global $langs; + + if (strpos($parameters['context'], 'pwaadmin') !== false) { + // PWA configuration + $out = load_fiche_titre($langs->trans('Config'), '', ''); + + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + $out .= ''; + + // PWA close project when probability zero + $out .= ''; + + $out .= '
' . $langs->trans('Parameters') . '' . $langs->trans('Description') . '' . $langs->trans('Status') . '
'; + $out .= $langs->trans('PWACloseProjectOpportunityZero'); + $out .= ''; + $out .= $langs->trans('PWACloseProjectOpportunityZeroDescription'); + $out .= ''; + $out .= ajax_constantonoff('EASYCRM_PWA_CLOSE_PROJECT_WHEN_OPPORTUNITY_ZERO'); + $out .= '
'; + + $this->resprints = $out; + } + return 0; // or return 1 to replace standard code } } diff --git a/class/address.class.php b/class/address.class.php index 64655eb..200d1dc 100644 --- a/class/address.class.php +++ b/class/address.class.php @@ -56,7 +56,7 @@ class Address extends SaturneObject /** * @var int Does object support extrafields ? 0=No, 1=Yes */ - public int $isextrafieldmanaged = 0; + public $isextrafieldmanaged = 0; /** * @var string String with name of icon for signature. Must be the part after the 'object_' into object_signature.png @@ -254,12 +254,12 @@ class Address extends SaturneObject /** * @var int User ID. */ - public int $fk_user_creat; + public $fk_user_creat; /** * @var int|null User ID. */ - public ?int $fk_user_modif; + public $fk_user_modif; /** * Constructor. diff --git a/core/modules/modEasyCRM.class.php b/core/modules/modEasyCRM.class.php index fe4da5e..7f8d4e1 100644 --- a/core/modules/modEasyCRM.class.php +++ b/core/modules/modEasyCRM.class.php @@ -78,7 +78,7 @@ public function __construct($db) $this->editor_url = 'https://www.eoxia.com'; // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' - $this->version = '1.3.0'; + $this->version = '1.4.0'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; @@ -130,7 +130,8 @@ public function __construct($db) 'contactcard', 'thirdpartycard', 'thirdpartylist', - 'main' + 'main', + 'pwaadmin' ], // Set this to 1 if features of module are opened to external users 'moduleforexternal' => 0, @@ -218,6 +219,9 @@ public function __construct($db) $i++ => ['EASYCRM_EVENT_DESCRIPTION_VISIBLE', 'integer', 1, '', 0, 'current'], $i++ => ['EASYCRM_EVENT_CATEGORIES_VISIBLE', 'integer', 1, '', 0, 'current'], + // CONST PWA + $i++ => ['EASYCRM_PWA_CLOSE_PROJECT_WHEN_OPPORTUNITY_ZERO', 'integer', 0, '', 0, 'current'], + // CONST ADDRESS $i++ => ['EASYCRM_DISPLAY_MAIN_ADDRESS', 'integer', 0, '', 0, 'current'], $i++ => ['EASYCRM_ADDRESS_ADDON', 'chaine', 'mod_address_standard', '', 0, 'current'], @@ -238,11 +242,12 @@ public function __construct($db) $i => ['EASYCRM_DISPLAY_NUMBER_MEDIA_GALLERY', 'integer', 8, '', 0, 'current'], ]; - // Some keys to add into the overwriting translation tables - /*$this->overwrite_translation = array( - 'en_US:ParentCompany'=>'Parent company or reseller', - 'fr_FR:ParentCompany'=>'Maison mère ou revendeur' - )*/ + // Some keys to add into the overwriting translation tables + $this->overwrite_translation = [ + 'fr_FR:ActionAC_EMAIL_IN' => 'Email entrant', + 'fr_FR:ActionAC_EMAIL' => 'Email sortant', + 'fr_FR:ActionAC_RDV' => 'Rendez-vous physique ou visioconférence' + ]; if (!isset($conf->easycrm) || !isset($conf->easycrm->enabled)) { $conf->easycrm = new stdClass(); @@ -538,11 +543,12 @@ public function init($options = ''): int $objectsMetadata = saturne_get_objects_metadata(); $extrafields->addExtraField('commrelaunch', $langs->transnoentities('CommercialsRelaunching'), 'text', 100, 2000, 'projet', 0, 0, '', '', 0, '', 2); - $extrafields->update('commtask', $langs->transnoentities('CommercialTask'), 'sellist', '', 'projet', 0, 0, 100, 'a:1:{s:7:"options";a:1:{s:39:"projet_task:ref:rowid::fk_projet = $ID$";N;}}', 1, '', 4); - $extrafields->addExtraField('commtask', $langs->transnoentities('CommercialTask'), 'sellist', 100, '', 'projet', 0, 0, '', 'a:1:{s:7:"options";a:1:{s:39:"projet_task:ref:rowid::fk_projet = $ID$";N;}}', 1, '', 4); + $extrafields->update('commtask', $langs->transnoentities('CommercialTask'), 'sellist', '', 'projet', 0, 0, 100, 'a:1:{s:7:"options";a:1:{s:21:"projet_task:ref:rowid";N;}}', 1, '', 4); + $extrafields->addExtraField('commtask', $langs->transnoentities('CommercialTask'), 'sellist', 100, '', 'projet', 0, 0, '', 'a:1:{s:7:"options";a:1:{s:21:"projet_task:ref:rowid";N;}}', 1, '', 4); $extrafields->addExtraField('projectphone', $langs->transnoentities('ProjectPhone'), 'phone', 100, '', 'projet', 0, 0, '', 'a:1:{s:7:"options";a:1:{s:0:"";N;}}', 1, '', 1); $extrafields->addExtraField('commstatus', $langs->transnoentities('CommercialStatus'), 'sellist', 100, '', 'propal', 0, 0, '', 'a:1:{s:7:"options";a:1:{s:34:"c_commercial_status:label:rowid::1";N;}}', 1, '', 1, 'CommercialStatusHelp'); $extrafields->addExtraField('commrefusal', $langs->transnoentities('RefusalReason'), 'sellist', 100, '', 'propal', 0, 0, '', 'a:1:{s:7:"options";a:1:{s:31:"c_refusal_reason:label:rowid::1";N;}}', 1, '', 1, 'RefusalReasonHelp'); + $extrafields->addExtraField('opporigin', $langs->transnoentities('OpportunityOrigin'), 'sellist', 100, '', 'projet', 0, 0, '', 'a:1:{s:7:"options";a:1:{s:19:"c_input_reason:code";N;}}', 1, '', 1); // Societe extrafields $extrafields->update('notation_societe_contact', 'NotationObjectContact', 'text', '', 'societe', 0, 0, 100, '', '', '', 5, 'NotationObjectContactHelp', '', '', 0, 'easycrm@easycrm', 1, 0, 0, ['csslist' => 'center']); diff --git a/core/tpl/easycrm_thirdparty_quickcreation.tpl.php b/core/tpl/easycrm_thirdparty_quickcreation.tpl.php index 208ce8a..491c0a2 100644 --- a/core/tpl/easycrm_thirdparty_quickcreation.tpl.php +++ b/core/tpl/easycrm_thirdparty_quickcreation.tpl.php @@ -9,40 +9,40 @@ print ''; // Name, firstname - if ($conf->global->EASYCRM_THIRDPARTY_NAME_VISIBLE > 0) { + if (getDolGlobalInt('EASYCRM_THIRDPARTY_NAME_VISIBLE') > 0) { print ''; print ''; print ''; } - if ($conf->global->EASYCRM_THIRDPARTY_CLIENT_VISIBLE > 0) { + if (getDolGlobalInt('EASYCRM_THIRDPARTY_CLIENT_VISIBLE') > 0) { print ''; - print ''; + print ''; } // Phone - if ($conf->global->EASYCRM_THIRDPARTY_PHONE_VISIBLE > 0) { + if (getDolGlobalInt('EASYCRM_THIRDPARTY_PHONE_VISIBLE') > 0) { print ''; print ''; print ''; } // Email - if ($conf->global->EASYCRM_THIRDPARTY_EMAIL_VISIBLE > 0) { + if (getDolGlobalInt('EASYCRM_THIRDPARTY_EMAIL_VISIBLE') > 0) { print ''; print ''; print ''; } // Web - if ($conf->global->EASYCRM_THIRDPARTY_WEB_VISIBLE > 0) { + if (getDolGlobalInt('EASYCRM_THIRDPARTY_WEB_VISIBLE') > 0) { print ''; print ''; print ''; } - // Commerical - if ($conf->global->EASYCRM_THIRDPARTY_WEB_VISIBLE > 0) { + // Commercial + if (getDolGlobalInt('EASYCRM_THIRDPARTY_COMMERCIAL_VISIBLE') > 0) { print ''; - $doleditor = new DolEditor('note_private', (GETPOSTISSET('note_private') ? GETPOST('note_private', 'alpha') : ''), '', 80, 'dolibarr_notes', 'In', 0, false, ((empty($conf->global->FCKEDITOR_ENABLE_NOTE_PRIVATE) || $conf->browser->layout == 'phone') ? 0 : 1), ROWS_3, '90%'); + $doleditor = new DolEditor('note_private', (GETPOSTISSET('note_private') ? GETPOST('note_private', 'alpha') : ''), '', 80, 'dolibarr_notes', 'In', 0, false, ((empty(getDolGlobalInt('FCKEDITOR_ENABLE_NOTE_PRIVATE')) || $conf->browser->layout == 'phone') ? 0 : 1), ROWS_3, '90%'); print ''; print ''; } // Categories - if (isModEnabled('categorie') && $conf->global->EASYCRM_THIRDPARTY_CATEGORIES_VISIBLE > 0 ) { + if (isModEnabled('categorie') && getDolGlobalInt('EASYCRM_THIRDPARTY_CATEGORIES_VISIBLE') > 0 ) { print '
' . $formcompany->selectProspectCustomerType(GETPOSTISSET('client') ? GETPOST('client') : $conf->global->EASYCRM_THIRDPARTY_CLIENT_VALUE, 'client', 'customerprospect', 'form', 'maxwidth200 widthcentpercentminusx') . '' . $formcompany->selectProspectCustomerType(GETPOSTISSET('client') ? GETPOST('client') : getDolGlobalInt('EASYCRM_THIRDPARTY_CLIENT_VALUE'), 'client', 'customerprospect', 'form', 'maxwidth200 widthcentpercentminusx') . '
' . img_picto('', 'phone', 'class="pictofixedwidth"') . '
' . img_picto('', 'object_email', 'class="pictofixedwidth"') . '
' . img_picto('', 'globe', 'class="pictofixedwidth"') . '
' . $langs->trans('AllocateCommercial') . ''; $userList = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, ' AND u.statut = 1 AND u.employee = 1', 0, '', '', 0, 1); print img_picto('', 'user', 'class="pictofixedwidth"') . $form->multiselectarray('commercial', $userList, GETPOST('commercial', 'array'), '', '', 'quatrevingtpercent widthcentpercentminusx'); @@ -50,15 +50,15 @@ } // Private note - if ($conf->global->EASYCRM_THIRDPARTY_PRIVATE_NOTE_VISIBLE > 0 && isModEnabled('fckeditor')) { + if (getDolGlobalInt('EASYCRM_THIRDPARTY_PRIVATE_NOTE_VISIBLE') > 0 && isModEnabled('fckeditor')) { print '
' . $doleditor->Create(1) . '
' . $langs->trans('CustomersProspectsCategoriesShort') . ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CUSTOMER, '', 'parent', 64, 0, 1); print img_picto('', 'category', 'class="pictofixedwidth"') . $form->multiselectarray('categories_customer', $cate_arbo, GETPOST('categories_customer', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx'); diff --git a/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php b/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php index 5e98367..4842d10 100644 --- a/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php +++ b/core/tpl/frontend/easycrm_project_quickcreation_frontend.tpl.php @@ -62,7 +62,7 @@