Skip to content

Commit

Permalink
#27 [Mod] fix: change conf name
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Mar 22, 2023
1 parent d5113f7 commit ad98ab0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions class/actions_easycrm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function printCommonFooter(array $parameters): int

$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_TAGS_SET . ')';
$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'), ($parameters['currentcontext'] != 'thirdpartycomm' ? GETPOST('id') : ''), ($parameters['currentcontext'] != 'thirdpartycomm' ? 'project' : ''), $filter, 'a.datec');
if (is_array($actiomcomms) && !empty($actiomcomms)) {
$nbActiomcomms = count($actiomcomms);
Expand Down Expand Up @@ -299,7 +299,7 @@ public function printCommonFooter(array $parameters): int

$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_TAGS_SET . ')';
$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 . ')';
$projects = saturne_fetch_all_object_type('Project', '', '', $limit, $offset);
if (is_array($projects) && !empty($projects)) {
foreach ($projects as $project) {
Expand Down
6 changes: 3 additions & 3 deletions core/modules/modEasyCRM.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function __construct($db)
$i++ => ['EASYCRM_VERSION','chaine', $this->version, '', 0, 'current'],
$i++ => ['EASYCRM_DB_VERSION', 'chaine', $this->version, '', 0, 'current'],
$i++ => ['EASYCRM_SHOW_PATCH_NOTE', 'integer', 1, '', 0, 'current'],
$i => ['EASYCRM_TAGS_SET', 'integer', 0, '', 0, 'current'],
$i => ['EASYCRM_ACTIONCOMM_COMMERCIAL_RELAUNCH_TAG', 'integer', 0, '', 0, 'current'],
];

// Some keys to add into the overwriting translation tables
Expand Down Expand Up @@ -377,7 +377,7 @@ public function init($options = ''): int
$extrafields->addExtraField('commrelaunch', $langs->transnoentities('CommercialsRelaunching'), 'text', 100, 2000, 'projet', 0, 0, '', '', '', '', 2);
$extrafields->addExtraField('commtask', $langs->transnoentities('CommercialTask'), 'sellist', 100, 2000, 'projet', 0, 0, '', 'a:1:{s:7:"options";a:1:{s:39:"projet_task:ref:rowid::fk_projet = $ID$";N;}}', 1, '', 1);

if (empty($conf->global->EASYCRM_TAGS_SET)) {
if (empty($conf->global->EASYCRM_ACTIONCOMM_COMMERCIAL_RELAUNCH_TAG)) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';

$category = new Categorie($this->db);
Expand All @@ -386,7 +386,7 @@ public function init($options = ''): int
$category->type = 'actioncomm';
$categoryID = $category->create($user);

dolibarr_set_const($this->db, 'EASYCRM_TAGS_SET', $categoryID, 'integer', 0, '', $conf->entity);
dolibarr_set_const($this->db, 'EASYCRM_ACTIONCOMM_COMMERCIAL_RELAUNCH_TAG', $categoryID, 'integer', 0, '', $conf->entity);
}

// Permissions
Expand Down
2 changes: 1 addition & 1 deletion view/quickevent.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@
if (isModEnabled('categorie') && $conf->global->EASYCRM_EVENT_CATEGORIES_VISIBLE > 0) {
print '<tr><td>' . $langs->trans('Categories') . '</td><td>';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
$category->fetch($conf->global->EASYCRM_TAGS_SET);
$category->fetch($conf->global->EASYCRM_ACTIONCOMM_COMMERCIAL_RELAUNCH_TAG);
$categoriesArray = [$category->id, $category->label];
print img_picto('', 'category', 'class="pictofixedwidth"') . $form->multiselectarray('categories', $cate_arbo, GETPOSTISSET('categories') ? GETPOST('categories', 'array') : $categoriesArray, '', 0, 'quatrevingtpercent widthcentpercentminusx');
print '</td></tr>';
Expand Down

0 comments on commit ad98ab0

Please sign in to comment.