Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/modulebuilder/template/myobject_list.php
This commit is contained in:
commit
06804c3547
@ -1719,8 +1719,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '</td></tr>';
|
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.dol_escape_htmltag($object->company).'</td></tr>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.dol_escape_htmltag($object->company).'</td></tr>';
|
||||||
|
|
||||||
@ -1737,9 +1735,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
|
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
|
||||||
}
|
}
|
||||||
print '<span class="opacitymedium"'.$langs->trans("Hidden").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
|
||||||
}
|
}
|
||||||
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
|
if (!empty($object->pass_indatabase) && empty($object->user_id)) { // Show warning only for old password still in clear (does not happen anymore)
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
|
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
|
||||||
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
|
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
|
||||||
@ -1778,7 +1776,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print '<div class="fichehalfright">';
|
print '<div class="fichehalfright">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border tableforfield tableforfield centpercent">';
|
print '<table class="border tableforfield centpercent">';
|
||||||
|
|
||||||
// Tags / Categories
|
// Tags / Categories
|
||||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||||
@ -1853,18 +1851,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// VCard
|
|
||||||
/*
|
|
||||||
print '<tr><td>';
|
|
||||||
print $langs->trans("VCard").'</td><td colspan="3">';
|
|
||||||
print '<a href="'.DOL_URL_ROOT.'/adherents/vcard.php?id='.$object->id.'">';
|
|
||||||
print img_picto($langs->trans("Download").' vcard', 'vcard.png', 'class="paddingrightonly"');
|
|
||||||
print $langs->trans("Download");
|
|
||||||
print img_picto($langs->trans("Download").' vcard', 'download', 'class="paddingleft"');
|
|
||||||
print '</a>';
|
|
||||||
print '</td></tr>';
|
|
||||||
*/
|
|
||||||
|
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
|
|
||||||
print "</div></div>\n";
|
print "</div></div>\n";
|
||||||
|
|||||||
@ -501,7 +501,7 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
// Login
|
// Login
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.dol_escape_htmltag($object->login).'</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
@ -512,25 +512,24 @@ if ($rowid > 0) {
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Company
|
// Company
|
||||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.dol_escape_htmltag($object->company).'</td></tr>';
|
||||||
|
|
||||||
// Civility
|
// Civility
|
||||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().' </td>';
|
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Password
|
// Password
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||||
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass);
|
print '<tr><td>'.$langs->trans("Password").'</td><td>';
|
||||||
if ($object->pass) {
|
if ($object->pass) {
|
||||||
print preg_replace('/./i', '*', $object->pass);
|
print preg_replace('/./i', '*', $object->pass);
|
||||||
} else {
|
} else {
|
||||||
if ($user->admin) {
|
if ($user->admin) {
|
||||||
print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
|
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
|
||||||
} else {
|
|
||||||
print $langs->trans("Hidden");
|
|
||||||
}
|
}
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
|
||||||
}
|
}
|
||||||
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
|
if (!empty($object->pass_indatabase) && empty($object->user_id)) { // Show warning only for old password still in clear (does not happen anymore)
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
|
$htmltext = $langs->trans("WarningPasswordSetWithNoAccount");
|
||||||
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
|
print ' '.$form->textwithpicto('', $htmltext, 1, 'warning');
|
||||||
@ -546,15 +545,17 @@ if ($rowid > 0) {
|
|||||||
print " ".img_warning($langs->trans("Late"));
|
print " ".img_warning($langs->trans("Late"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!$adht->subscription) {
|
if ($object->need_subscription == 0) {
|
||||||
|
print $langs->trans("SubscriptionNotNeeded");
|
||||||
|
} elseif (!$adht->subscription) {
|
||||||
print $langs->trans("SubscriptionNotRecorded");
|
print $langs->trans("SubscriptionNotRecorded");
|
||||||
if ($object->statut > 0) {
|
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("SubscriptionNotReceived");
|
print $langs->trans("SubscriptionNotReceived");
|
||||||
if ($object->statut > 0) {
|
if (Adherent::STATUS_VALIDATED == $object->statut) {
|
||||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -563,18 +564,13 @@ if ($rowid > 0) {
|
|||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="fichehalfright">';
|
|
||||||
|
|
||||||
|
print '<div class="fichehalfright">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
|
|
||||||
print '<table class="border tableforfield centpercent">';
|
print '<table class="border tableforfield centpercent">';
|
||||||
|
|
||||||
// Birthday
|
// Tags / Categories
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
|
||||||
|
|
||||||
// Public
|
|
||||||
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
|
||||||
|
|
||||||
// Categories
|
|
||||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||||
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
print '<tr><td>'.$langs->trans("Categories").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
@ -582,6 +578,12 @@ if ($rowid > 0) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Birth Date
|
||||||
|
print '<tr><td class="titlefield">'.$langs->trans("DateOfBirth").'</td><td class="valeur">'.dol_print_date($object->birth, 'day').'</td></tr>';
|
||||||
|
|
||||||
|
// Public
|
||||||
|
print '<tr><td>'.$langs->trans("Public").'</td><td class="valeur">'.yn($object->public).'</td></tr>';
|
||||||
|
|
||||||
// Other attributes
|
// Other attributes
|
||||||
$cols = 2;
|
$cols = 2;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||||
@ -663,8 +665,6 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
print '</form>';
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Action bar
|
* Action bar
|
||||||
|
|||||||
@ -50,7 +50,7 @@ $substitutionarrayfortest = array(
|
|||||||
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
||||||
'__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
|
'__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
|
||||||
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
||||||
'__LOGIN__' => 'RecipientLogin',
|
'__LOGIN__' => $user->login,
|
||||||
'__LASTNAME__' => 'RecipientLastname',
|
'__LASTNAME__' => 'RecipientLastname',
|
||||||
'__FIRSTNAME__' => 'RecipientFirstname',
|
'__FIRSTNAME__' => 'RecipientFirstname',
|
||||||
'__ADDRESS__'=> 'RecipientAddress',
|
'__ADDRESS__'=> 'RecipientAddress',
|
||||||
@ -662,7 +662,7 @@ if ($action == 'edit') {
|
|||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_EMAIL_DKIM_ENABLED").'</td><td>';
|
||||||
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) {
|
if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('swiftmailer'))) {
|
||||||
if (function_exists('openssl_open')) {
|
if (function_exists('openssl_open')) {
|
||||||
print yn($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED);
|
print yn(getDolGlobalInt('MAIN_MAIL_EMAIL_DKIM_ENABLED'));
|
||||||
} else {
|
} else {
|
||||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||||
}
|
}
|
||||||
@ -887,7 +887,6 @@ if ($action == 'edit') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setEventMessages($errormsg, null, 'errors');
|
setEventMessages($errormsg, null, 'errors');
|
||||||
print $errormsg;
|
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|||||||
$langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'errors'));
|
$langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'errors'));
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'aZ09');
|
||||||
|
|
||||||
if (!$user->admin) {
|
if (!$user->admin) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
@ -40,17 +40,22 @@ if (!$user->admin) {
|
|||||||
$usersignature = $user->signature;
|
$usersignature = $user->signature;
|
||||||
// For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html.
|
// For action = test or send, we ensure that content is not html, even for signature, because this we want a test with NO html.
|
||||||
if ($action == 'test' || $action == 'send') {
|
if ($action == 'test' || $action == 'send') {
|
||||||
$usersignature = dol_string_nohtmltag($usersignature);
|
$usersignature = dol_string_nohtmltag($usersignature, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$substitutionarrayfortest = array(
|
$substitutionarrayfortest = array(
|
||||||
'__LOGIN__' => $user->login,
|
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||||
'__ID__' => 'TESTIdRecord',
|
'__ID__' => 'RecipientIdRecord',
|
||||||
'__EMAIL__' => 'TESTEMail',
|
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
||||||
'__LASTNAME__' => 'TESTLastname',
|
'__CHECK_READ__' => (!empty($object) && is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
|
||||||
'__FIRSTNAME__' => 'TESTFirstname',
|
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
||||||
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''),
|
'__LOGIN__' => $user->login,
|
||||||
//'__PERSONALIZED__' => 'TESTPersonalized' // Hiden because not used yet
|
'__LASTNAME__' => 'RecipientLastname',
|
||||||
|
'__FIRSTNAME__' => 'RecipientFirstname',
|
||||||
|
'__ADDRESS__'=> 'RecipientAddress',
|
||||||
|
'__ZIP__'=> 'RecipientZip',
|
||||||
|
'__TOWN_'=> 'RecipientTown',
|
||||||
|
'__COUNTRY__'=> 'RecipientCountry'
|
||||||
);
|
);
|
||||||
complete_substitutions_array($substitutionarrayfortest, $langs);
|
complete_substitutions_array($substitutionarrayfortest, $langs);
|
||||||
|
|
||||||
@ -86,10 +91,10 @@ $trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
|||||||
$sendcontext = 'emailing'; // Force to use dedicated context of setup for emailing
|
$sendcontext = 'emailing'; // Force to use dedicated context of setup for emailing
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||||
|
|
||||||
if ($action == 'presend' && GETPOST('trackid') == 'test') {
|
if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'test') {
|
||||||
$action = 'test';
|
$action = 'test';
|
||||||
}
|
}
|
||||||
if ($action == 'presend' && GETPOST('trackid') == 'testhtml') {
|
if ($action == 'presend' && GETPOST('trackid', 'alphanohtml') == 'testhtml') {
|
||||||
$action = 'testhtml';
|
$action = 'testhtml';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,12 +276,15 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
// Host server
|
// Host server
|
||||||
|
|
||||||
print '<tr class="oddeven hideifdefault"><td>';
|
print '<tr class="oddeven hideifdefault">';
|
||||||
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') {
|
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') {
|
||||||
|
print '<td>';
|
||||||
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
|
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print $langs->trans("SeeLocalSendMailSetup");
|
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||||
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
|
print '<td>';
|
||||||
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '');
|
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING : '');
|
||||||
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
|
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
|
||||||
if ($linuxlike) {
|
if ($linuxlike) {
|
||||||
@ -287,17 +295,19 @@ if ($action == 'edit') {
|
|||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
// SuperAdministrator access only
|
// SuperAdministrator access only
|
||||||
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
||||||
print '<input class="flat" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">';
|
print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">';
|
||||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">';
|
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">';
|
||||||
print '<span id="smtp_server_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||||
|
print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>';
|
||||||
} else {
|
} else {
|
||||||
$text = !empty($mainserver) ? $mainserver : $smtpserver;
|
$text = !empty($mainserver) ? $mainserver : $smtpserver;
|
||||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||||
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
|
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
|
||||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">';
|
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">';
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Port
|
// Port
|
||||||
|
|
||||||
@ -305,7 +315,7 @@ if ($action == 'edit') {
|
|||||||
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') {
|
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE_EMAILING == 'mail') {
|
||||||
print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
|
print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike");
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print $langs->trans("SeeLocalSendMailSetup");
|
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||||
} else {
|
} else {
|
||||||
$mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '');
|
$mainport = (!empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : '');
|
||||||
$smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined");
|
$smtpport = ini_get('smtp_port') ?ini_get('smtp_port') : $langs->transnoentities("Undefined");
|
||||||
@ -319,7 +329,7 @@ if ($action == 'edit') {
|
|||||||
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
||||||
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">';
|
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">';
|
||||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">';
|
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">';
|
||||||
print '<span id="smtp_port_mess">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||||
} else {
|
} else {
|
||||||
$text = (!empty($mainport) ? $mainport : $smtpport);
|
$text = (!empty($mainport) ? $mainport : $smtpport);
|
||||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||||
@ -360,7 +370,6 @@ if ($action == 'edit') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TLS
|
// TLS
|
||||||
|
|
||||||
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
|
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_TLS").'</td><td>';
|
||||||
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
||||||
if (function_exists('openssl_open')) {
|
if (function_exists('openssl_open')) {
|
||||||
@ -374,7 +383,6 @@ if ($action == 'edit') {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// STARTTLS
|
// STARTTLS
|
||||||
|
|
||||||
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
|
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_STARTTLS").'</td><td>';
|
||||||
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
||||||
if (function_exists('openssl_open')) {
|
if (function_exists('openssl_open')) {
|
||||||
@ -388,7 +396,6 @@ if ($action == 'edit') {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// SMTP_ALLOW_SELF_SIGNED_EMAILING
|
// SMTP_ALLOW_SELF_SIGNED_EMAILING
|
||||||
|
|
||||||
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
|
print '<tr class="oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED").'</td><td>';
|
||||||
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
||||||
if (function_exists('openssl_open')) {
|
if (function_exists('openssl_open')) {
|
||||||
@ -414,6 +421,7 @@ if ($action == 'edit') {
|
|||||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||||
print "<br><br>\n";
|
print "<br><br>\n";
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
@ -460,7 +468,7 @@ if ($action == 'edit') {
|
|||||||
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print yn(0).' ('.$langs->trans("NotSupported").')';
|
print '<span class="opacitymedium">'.yn(0).' ('.$langs->trans("NotSupported").')</span>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -492,6 +500,7 @@ if ($action == 'edit') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
@ -543,6 +552,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
// Run the test to connect
|
// Run the test to connect
|
||||||
if ($action == 'testconnect') {
|
if ($action == 'testconnect') {
|
||||||
|
print '<div id="formmailaftertstconnect" name="formmailaftertstconnect"></div>';
|
||||||
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
|
print load_fiche_titre($langs->trans("DoTestServerAvailability"));
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||||
@ -573,16 +583,18 @@ if ($action == 'edit') {
|
|||||||
// Cree l'objet formulaire mail
|
// Cree l'objet formulaire mail
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
|
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
||||||
$formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
$formmail->fromid = $user->id;
|
||||||
|
$formmail->fromalsorobot = 1;
|
||||||
$formmail->withfromreadonly = 0;
|
$formmail->withfromreadonly = 0;
|
||||||
$formmail->withsubstit = 0;
|
$formmail->withsubstit = 0;
|
||||||
$formmail->withfrom = 1;
|
$formmail->withfrom = 1;
|
||||||
$formmail->witherrorsto = 1;
|
$formmail->witherrorsto = 1;
|
||||||
$formmail->withto = (!GETPOST('sendto') ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
|
$formmail->withto = (GETPOSTISSET('sendto') ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
|
||||||
$formmail->withtocc = (!GETPOST(['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
|
$formmail->withtocc = (GETPOSTISSET(['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
|
||||||
$formmail->withtoccc = (!GETPOST(['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
|
$formmail->withtoccc = (GETPOSTISSET(['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
|
||||||
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
|
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
|
||||||
$formmail->withtopicreadonly = 0;
|
$formmail->withtopicreadonly = 0;
|
||||||
$formmail->withfile = 2;
|
$formmail->withfile = 2;
|
||||||
@ -601,7 +613,7 @@ if ($action == 'edit') {
|
|||||||
$formmail->param["returnurl"] = $_SERVER["PHP_SELF"];
|
$formmail->param["returnurl"] = $_SERVER["PHP_SELF"];
|
||||||
|
|
||||||
// Init list of files
|
// Init list of files
|
||||||
if (GETPOST("mode") == 'init') {
|
if (GETPOST("mode", "aZ09") == 'init') {
|
||||||
$formmail->clear_attached_files();
|
$formmail->clear_attached_files();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -848,8 +848,13 @@ class Utils
|
|||||||
$resarray = $utils->executeCLI($command, $outfile);
|
$resarray = $utils->executeCLI($command, $outfile);
|
||||||
if ($resarray['result'] != '0') {
|
if ($resarray['result'] != '0') {
|
||||||
$this->error = $resarray['error'].' '.$resarray['output'];
|
$this->error = $resarray['error'].' '.$resarray['output'];
|
||||||
|
$this->errors[] = $this->error;
|
||||||
}
|
}
|
||||||
$result = ($resarray['result'] == 0) ? 1 : 0;
|
$result = ($resarray['result'] == 0) ? 1 : 0;
|
||||||
|
if ($result < 0 && empty($this->errors)) {
|
||||||
|
$this->error = $langs->trans("ErrorFailToGenerateFile", $FILENAMEDOC);
|
||||||
|
$this->errors[] = $this->error;
|
||||||
|
}
|
||||||
|
|
||||||
// Build PDF doc
|
// Build PDF doc
|
||||||
$command = $conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOCPDF;
|
$command = $conf->global->MODULEBUILDER_ASCIIDOCTORPDF.' '.$destfile.' -n -o '.$dirofmoduledoc.'/'.$FILENAMEDOCPDF;
|
||||||
@ -857,8 +862,13 @@ class Utils
|
|||||||
$resarray = $utils->executeCLI($command, $outfile);
|
$resarray = $utils->executeCLI($command, $outfile);
|
||||||
if ($resarray['result'] != '0') {
|
if ($resarray['result'] != '0') {
|
||||||
$this->error = $resarray['error'].' '.$resarray['output'];
|
$this->error = $resarray['error'].' '.$resarray['output'];
|
||||||
|
$this->errors[] = $this->error;
|
||||||
}
|
}
|
||||||
$result = ($resarray['result'] == 0) ? 1 : 0;
|
$result = ($resarray['result'] == 0) ? 1 : 0;
|
||||||
|
if ($result < 0 && empty($this->errors)) {
|
||||||
|
$this->error = $langs->trans("ErrorFailToGenerateFile", $FILENAMEDOCPDF);
|
||||||
|
$this->errors[] = $this->error;
|
||||||
|
}
|
||||||
|
|
||||||
chdir($currentdir);
|
chdir($currentdir);
|
||||||
} else {
|
} else {
|
||||||
@ -869,8 +879,6 @@ class Utils
|
|||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
$langs->load("errors");
|
|
||||||
$this->error = $langs->trans("ErrorFailToGenerateFile", $outputfiledoc);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$error++;
|
$error++;
|
||||||
|
|||||||
@ -18,17 +18,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file core/triggers/interface_99_modZapier_ZapierTriggers.class.php
|
* \file core/triggers/interface_99_modZapier_ZapierTriggers.class.php
|
||||||
* \ingroup zapier
|
* \ingroup zapier
|
||||||
* \brief Example trigger.
|
* \brief File for Zappier Triggers.
|
||||||
*
|
|
||||||
*
|
|
||||||
* \remarks You can create other triggers by copying this one.
|
|
||||||
* - File name should be either:
|
|
||||||
* - interface_99_modZapier_MyTrigger.class.php
|
|
||||||
* - interface_99_all_MyTrigger.class.php
|
|
||||||
* - The file must stay in core/triggers
|
|
||||||
* - The class name must be InterfaceMytrigger
|
|
||||||
* - The constructor method must be named InterfaceMytrigger
|
|
||||||
* - The name property name must be MyTrigger
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
||||||
|
|||||||
@ -94,7 +94,7 @@ LanguageDefDesc=Enter in this files, all the key and the translation for each la
|
|||||||
MenusDefDesc=Define here the menus provided by your module
|
MenusDefDesc=Define here the menus provided by your module
|
||||||
DictionariesDefDesc=Define here the dictionaries provided by your module
|
DictionariesDefDesc=Define here the dictionaries provided by your module
|
||||||
PermissionsDefDesc=Define here the new permissions provided by your module
|
PermissionsDefDesc=Define here the new permissions provided by your module
|
||||||
MenusDefDescTooltip=The menus provided by your module/application are defined into the array <strong>$this->menus</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), menus are also visible into the menu editor available to administrator users on %s.
|
MenusDefDescTooltip=The menus provided by your module/application are defined into the array <strong>$this->menus</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and the module re-activated), the menus are also visible into the menu editor available to administrator users on %s.
|
||||||
DictionariesDefDescTooltip=The dictionaries provided by your module/application are defined into the array <strong>$this->dictionaries</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), dictionaries are also visible into the setup area to administrator users on %s.
|
DictionariesDefDescTooltip=The dictionaries provided by your module/application are defined into the array <strong>$this->dictionaries</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), dictionaries are also visible into the setup area to administrator users on %s.
|
||||||
PermissionsDefDescTooltip=The permissions provided by your module/application are defined into the array <strong>$this->rights</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), permissions are visible into the default permissions setup %s.
|
PermissionsDefDescTooltip=The permissions provided by your module/application are defined into the array <strong>$this->rights</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.<br><br>Note: Once defined (and module re-activated), permissions are visible into the default permissions setup %s.
|
||||||
HooksDefDesc=Define in the <b>module_parts['hooks']</b> property, in the module descriptor, the context of hooks you want to manage (list of contexts can be found by a search on '<b>initHooks(</b>' in core code).<br>Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on '<b>executeHooks</b>' in core code).
|
HooksDefDesc=Define in the <b>module_parts['hooks']</b> property, in the module descriptor, the context of hooks you want to manage (list of contexts can be found by a search on '<b>initHooks(</b>' in core code).<br>Edit the hook file to add code of your hooked functions (hookable functions can be found by a search on '<b>executeHooks</b>' in core code).
|
||||||
@ -110,7 +110,7 @@ DropTableIfEmpty=(Destroy table if empty)
|
|||||||
TableDoesNotExists=The table %s does not exists
|
TableDoesNotExists=The table %s does not exists
|
||||||
TableDropped=Table %s deleted
|
TableDropped=Table %s deleted
|
||||||
InitStructureFromExistingTable=Build the structure array string of an existing table
|
InitStructureFromExistingTable=Build the structure array string of an existing table
|
||||||
UseAboutPage=Disable the about page
|
UseAboutPage=Do not generate the About page
|
||||||
UseDocFolder=Disable the documentation folder
|
UseDocFolder=Disable the documentation folder
|
||||||
UseSpecificReadme=Use a specific ReadMe
|
UseSpecificReadme=Use a specific ReadMe
|
||||||
ContentOfREADMECustomized=Note: The content of the README.md file has been replaced with the specific value defined into setup of ModuleBuilder.
|
ContentOfREADMECustomized=Note: The content of the README.md file has been replaced with the specific value defined into setup of ModuleBuilder.
|
||||||
@ -138,10 +138,12 @@ CSSViewClass=CSS for read form
|
|||||||
CSSListClass=CSS for list
|
CSSListClass=CSS for list
|
||||||
NotEditable=Not editable
|
NotEditable=Not editable
|
||||||
ForeignKey=Foreign key
|
ForeignKey=Foreign key
|
||||||
TypeOfFieldsHelp=Type of fields:<br>varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]] ('1' means we add a + button after the combo to create the record, 'filter' can be 'status=1 AND fk_user = __USER_ID AND entity IN (__SHARED_ENTITIES__)' for example)
|
TypeOfFieldsHelp=Type of fields:<br>varchar(99), double(24,8), real, text, html, datetime, timestamp, integer, integer:ClassName:relativepath/to/classfile.class.php[:1[:filter]]<br>'1' means we add a + button after the combo to create the record<br>'filter' is a sql condition, example: 'status=1 AND fk_user=__USER_ID__ AND entity IN (__SHARED_ENTITIES__)'
|
||||||
AsciiToHtmlConverter=Ascii to HTML converter
|
AsciiToHtmlConverter=Ascii to HTML converter
|
||||||
AsciiToPdfConverter=Ascii to PDF converter
|
AsciiToPdfConverter=Ascii to PDF converter
|
||||||
TableNotEmptyDropCanceled=Table not empty. Drop has been canceled.
|
TableNotEmptyDropCanceled=Table not empty. Drop has been canceled.
|
||||||
ModuleBuilderNotAllowed=The module builder is available but not allowed to your user.
|
ModuleBuilderNotAllowed=The module builder is available but not allowed to your user.
|
||||||
ImportExportProfiles=Import and export profiles
|
ImportExportProfiles=Import and export profiles
|
||||||
ValidateModBuilderDesc=Put 1 if this field need to be validated with $this->validateField() or 0 if validation required
|
ValidateModBuilderDesc=Put 1 if this field need to be validated with $this->validateField() or 0 if validation required
|
||||||
|
WarningDatabaseIsNotUpdated=Warning: The database is not updated automatically, you must destroy tables and disable-enable the module to have tables recreated
|
||||||
|
LinkToParentMenu=Parent menu (fk_xxxxmenu)
|
||||||
@ -120,7 +120,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("UseAboutPage").'</td>';
|
print '<td>'.$langs->trans("UseAboutPage").'</td>';
|
||||||
print '<td class="center">';
|
print '<td>';
|
||||||
if ($conf->use_javascript_ajax) {
|
if ($conf->use_javascript_ajax) {
|
||||||
print ajax_constantonoff('MODULEBUILDER_USE_ABOUT');
|
print ajax_constantonoff('MODULEBUILDER_USE_ABOUT');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -955,6 +955,21 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
|
|||||||
if ($fieldname == 'entity') {
|
if ($fieldname == 'entity') {
|
||||||
$index = 1;
|
$index = 1;
|
||||||
}
|
}
|
||||||
|
// css
|
||||||
|
$css = '';
|
||||||
|
$cssview = '';
|
||||||
|
$csslist = '';
|
||||||
|
if (preg_match('/^fk_/', $fieldname)) {
|
||||||
|
$css = 'maxwidth500 widthcentpercentminusxx';
|
||||||
|
}
|
||||||
|
if ($fieldname == 'label') {
|
||||||
|
$css = 'minwidth300';
|
||||||
|
$cssview = 'wordbreak';
|
||||||
|
}
|
||||||
|
if (in_array($fieldname, array('note_public', 'note_private'))) {
|
||||||
|
$cssview = 'wordbreak';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$string .= "'".$obj->Field."' =>array('type'=>'".$type."', 'label'=>'".$label."',";
|
$string .= "'".$obj->Field."' =>array('type'=>'".$type."', 'label'=>'".$label."',";
|
||||||
if ($default != '') {
|
if ($default != '') {
|
||||||
@ -972,6 +987,15 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
|
|||||||
if ($index) {
|
if ($index) {
|
||||||
$string .= ", 'index'=>".$index;
|
$string .= ", 'index'=>".$index;
|
||||||
}
|
}
|
||||||
|
if ($css) {
|
||||||
|
$string .= ", 'css'=>".$css;
|
||||||
|
}
|
||||||
|
if ($cssview) {
|
||||||
|
$string .= ", 'cssview'=>".$cssview;
|
||||||
|
}
|
||||||
|
if ($csslist) {
|
||||||
|
$string .= ", 'csslist'=>".$csslist;
|
||||||
|
}
|
||||||
$string .= "),\n";
|
$string .= "),\n";
|
||||||
$string .= "<br>";
|
$string .= "<br>";
|
||||||
$i += 5;
|
$i += 5;
|
||||||
@ -1307,7 +1331,6 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$addfieldentry = array(
|
$addfieldentry = array(
|
||||||
@ -1324,9 +1347,9 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
'isameasure'=>GETPOST('propisameasure', 'int'),
|
'isameasure'=>GETPOST('propisameasure', 'int'),
|
||||||
'comment'=>GETPOST('propcomment', 'alpha'),
|
'comment'=>GETPOST('propcomment', 'alpha'),
|
||||||
'help'=>GETPOST('prophelp', 'alpha'),
|
'help'=>GETPOST('prophelp', 'alpha'),
|
||||||
'css'=>GETPOST('propcss', 'aZ09'),
|
'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example
|
||||||
'cssview'=>GETPOST('propcssview', 'aZ09'),
|
'cssview'=>GETPOST('propcssview', 'alpha'),
|
||||||
'csslist'=>GETPOST('propcsslist', 'aZ09'),
|
'csslist'=>GETPOST('propcsslist', 'alpha'),
|
||||||
'default'=>GETPOST('propdefault', 'restricthtml'),
|
'default'=>GETPOST('propdefault', 'restricthtml'),
|
||||||
'noteditable'=>intval(GETPOST('propnoteditable', 'int')),
|
'noteditable'=>intval(GETPOST('propnoteditable', 'int')),
|
||||||
'validate' => GETPOST('propvalidate', 'int')
|
'validate' => GETPOST('propvalidate', 'int')
|
||||||
@ -1336,6 +1359,7 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
$addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true);
|
$addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*if (GETPOST('regeneratemissing'))
|
/*if (GETPOST('regeneratemissing'))
|
||||||
{
|
{
|
||||||
@ -1346,8 +1370,8 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
// Edit the class file to write properties
|
// Edit the class file to write properties
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
$moduletype = 'external';
|
$moduletype = 'external';
|
||||||
|
|
||||||
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry, $moduletype);
|
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry, $moduletype);
|
||||||
|
|
||||||
if (is_numeric($object) && $object <= 0) {
|
if (is_numeric($object) && $object <= 0) {
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -1366,6 +1390,8 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null);
|
setEventMessages($langs->trans('FilesForObjectUpdated', $objectname), null);
|
||||||
|
|
||||||
|
setEventMessages($langs->trans('WarningDatabaseIsNotUpdated'), null);
|
||||||
|
|
||||||
clearstatcache(true);
|
clearstatcache(true);
|
||||||
|
|
||||||
// Make a redirect to reload all data
|
// Make a redirect to reload all data
|
||||||
@ -1940,6 +1966,11 @@ if ($module == 'initmodule') {
|
|||||||
$head2[$h][2] = 'description';
|
$head2[$h][2] = 'description';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||||
|
$head2[$h][1] = $langs->trans("Objects");
|
||||||
|
$head2[$h][2] = 'objects';
|
||||||
|
$h++;
|
||||||
|
|
||||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=languages&module='.$module.($forceddirread ? '@'.$dirread : '');
|
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=languages&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||||
$head2[$h][1] = $langs->trans("Languages");
|
$head2[$h][1] = $langs->trans("Languages");
|
||||||
$head2[$h][2] = 'languages';
|
$head2[$h][2] = 'languages';
|
||||||
@ -1950,11 +1981,6 @@ if ($module == 'initmodule') {
|
|||||||
$head2[$h][2] = 'dictionaries';
|
$head2[$h][2] = 'dictionaries';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : '');
|
|
||||||
$head2[$h][1] = $langs->trans("Objects");
|
|
||||||
$head2[$h][2] = 'objects';
|
|
||||||
$h++;
|
|
||||||
|
|
||||||
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=permissions&module='.$module.($forceddirread ? '@'.$dirread : '');
|
$head2[$h][0] = $_SERVER["PHP_SELF"].'?tab=permissions&module='.$module.($forceddirread ? '@'.$dirread : '');
|
||||||
$head2[$h][1] = $langs->trans("Permissions");
|
$head2[$h][1] = $langs->trans("Permissions");
|
||||||
$head2[$h][2] = 'permissions';
|
$head2[$h][2] = 'permissions';
|
||||||
@ -2537,8 +2563,9 @@ if ($module == 'initmodule') {
|
|||||||
$pathtoapi = strtolower($module).'/class/api_'.strtolower($module).'s.class.php';
|
$pathtoapi = strtolower($module).'/class/api_'.strtolower($module).'s.class.php';
|
||||||
$realpathtoapi = $dirread.'/'.$pathtoapi;
|
$realpathtoapi = $dirread.'/'.$pathtoapi;
|
||||||
}
|
}
|
||||||
$urloflist = $dirread.'/'.$pathtolist;
|
|
||||||
$urlofcard = $dirread.'/'.$pathtocard;
|
$urloflist = dol_buildpath('/'.$pathtolist, 1);
|
||||||
|
$urlofcard = dol_buildpath('/'.$pathtocard, 1);
|
||||||
|
|
||||||
print '<div class="fichehalfleft smallxxx">';
|
print '<div class="fichehalfleft smallxxx">';
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("ClassFile").' : <strong>'.($realpathtoclass ? '' : '<strike>').preg_replace('/^'.strtolower($module).'\//', '', $pathtoclass).($realpathtoclass ? '' : '</strike>').'</strong>';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("ClassFile").' : <strong>'.($realpathtoclass ? '' : '<strike>').preg_replace('/^'.strtolower($module).'\//', '', $pathtoclass).($realpathtoclass ? '' : '</strike>').'</strong>';
|
||||||
@ -2699,7 +2726,7 @@ if ($module == 'initmodule') {
|
|||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="noborder small">';
|
print '<table class="noborder small">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th class="thsticky">'.$langs->trans("Property");
|
print '<th class="thsticky thstickygray">'.$langs->trans("Property");
|
||||||
print ' (<a class="" href="https://wiki.dolibarr.org/index.php/Language_and_development_rules#Table_and_fields_structures" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SeeExamples").'</a>)';
|
print ' (<a class="" href="https://wiki.dolibarr.org/index.php/Language_and_development_rules#Table_and_fields_structures" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SeeExamples").'</a>)';
|
||||||
print '</th>';
|
print '</th>';
|
||||||
print '<th>';
|
print '<th>';
|
||||||
@ -2725,7 +2752,7 @@ if ($module == 'initmodule') {
|
|||||||
//print '<th class="center">'.$langs->trans("Disabled").'</th>';
|
//print '<th class="center">'.$langs->trans("Disabled").'</th>';
|
||||||
print '<th>'.$form->textwithpicto($langs->trans("Validate"), $langs->trans("ValidateModBuilderDesc")).'</th>';
|
print '<th>'.$form->textwithpicto($langs->trans("Validate"), $langs->trans("ValidateModBuilderDesc")).'</th>';
|
||||||
print '<th>'.$langs->trans("Comment").'</th>';
|
print '<th>'.$langs->trans("Comment").'</th>';
|
||||||
print '<th></th>';
|
print '<th class="thstickyright tdstickyghostwhite"></th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// We must use $reflectorpropdefault['fields'] to get list of fields because $tmpobjet->fields may have been
|
// We must use $reflectorpropdefault['fields'] to get list of fields because $tmpobjet->fields may have been
|
||||||
@ -2736,7 +2763,7 @@ if ($module == 'initmodule') {
|
|||||||
if (!empty($properties)) {
|
if (!empty($properties)) {
|
||||||
// Line to add a property
|
// Line to add a property
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="tdsticky"><input type="text" class="maxwidth75" name="propname" value="'.dol_escape_htmltag(GETPOST('propname', 'alpha')).'"></td>';
|
print '<td class="tdsticky tdstickygray"><input type="text" class="maxwidth75" name="propname" value="'.dol_escape_htmltag(GETPOST('propname', 'alpha')).'"></td>';
|
||||||
print '<td><input type="text" class="maxwidth75" name="proplabel" value="'.dol_escape_htmltag(GETPOST('proplabel', 'alpha')).'"></td>';
|
print '<td><input type="text" class="maxwidth75" name="proplabel" value="'.dol_escape_htmltag(GETPOST('proplabel', 'alpha')).'"></td>';
|
||||||
print '<td><input type="text" class="maxwidth75" name="proptype" value="'.dol_escape_htmltag(GETPOST('proptype', 'alpha')).'"></td>';
|
print '<td><input type="text" class="maxwidth75" name="proptype" value="'.dol_escape_htmltag(GETPOST('proptype', 'alpha')).'"></td>';
|
||||||
print '<td><input type="text" class="maxwidth75" name="proparrayofkeyval" value="'.dol_escape_htmltag(GETPOST('proparrayofkeyval', 'restricthtml')).'"></td>';
|
print '<td><input type="text" class="maxwidth75" name="proparrayofkeyval" value="'.dol_escape_htmltag(GETPOST('proparrayofkeyval', 'restricthtml')).'"></td>';
|
||||||
@ -2758,7 +2785,7 @@ if ($module == 'initmodule') {
|
|||||||
//print '<td class="center"><input type="text" size="2" name="propdisabled" value="'.dol_escape_htmltag(GETPOST('propdisabled', 'alpha')).'"></td>';
|
//print '<td class="center"><input type="text" size="2" name="propdisabled" value="'.dol_escape_htmltag(GETPOST('propdisabled', 'alpha')).'"></td>';
|
||||||
print '<td><input type="number" step="1" min="0" max="1" class="text maxwidth100" name="propvalidate" value="'.dol_escape_htmltag(GETPOST('propvalidate', 'alpha')).'"></td>';
|
print '<td><input type="number" step="1" min="0" max="1" class="text maxwidth100" name="propvalidate" value="'.dol_escape_htmltag(GETPOST('propvalidate', 'alpha')).'"></td>';
|
||||||
print '<td><input class="text maxwidth100" name="propcomment" value="'.dol_escape_htmltag(GETPOST('propcomment', 'alpha')).'"></td>';
|
print '<td><input class="text maxwidth100" name="propcomment" value="'.dol_escape_htmltag(GETPOST('propcomment', 'alpha')).'"></td>';
|
||||||
print '<td class="center">';
|
print '<td class="center tdstickyright tdstickyghostwhite">';
|
||||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
|
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
@ -2803,7 +2830,7 @@ if ($module == 'initmodule') {
|
|||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
print '<td class="tdsticky">';
|
print '<td class="tdsticky tdstickygray">';
|
||||||
print dol_escape_htmltag($propname);
|
print dol_escape_htmltag($propname);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -2818,7 +2845,7 @@ if ($module == 'initmodule') {
|
|||||||
print '<td class="tdoverflowmax200">';
|
print '<td class="tdoverflowmax200">';
|
||||||
print '<input name="proparrayofkeyval" value="';
|
print '<input name="proparrayofkeyval" value="';
|
||||||
if (isset($proparrayofkeyval)) {
|
if (isset($proparrayofkeyval)) {
|
||||||
print dol_escape_htmltag(json_encode($proparrayofkeyval));
|
print dol_escape_htmltag(json_encode($proparrayofkeyval, JSON_UNESCAPED_UNICODE));
|
||||||
}
|
}
|
||||||
print '">';
|
print '">';
|
||||||
print '</input>';
|
print '</input>';
|
||||||
@ -2874,7 +2901,7 @@ if ($module == 'initmodule') {
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input class="maxwidth100" name="propcomment" value="'.dol_escape_htmltag($propcomment).'">';
|
print '<input class="maxwidth100" name="propcomment" value="'.dol_escape_htmltag($propcomment).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center tdstickyright tdstickyghostwhite">';
|
||||||
print '<input class="button smallpaddingimp" type="submit" name="edit" value="'.$langs->trans("Save").'">';
|
print '<input class="button smallpaddingimp" type="submit" name="edit" value="'.$langs->trans("Save").'">';
|
||||||
print '<input class="button button-cancel smallpaddingimp" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
print '<input class="button button-cancel smallpaddingimp" type="submit" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -2884,8 +2911,8 @@ if ($module == 'initmodule') {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="tdoverflowmax200">';
|
print '<td class="tdoverflowmax200">';
|
||||||
if ($proparrayofkeyval) {
|
if ($proparrayofkeyval) {
|
||||||
print '<span title="'.dol_escape_htmltag(json_encode($proparrayofkeyval)).'">';
|
print '<span title="'.dol_escape_htmltag(json_encode($proparrayofkeyval, JSON_UNESCAPED_UNICODE)).'">';
|
||||||
print dol_escape_htmltag(json_encode($proparrayofkeyval));
|
print dol_escape_htmltag(json_encode($proparrayofkeyval, JSON_UNESCAPED_UNICODE));
|
||||||
print '</span>';
|
print '</span>';
|
||||||
}
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -2945,7 +2972,7 @@ if ($module == 'initmodule') {
|
|||||||
print dol_escape_htmltag($propcomment);
|
print dol_escape_htmltag($propcomment);
|
||||||
print '</span>';
|
print '</span>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center tdstickyright tdstickyghostwhite">';
|
||||||
if ($propname != 'rowid') {
|
if ($propname != 'rowid') {
|
||||||
print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editproperty&token='.newToken().'&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_edit().'</a>';
|
print '<a class="editfielda reposition marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=editproperty&token='.newToken().'&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_edit().'</a>';
|
||||||
print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deleteproperty&token='.newToken().'&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
|
print '<a class="marginleftonly marginrighttonly paddingright paddingleft" href="'.$_SERVER["PHP_SELF"].'?action=deleteproperty&token='.newToken().'&propertykey='.urlencode($propname).'&tab='.urlencode($tab).'&module='.urlencode($module).'&tabobj='.urlencode($tabobj).'">'.img_delete().'</a>';
|
||||||
@ -3079,14 +3106,14 @@ if ($module == 'initmodule') {
|
|||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("fk_menu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("LinkToParentMenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("mainmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("mainmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("leftmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("leftmenu", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("URL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("RelativeURL", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("LanguageFile", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("LanguageFile", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Enabled", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre("Permission", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Permission", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
print_liste_field_titre("Target", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||||
print_liste_field_titre("UserType", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ');
|
print_liste_field_titre("UserType", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
@ -3124,15 +3151,15 @@ if ($module == 'initmodule') {
|
|||||||
print dol_escape_htmltag($menu['langs']);
|
print dol_escape_htmltag($menu['langs']);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td>';
|
print '<td class="right">';
|
||||||
print dol_escape_htmltag($menu['position']);
|
print dol_escape_htmltag($menu['position']);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($menu['enabled']).'">';
|
print '<td class="center tdoverflowmax200" title="'.dol_escape_htmltag($menu['enabled']).'">';
|
||||||
print dol_escape_htmltag($menu['enabled']);
|
print dol_escape_htmltag($menu['enabled']);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($menu['perms']).'">';
|
print '<td class="center tdoverflowmax200" title="'.dol_escape_htmltag($menu['perms']).'">';
|
||||||
print dol_escape_htmltag($menu['perms']);
|
print dol_escape_htmltag($menu['perms']);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
@ -3834,8 +3861,10 @@ if ($module == 'initmodule') {
|
|||||||
$FILENAMEDOCPDF = $modulelowercase.'.pdf';
|
$FILENAMEDOCPDF = $modulelowercase.'.pdf';
|
||||||
$outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC;
|
$outputfiledoc = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOC;
|
||||||
$outputfiledocurl = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOC;
|
$outputfiledocurl = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOC;
|
||||||
|
$outputfiledocrel = $modulelowercase.'/doc/'.$FILENAMEDOC;
|
||||||
$outputfiledocpdf = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOCPDF;
|
$outputfiledocpdf = dol_buildpath($modulelowercase, 0).'/doc/'.$FILENAMEDOCPDF;
|
||||||
$outputfiledocurlpdf = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOCPDF;
|
$outputfiledocurlpdf = dol_buildpath($modulelowercase, 1).'/doc/'.$FILENAMEDOCPDF;
|
||||||
|
$outputfiledocrelpdf = $modulelowercase.'/doc/'.$FILENAMEDOCPDF;
|
||||||
|
|
||||||
// HTML
|
// HTML
|
||||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PathToModuleDocumentation", "HTML").' : ';
|
print '<span class="fa fa-file-o"></span> '.$langs->trans("PathToModuleDocumentation", "HTML").' : ';
|
||||||
@ -3848,6 +3877,7 @@ if ($module == 'initmodule') {
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
print '</strong>';
|
print '</strong>';
|
||||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')</span>';
|
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')</span>';
|
||||||
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&token='.newToken().'&format='.$format.'&file='.urlencode($outputfiledocrel).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
print '</strong><br>';
|
print '</strong><br>';
|
||||||
|
|
||||||
@ -3862,6 +3892,7 @@ if ($module == 'initmodule') {
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
print '</strong>';
|
print '</strong>';
|
||||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')</span>';
|
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')</span>';
|
||||||
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&token='.newToken().'&format='.$format.'&file='.urlencode($outputfiledocpdfrel).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
print '</strong><br>';
|
print '</strong><br>';
|
||||||
|
|
||||||
@ -3928,8 +3959,11 @@ if ($module == 'initmodule') {
|
|||||||
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
||||||
print '<strong><a href="'.DOL_URL_ROOT.'/document.php?modulepart=packages&file='.urlencode($relativepath).'">'.$outputfilezip.'</a></strong>';
|
print '<strong><a href="'.DOL_URL_ROOT.'/document.php?modulepart=packages&file='.urlencode($relativepath).'">'.$outputfilezip.'</a></strong>';
|
||||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')</span>';
|
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')</span>';
|
||||||
|
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=confirm_removefile&token='.newToken().'&format='.$format.'&file='.urlencode($relativepath).'">'.img_picto($langs->trans("Delete"), 'delete').'</a>';
|
||||||
}
|
}
|
||||||
print '</strong><br>';
|
print '</strong>';
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
@ -108,11 +108,11 @@ class MyObject extends CommonObject
|
|||||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2, 'validate'=>1),
|
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth300', 'cssview'=>'wordbreak', 'help'=>'Help text', 'showoncombobox'=>2, 'validate'=>1),
|
||||||
'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount', 'validate'=>1),
|
'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount', 'validate'=>1),
|
||||||
'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp', 'validate'=>1),
|
'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp', 'validate'=>1),
|
||||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty', 'validate'=>1),
|
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'),
|
||||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1),
|
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>1, 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'),
|
||||||
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60, 'validate'=>1),
|
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60, 'validate'=>1),
|
||||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'validate'=>1),
|
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'validate'=>1, 'cssview'=>'wordbreak'),
|
||||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'validate'=>1),
|
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'validate'=>1, 'cssview'=>'wordbreak'),
|
||||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>500),
|
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>500),
|
||||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 0, 'position'=>501),
|
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 0, 'position'=>501),
|
||||||
//'date_validation ' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
//'date_validation ' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
||||||
@ -122,7 +122,7 @@ class MyObject extends CommonObject
|
|||||||
'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>0, 'notnull'=>0, 'position'=>600),
|
'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>0, 'notnull'=>0, 'position'=>600),
|
||||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
|
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
|
||||||
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'notnull'=>-1, 'position'=>1010),
|
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'notnull'=>-1, 'position'=>1010),
|
||||||
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 9=>'Canceled'), 'validate'=>1),
|
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=> 1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Validated', 9=>'Canceled'), 'validate'=>1),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -305,7 +305,7 @@ class modMyModule extends DolibarrModules
|
|||||||
/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT
|
/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT
|
||||||
$this->menu[$r++]=array(
|
$this->menu[$r++]=array(
|
||||||
'fk_menu'=>'fk_mainmenu=mymodule', // '' 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
|
'fk_menu'=>'fk_mainmenu=mymodule', // '' 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 Top menu entry
|
'type'=>'left', // This is a Left menu entry
|
||||||
'titre'=>'MyObject',
|
'titre'=>'MyObject',
|
||||||
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
|
'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth valignmiddle"'),
|
||||||
'mainmenu'=>'mymodule',
|
'mainmenu'=>'mymodule',
|
||||||
|
|||||||
@ -28,8 +28,6 @@
|
|||||||
* - interface_99_all_MyTrigger.class.php
|
* - interface_99_all_MyTrigger.class.php
|
||||||
* - The file must stay in core/triggers
|
* - The file must stay in core/triggers
|
||||||
* - The class name must be InterfaceMytrigger
|
* - The class name must be InterfaceMytrigger
|
||||||
* - The constructor method must be named InterfaceMytrigger
|
|
||||||
* - The name property name must be MyTrigger
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
|
||||||
|
|||||||
@ -132,15 +132,24 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$upload_dir = $conf->mymodule->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
$upload_dir = $conf->mymodule->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php
|
// There is several ways to check permission.
|
||||||
|
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||||
|
$enablepermissioncheck = 0;
|
||||||
|
if ($enablepermissioncheck) {
|
||||||
|
$permissiontoread = $user->rights->mymodule->myobject->read;
|
||||||
|
$permissiontoadd = $user->rights->mymodule->myobject->write;
|
||||||
|
} else {
|
||||||
|
$permissiontoread = 1;
|
||||||
|
$permissiontoadd = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Security check (enable the most restrictive one)
|
// Security check (enable the most restrictive one)
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
//if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (empty($conf->mymodule->enabled)) accessforbidden();
|
||||||
//if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -187,7 +196,7 @@ if ($object->id > 0) {
|
|||||||
$head = myobjectPrepareHead($object);
|
$head = myobjectPrepareHead($object);
|
||||||
|
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'agenda', '', -1, $object->picto);
|
print dol_get_fiche_head($head, 'agenda', $langs->trans("MyObject"), -1, $object->picto);
|
||||||
|
|
||||||
// Object card
|
// Object card
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
|
|||||||
@ -122,12 +122,23 @@ if (empty($action) && empty($id) && empty($ref)) {
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||||
|
|
||||||
|
// There is several ways to check permission.
|
||||||
|
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||||
|
$enablepermissioncheck = 0;
|
||||||
|
if ($enablepermissioncheck) {
|
||||||
|
$permissiontoread = $user->rights->mymodule->myobject->read;
|
||||||
|
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||||
|
$permissiontodelete = $user->rights->mymodule->myobject->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
||||||
|
$permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php
|
||||||
|
$permissiondellink = $user->rights->mymodule->myobject->write; // Used by the include of actions_dellink.inc.php
|
||||||
|
} else {
|
||||||
|
$permissiontoread = 1;
|
||||||
|
$permissiontoadd = 1; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
||||||
|
$permissiontodelete = 1;
|
||||||
|
$permissionnote = 1;
|
||||||
|
$permissiondellink = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$permissiontoread = $user->rights->mymodule->myobject->read;
|
|
||||||
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
|
|
||||||
$permissiontodelete = $user->rights->mymodule->myobject->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
|
|
||||||
$permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php
|
|
||||||
$permissiondellink = $user->rights->mymodule->myobject->write; // Used by the include of actions_dellink.inc.php
|
|
||||||
$upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1].'/myobject';
|
$upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object->entity : 1].'/myobject';
|
||||||
|
|
||||||
// Security check (enable the most restrictive one)
|
// Security check (enable the most restrictive one)
|
||||||
@ -135,8 +146,8 @@ $upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object-
|
|||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
//if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (empty($conf->mymodule->enabled)) accessforbidden();
|
||||||
//if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -230,6 +241,11 @@ llxHeader('', $title, $help_url);
|
|||||||
|
|
||||||
// Part to create
|
// Part to create
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
|
if (empty($permissiontoadd)) {
|
||||||
|
accessforbidden($langs->trans('NotEnoughPermissions'), 0, 1);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("MyObject")), '', 'object_'.$object->picto);
|
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("MyObject")), '', 'object_'.$object->picto);
|
||||||
|
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
|||||||
@ -78,15 +78,24 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Load object
|
// 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
|
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
|
||||||
|
|
||||||
$permission = $user->rights->mymodule->myobject->write;
|
// There is several ways to check permission.
|
||||||
|
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||||
|
$enablepermissioncheck = 0;
|
||||||
|
if ($enablepermissioncheck) {
|
||||||
|
$permissiontoread = $user->rights->mymodule->myobject->read;
|
||||||
|
$permission = $user->rights->mymodule->myobject->write;
|
||||||
|
} else {
|
||||||
|
$permissiontoread = 1;
|
||||||
|
$permission = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Security check (enable the most restrictive one)
|
// Security check (enable the most restrictive one)
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
//if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (empty($conf->mymodule->enabled)) accessforbidden();
|
||||||
//if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -152,7 +161,7 @@ if ($object->id) {
|
|||||||
*/
|
*/
|
||||||
$head = myobjectPrepareHead($object);
|
$head = myobjectPrepareHead($object);
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'contact', '', -1, $object->picto);
|
print dol_get_fiche_head($head, 'contact', $langs->trans("MyObject"), -1, $object->picto);
|
||||||
|
|
||||||
$linkback = '<a href="'.dol_buildpath('/mymodule/myobject_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.dol_buildpath('/mymodule/myobject_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
|
|||||||
@ -124,15 +124,24 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".get_exdir(0, 0, 0, 1, $object);
|
$upload_dir = $conf->mymodule->multidir_output[$object->entity ? $object->entity : $conf->entity]."/myobject/".get_exdir(0, 0, 0, 1, $object);
|
||||||
}
|
}
|
||||||
|
|
||||||
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
|
// There is several ways to check permission.
|
||||||
|
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||||
|
$enablepermissioncheck = 0;
|
||||||
|
if ($enablepermissioncheck) {
|
||||||
|
$permissiontoread = $user->rights->mymodule->myobject->read;
|
||||||
|
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
|
||||||
|
} else {
|
||||||
|
$permissiontoread = 1;
|
||||||
|
$permission = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Security check (enable the most restrictive one)
|
// Security check (enable the most restrictive one)
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
//if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (empty($conf->mymodule->enabled)) accessforbidden();
|
||||||
//if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -159,7 +168,7 @@ if ($object->id) {
|
|||||||
*/
|
*/
|
||||||
$head = myobjectPrepareHead($object);
|
$head = myobjectPrepareHead($object);
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'document', '', -1, $object->picto);
|
print dol_get_fiche_head($head, 'document', $langs->trans("MyObject"), -1, $object->picto);
|
||||||
|
|
||||||
|
|
||||||
// Build file list
|
// Build file list
|
||||||
|
|||||||
@ -178,13 +178,17 @@ $object->fields = dol_sort_array($object->fields, 'position');
|
|||||||
//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
|
//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
|
||||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
$permissiontoread = $user->rights->mymodule->myobject->read;
|
// There is several ways to check permission.
|
||||||
$permissiontoadd = $user->rights->mymodule->myobject->write;
|
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||||
$permissiontodelete = $user->rights->mymodule->myobject->delete;
|
$enablepermissioncheck = 0;
|
||||||
|
if ($enablepermissioncheck) {
|
||||||
// Security check
|
$permissiontoread = $user->rights->mymodule->myobject->read;
|
||||||
if (empty($conf->mymodule->enabled)) {
|
$permissiontoadd = $user->rights->mymodule->myobject->write;
|
||||||
accessforbidden('Module not enabled');
|
$permissiontodelete = $user->rights->mymodule->myobject->delete;
|
||||||
|
} else {
|
||||||
|
$permissiontoread = 1;
|
||||||
|
$permissiontoadd = 1;
|
||||||
|
$permissiontodelete = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security check (enable the most restrictive one)
|
// Security check (enable the most restrictive one)
|
||||||
@ -193,9 +197,8 @@ if ($user->socid > 0) accessforbidden();
|
|||||||
//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
|
//$socid = 0; if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, 0, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, 0, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
//if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (empty($conf->mymodule->enabled)) accessforbidden('Moule not enabled');
|
||||||
//if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -101,23 +101,35 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
$upload_dir = $conf->mymodule->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
$upload_dir = $conf->mymodule->multidir_output[!empty($object->entity) ? $object->entity : $conf->entity]."/".$object->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php
|
|
||||||
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php
|
// There is several ways to check permission.
|
||||||
|
// Set $enablepermissioncheck to 1 to enable a minimum low level of checks
|
||||||
|
$enablepermissioncheck = 0;
|
||||||
|
if ($enablepermissioncheck) {
|
||||||
|
$permissiontoread = $user->rights->mymodule->myobject->read;
|
||||||
|
$permissiontoadd = $user->rights->mymodule->myobject->write;
|
||||||
|
$permissionnote = $user->rights->mymodule->myobject->write; // Used by the include of actions_setnotes.inc.php
|
||||||
|
} else {
|
||||||
|
$permissiontoread = 1;
|
||||||
|
$permissiontoadd = 1;
|
||||||
|
$permissionnote = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// Security check (enable the most restrictive one)
|
// Security check (enable the most restrictive one)
|
||||||
//if ($user->socid > 0) accessforbidden();
|
//if ($user->socid > 0) accessforbidden();
|
||||||
//if ($user->socid > 0) $socid = $user->socid;
|
//if ($user->socid > 0) $socid = $user->socid;
|
||||||
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
|
||||||
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
|
||||||
//if (empty($conf->mymodule->enabled)) accessforbidden();
|
if (empty($conf->mymodule->enabled)) accessforbidden();
|
||||||
//if (!$permissiontoread) accessforbidden();
|
if (!$permissiontoread) accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) {
|
if ($reshook < 0) {
|
||||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
}
|
}
|
||||||
@ -141,7 +153,7 @@ if ($id > 0 || !empty($ref)) {
|
|||||||
|
|
||||||
$head = myobjectPrepareHead($object);
|
$head = myobjectPrepareHead($object);
|
||||||
|
|
||||||
print dol_get_fiche_head($head, 'note', '', -1, $object->picto);
|
print dol_get_fiche_head($head, 'note', $langs->trans("MyObject"), -1, $object->picto);
|
||||||
|
|
||||||
// Object card
|
// Object card
|
||||||
// ------------------------------------------------------------
|
// ------------------------------------------------------------
|
||||||
|
|||||||
@ -53,7 +53,7 @@ $nblines = $object->fetch_lines();
|
|||||||
|
|
||||||
// Return to the results
|
// Return to the results
|
||||||
if (GETPOST('retoursondage')) {
|
if (GETPOST('retoursondage')) {
|
||||||
header('Location: results.php?id='.GETPOST('id', 'int'));
|
header('Location: results.php?id='.(GETPOSTISSET('id_sondage') ? GETPOST('id_sondage', 'aZ09') : GETPOST('id', 'int')));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -588,6 +588,7 @@ if (GETPOST('ajoutsujet')) {
|
|||||||
$tmparray = array('checkbox'=>$langs->trans("CheckBox"), 'yesno'=>$langs->trans("YesNoList"), 'foragainst'=>$langs->trans("PourContreList"));
|
$tmparray = array('checkbox'=>$langs->trans("CheckBox"), 'yesno'=>$langs->trans("YesNoList"), 'foragainst'=>$langs->trans("PourContreList"));
|
||||||
print $langs->trans("Type").' '.$form->selectarray("typecolonne", $tmparray, GETPOST('typecolonne')).'<br><br>';
|
print $langs->trans("Type").' '.$form->selectarray("typecolonne", $tmparray, GETPOST('typecolonne')).'<br><br>';
|
||||||
print '<input type="submit" class="button" name="ajoutercolonne" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
|
print '<input type="submit" class="button" name="ajoutercolonne" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
|
||||||
|
print '<input type="hidden" name="id_sondage" value="'.dol_escape_htmltag($object->id_sondage).'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<input type="submit" class="button button-cancel" name="retoursondage" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
print '<input type="submit" class="button button-cancel" name="retoursondage" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
|
||||||
print '<br><br>'."\n";
|
print '<br><br>'."\n";
|
||||||
@ -663,6 +664,7 @@ $nbcolonnes = substr_count($object->sujet, ',') + 1;
|
|||||||
|
|
||||||
print '<form name="formulaire" action="" method="POST">'."\n";
|
print '<form name="formulaire" action="" method="POST">'."\n";
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
|
|
||||||
print '<div class="cadre div-table-responsive-no-min"> '."\n";
|
print '<div class="cadre div-table-responsive-no-min"> '."\n";
|
||||||
|
|
||||||
@ -851,7 +853,7 @@ while ($compteur < $num) {
|
|||||||
print '<tr><td>'."\n";
|
print '<tr><td>'."\n";
|
||||||
|
|
||||||
if ($user->rights->opensurvey->write) {
|
if ($user->rights->opensurvey->write) {
|
||||||
print '<input type="image" name="effaceligne'.$compteur.'" src="'.img_picto('', 'delete.png', '', false, 1).'">'."\n";
|
print '<input type="image" class="reposition" name="effaceligne'.$compteur.'" src="'.img_picto('', 'delete.png', '', false, 1).'">'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Name
|
// Name
|
||||||
@ -1012,7 +1014,7 @@ while ($compteur < $num) {
|
|||||||
|
|
||||||
// Button edit at end of line
|
// Button edit at end of line
|
||||||
if ($compteur != $ligneamodifier && ($user->rights->opensurvey->write)) {
|
if ($compteur != $ligneamodifier && ($user->rights->opensurvey->write)) {
|
||||||
print '<td class="casevide"><input type="submit" class="button" name="modifierligne'.$compteur.'" value="'.dol_escape_htmltag($langs->trans("Edit")).'"></td>'."\n";
|
print '<td class="casevide"><input type="submit" class="button reposition" name="modifierligne'.$compteur.'" value="'.dol_escape_htmltag($langs->trans("Edit")).'"></td>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
//demande de confirmation pour modification de ligne
|
//demande de confirmation pour modification de ligne
|
||||||
@ -1021,7 +1023,7 @@ while ($compteur < $num) {
|
|||||||
if ($compteur == $i) {
|
if ($compteur == $i) {
|
||||||
print '<td class="casevide">';
|
print '<td class="casevide">';
|
||||||
print '<input type="hidden" name="idtomodify'.$compteur.'" value="'.$obj->id_users.'">';
|
print '<input type="hidden" name="idtomodify'.$compteur.'" value="'.$obj->id_users.'">';
|
||||||
print '<input type="submit" class="button button-save" name="validermodifier'.$compteur.'" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
print '<input type="submit" class="button button-save reposition" name="validermodifier'.$compteur.'" value="'.dol_escape_htmltag($langs->trans("Save")).'">';
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3543,11 +3543,24 @@ td.border, div.tagtable div div.border {
|
|||||||
width:auto;
|
width:auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.thsticky, .tdsticky {
|
.thsticky, .tdsticky {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
}
|
}
|
||||||
|
.thstickyright, .tdstickyright {
|
||||||
|
position: sticky;
|
||||||
|
right: 0px;
|
||||||
|
}
|
||||||
|
.thstickygray, .tdstickygray {
|
||||||
|
background-color: lightgray;
|
||||||
|
}
|
||||||
|
.thstickyghostwhite, .tdstickyghostwhite {
|
||||||
|
background-color: ghostwhite;
|
||||||
|
}
|
||||||
|
.thstickyinherit, .tdstickyinherit {
|
||||||
|
background-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
/* To have left column sticky */
|
/* To have left column sticky */
|
||||||
/*.tagtable td[data-key="ref"], .tagtable th[data-key="ref"] {
|
/*.tagtable td[data-key="ref"], .tagtable th[data-key="ref"] {
|
||||||
|
|||||||
@ -3599,10 +3599,24 @@ td.border, div.tagtable div div.border {
|
|||||||
width:auto;
|
width:auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.thsticky, .tdsticky {
|
.thsticky, .tdsticky {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
left: 0px;
|
left: 0px;
|
||||||
}
|
}
|
||||||
|
.thstickyright, .tdstickyright {
|
||||||
|
position: sticky;
|
||||||
|
right: 0px;
|
||||||
|
}
|
||||||
|
.thstickygray, .tdstickygray {
|
||||||
|
background-color: lightgray;
|
||||||
|
}
|
||||||
|
.thstickyghostwhite, .tdstickyghostwhite {
|
||||||
|
background-color: ghostwhite;
|
||||||
|
}
|
||||||
|
.thstickyinherit, .tdstickyinherit {
|
||||||
|
background-color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
<?php if (!empty($conf->global->THEME_ENABLE_STICKY_COLUMN_REF)) { ?>
|
<?php if (!empty($conf->global->THEME_ENABLE_STICKY_COLUMN_REF)) { ?>
|
||||||
/* To have left column sticky */
|
/* To have left column sticky */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user