Skip to content

Commit

Permalink
#13 [QuickCreation] add: field web and privatenote
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Mar 17, 2023
1 parent 99df2c1 commit 5d5672e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
24 changes: 23 additions & 1 deletion admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,28 @@
print ajax_constantonoff('EASYCRM_THIRDPARTY_EMAIL_VISIBLE');
print '</td></td><td></tr>';

// Web
print '<tr class="oddeven"><td>';
print $langs->trans('Web');
print '</td><td>';
print $langs->trans('ObjectVisibleDescription', $langs->trans('Web'));
print '</td>';

print '<td class="center">';
print ajax_constantonoff('EASYCRM_THIRDPARTY_WEB_VISIBLE');
print '</td></td><td></tr>';

// Private note
print '<tr class="oddeven"><td>';
print $langs->trans('NotePrivate');
print '</td><td>';
print $langs->trans('ObjectVisibleDescription', $langs->transnoentities('NotePrivate'));
print '</td>';

print '<td class="center">';
print ajax_constantonoff('EASYCRM_THIRDPARTY_PRIVATE_NOTE_VISIBLE');
print '</td></td><td></tr>';

// CustomersProspectsCategoriesShort
print '<tr class="oddeven"><td>';
print $langs->trans('CustomersProspectsCategoriesShort');
Expand Down Expand Up @@ -271,7 +293,7 @@
print '</td>';

if ($conf->global->EASYCRM_PROJECT_OPPORTUNITY_AMOUNT_VISIBLE > 0) {
print '<td><input type="number" name="project_opportunity_amount minwidth200" value="' . $conf->global->EASYCRM_PROJECT_OPPORTUNITY_AMOUNT_VALUE . '"></td>';
print '<td><input type="number" name="project_opportunity_amount" class="minwidth200" value="' . $conf->global->EASYCRM_PROJECT_OPPORTUNITY_AMOUNT_VALUE . '"></td>';
} else {
print '<td></td>';
}
Expand Down
4 changes: 3 additions & 1 deletion core/modules/modEasyCRM.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,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 = ['modSaturne'];
$this->depends = ['modSaturne', 'modFckeditor'];
$this->requiredby = []; // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = []; // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)

Expand Down Expand Up @@ -165,6 +165,8 @@ public function __construct($db)
$i++ => ['EASYCRM_THIRDPARTY_CLIENT_VALUE', 'integer', 2, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_NAME_VISIBLE', 'integer', 1, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_EMAIL_VISIBLE', 'integer', 1, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_WEB_VISIBLE', 'integer', 1, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_PRIVATE_NOTE_VISIBLE', 'integer', 1, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_CATEGORIES_VISIBLE', 'integer', 1, '', 0, 'current'],

// CONST CONTACT
Expand Down
28 changes: 24 additions & 4 deletions view/quickcreation.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
if (isModEnabled('societe')) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
}
if (isModEnabled('fckeditor')) {
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
}
if (isModEnabled('categorie')) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
}
Expand Down Expand Up @@ -124,10 +127,12 @@
$db->begin();

if (!empty(GETPOST('name'))) {
$thirdparty->code_client = -1;
$thirdparty->client = GETPOST('client');
$thirdparty->name = GETPOST('name');
$thirdparty->email = trim(GETPOST('email_thirdparty', 'custom', 0, FILTER_SANITIZE_EMAIL));
$thirdparty->code_client = -1;
$thirdparty->client = GETPOST('client');
$thirdparty->name = GETPOST('name');
$thirdparty->email = trim(GETPOST('email_thirdparty', 'custom', 0, FILTER_SANITIZE_EMAIL));
$thirdparty->url = trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL));
$thirdparty->note_private = GETPOST('note_private');

$thirdpartyID = $thirdparty->create($user);
if ($thirdpartyID > 0) {
Expand Down Expand Up @@ -302,6 +307,21 @@
print '</tr>';
}

// Web
if ($conf->global->EASYCRM_THIRDPARTY_WEB_VISIBLE > 0) {
print '<tr><td><label for="url">' . $langs->trans('Web') . '</label></td>';
print '<td>' . img_picto('', 'globe', 'class="pictofixedwidth"') . ' <input type="text" name="url" id="url" class="maxwidth200 widthcentpercentminusx" value="' . (GETPOSTISSET('url') ? GETPOST('url', 'alpha') : '') . '"></td>';
print '</tr>';
}

// Private note
if ($conf->global->EASYCRM_THIRDPARTY_PRIVATE_NOTE_VISIBLE > 0 && isModEnabled('fckeditor')) {
print '<tr><td><label for="note_private">' . $langs->trans('NotePrivate') . '</label></td>';
$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%');
print '<td>' . $doleditor->Create(1) . '</td>';
print '</tr>';
}

// Categories
if (isModEnabled('categorie') && $conf->global->EASYCRM_THIRDPARTY_CATEGORIES_VISIBLE > 0 ) {
print '<tr><td>' . $langs->trans('CustomersProspectsCategoriesShort') . '</td><td>';
Expand Down

0 comments on commit 5d5672e

Please sign in to comment.