Skip to content

Commit

Permalink
#13 [QuickCreation] add: phone field
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Mar 17, 2023
1 parent e6c52b6 commit 44aa23e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions admin/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@
//print ajax_constantonoff('EASYCRM_THIRDPARTY_NAME_VISIBLE');
print '</td></td><td></tr>';

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

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

// Email
print '<tr class="oddeven"><td>';
print $langs->trans('Email');
Expand Down
1 change: 1 addition & 0 deletions core/modules/modEasyCRM.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public function __construct($db)
$i++ => ['EASYCRM_THIRDPARTY_CLIENT_VISIBLE', 'integer', 1, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_CLIENT_VALUE', 'integer', 2, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_NAME_VISIBLE', 'integer', 1, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_PHONE_VISIBLE', 'integer', 1, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_EMAIL_VISIBLE', 'integer', 1, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_WEB_VISIBLE', 'integer', 1, '', 0, 'current'],
$i++ => ['EASYCRM_THIRDPARTY_PRIVATE_NOTE_VISIBLE', 'integer', 1, '', 0, 'current'],
Expand Down
8 changes: 8 additions & 0 deletions view/quickcreation.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
$thirdparty->code_client = -1;
$thirdparty->client = GETPOST('client');
$thirdparty->name = GETPOST('name');
$thirdparty->phone = GETPOST('phone', 'alpha');
$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');
Expand Down Expand Up @@ -300,6 +301,13 @@
print '<td>' . $formcompany->selectProspectCustomerType(GETPOSTISSET('client') ? GETPOST('client') : $conf->global->EASYCRM_THIRDPARTY_CLIENT_VALUE, 'client', 'customerprospect', 'form', 'maxwidth200 widthcentpercentminusx') . '</td>';
}

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

// Email
if ($conf->global->EASYCRM_THIRDPARTY_EMAIL_VISIBLE > 0) {
print '<tr><td><label for="email_thirdparty">' . $langs->trans('Email') . '</label></td>';
Expand Down

0 comments on commit 44aa23e

Please sign in to comment.