Merge branch 'Dolibarr:develop' into develop
This commit is contained in:
commit
1cb8012ba6
@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => {
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
const url = bundle.authData.url + '/api/index.php/zapier/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => {
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
@ -84,7 +84,7 @@ const getFallbackRealAction = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/actions',
|
||||
// url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/actions',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
|
||||
@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => {
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
const url = bundle.authData.url + '/api/index.php/zapier/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => {
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
@ -76,7 +76,7 @@ const getFallbackRealContact = (z, bundle) => {
|
||||
// const getModulesChoices = (z/*, bundle*/) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||
// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
@ -94,7 +94,7 @@ const getFallbackRealContact = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`,
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
|
||||
@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => {
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
const url = bundle.authData.url + '/api/index.php/zapier/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => {
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
@ -76,7 +76,7 @@ const getFallbackRealMember = (z, bundle) => {
|
||||
// const getModulesChoices = (z/*, bundle*/) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||
// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
@ -94,7 +94,7 @@ const getFallbackRealMember = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`,
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
|
||||
@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => {
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
const url = bundle.authData.url + '/api/index.php/zapier/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => {
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
@ -74,7 +74,7 @@ const getFallbackRealOrder = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/orders',
|
||||
// url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/orders',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
|
||||
@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => {
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
const url = bundle.authData.url + '/api/index.php/zapier/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => {
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
@ -83,7 +83,7 @@ const getFallbackRealThirdparty = (z, bundle) => {
|
||||
// const getModulesChoices = (z/*, bundle*/) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||
// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
@ -102,7 +102,7 @@ const getFallbackRealThirdparty = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`,
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
|
||||
@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => {
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
const url = bundle.authData.url + '/api/index.php/zapier/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => {
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
@ -76,7 +76,7 @@ const getFallbackRealTicket = (z, bundle) => {
|
||||
// const getModulesChoices = (z/*, bundle*/) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||
// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
@ -97,7 +97,7 @@ const getFallbackRealTicket = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`,
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
|
||||
@ -10,7 +10,7 @@ const subscribeHook = (z, bundle) => {
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
const url = bundle.authData.url + '/api/index.php/zapier/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
@ -32,7 +32,7 @@ const unsubscribeHook = (z, bundle) => {
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
url: bundle.authData.url + '/api/index.php/zapier/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
@ -73,7 +73,7 @@ const getFallbackRealUser = (z, bundle) => {
|
||||
// const getModulesChoices = (z/*, bundle*/) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||
// url: bundle.authData.url + '/api/index.php/zapier/getmoduleschoices',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
@ -93,7 +93,7 @@ const getFallbackRealUser = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapier/getactionschoices/thirparty`,
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
|
||||
@ -139,7 +139,7 @@ $formldap = new FormLdap($db);
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print dol_get_fiche_head($head, 'ldap', $langs->trans("LDAPSetup"), -1);
|
||||
print dol_get_fiche_head($head, 'ldap', '', -1);
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
@ -245,7 +245,8 @@ print '</td><td class="maxwidthhalf"><span class="opacitymedium">'.$langs->trans
|
||||
// Pass
|
||||
print '<!-- LDAP_ADMIN_PASS -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPPassword").'</td><td>';
|
||||
print '<input class="minwidth150" type="password" name="pass" value="'.dol_escape_htmltag($conf->global->LDAP_ADMIN_PASS).'">';
|
||||
print '<input class="minwidth150" type="password" name="pass" value="'.dol_escape_htmltag(getDolGlobalString('LDAP_ADMIN_PASS')).'">';
|
||||
print showValueWithClipboardCPButton(getDolGlobalString('LDAP_ADMIN_PASS'), 0, ' ');
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans('Password').' (ex: secret)</span></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -140,7 +140,7 @@ if (!function_exists("ldap_connect")) {
|
||||
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||
}
|
||||
|
||||
print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1);
|
||||
print dol_get_fiche_head($head, 'contacts', '', -1);
|
||||
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("LDAPDescContact").'</span><br>';
|
||||
|
||||
@ -114,7 +114,7 @@ if (!function_exists("ldap_connect")) {
|
||||
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||
}
|
||||
|
||||
print dol_get_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1);
|
||||
print dol_get_fiche_head($head, 'groups', '', -1);
|
||||
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("LDAPDescGroups").'</span><br>';
|
||||
|
||||
@ -188,7 +188,7 @@ if (!function_exists("ldap_connect")) {
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&token='.newToken().'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1);
|
||||
print dol_get_fiche_head($head, 'members', '', -1);
|
||||
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("LDAPDescMembers").'</span><br>';
|
||||
|
||||
@ -106,7 +106,7 @@ if (!function_exists("ldap_connect")) {
|
||||
setEventMessages($langs->trans("LDAPFunctionsNotAvailableOnPHP"), null, 'errors');
|
||||
}
|
||||
|
||||
print dol_get_fiche_head($head, 'memberstypes', $langs->trans("LDAPSetup"), -1);
|
||||
print dol_get_fiche_head($head, 'memberstypes', '', -1);
|
||||
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("LDAPDescMembersTypes").'</span><br>';
|
||||
|
||||
@ -178,7 +178,7 @@ print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue&toke
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
|
||||
print dol_get_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1);
|
||||
print dol_get_fiche_head($head, 'users', '', -1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("LDAPDescUsers").'</span><br>';
|
||||
print '<br>';
|
||||
|
||||
@ -411,7 +411,7 @@ foreach ($configfileparameters as $key => $value) {
|
||||
} elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) {
|
||||
print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||
} elseif ($newkey == 'dolibarr_main_document_root_alt') {
|
||||
$tmparray = explode(',', ${$newkey});
|
||||
$tmparray = explode(',', $dolibarr_main_document_root_alt);
|
||||
$i = 0;
|
||||
foreach ($tmparray as $value2) {
|
||||
if ($i > 0) {
|
||||
@ -429,7 +429,7 @@ foreach ($configfileparameters as $key => $value) {
|
||||
global $dolibarr_main_cookie_cryptkey, $dolibarr_main_instance_unique_id;
|
||||
$valuetoshow = $dolibarr_main_instance_unique_id ? $dolibarr_main_instance_unique_id : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey
|
||||
if (empty($dolibarr_main_prod)) {
|
||||
print '<!-- '.${$newkey}.' -->';
|
||||
print '<!-- '.$dolibarr_main_instance_unique_id.' -->';
|
||||
print showValueWithClipboardCPButton($valuetoshow, 0, '********');
|
||||
} else {
|
||||
print '**********';
|
||||
|
||||
@ -1283,9 +1283,9 @@ if ($resql) {
|
||||
if ($massaction == 'createbills') {
|
||||
print '<input type="hidden" name="massaction" value="confirm_createbills">';
|
||||
|
||||
print '<table class="noborder" width="100%" >';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">';
|
||||
print '<td>';
|
||||
print $langs->trans('DateInvoice');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
@ -1320,12 +1320,11 @@ if ($resql) {
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans('CreateInvoiceForThisCustomer').'"> ';
|
||||
print '<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
print '<br><br>';
|
||||
}
|
||||
|
||||
if ($sall) {
|
||||
|
||||
@ -4453,7 +4453,7 @@ if ($action == 'create') {
|
||||
if ($result > 0) {
|
||||
print ' <span class="opacitymediumbycolor paddingleft">';
|
||||
$s = $langs->trans("CreditNoteConvertedIntoDiscount", '{s1}', '{s2}');
|
||||
$s = str_replace('{s1}', $object->getLibType(1), $s);
|
||||
$s = str_replace('{s1}', $object->getLibType(0), $s);
|
||||
$s = str_replace('{s2}', $discount->getNomUrl(1, 'discount'), $s);
|
||||
print $s;
|
||||
print '</span><br>';
|
||||
|
||||
@ -300,8 +300,34 @@ if ($action == 'update' && !empty($permissiontoadd)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Action to update one modulebuilder field
|
||||
$reg = array();
|
||||
if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) {
|
||||
$object->fetch(GETPOST('id', 'int'));
|
||||
|
||||
$keyforfield = $reg[1];
|
||||
if (property_exists($object, $keyforfield)) {
|
||||
if (!empty($object->fields[$keyforfield]) && in_array($object->fields[$keyforfield]['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$object->$keyforfield = dol_mktime(GETPOST($keyforfield.'hour'), GETPOST($keyforfield.'min'), GETPOST($keyforfield.'sec'), GETPOST($keyforfield.'month'), GETPOST($keyforfield.'day'), GETPOST($keyforfield.'year'));
|
||||
} else {
|
||||
$object->$keyforfield = GETPOST($keyforfield);
|
||||
}
|
||||
|
||||
$result = $object->update($user);
|
||||
|
||||
if ($result > 0) {
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
$action = 'view';
|
||||
} else {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'edit'.$reg[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Action to update one extrafield
|
||||
if ($action == "update_extras" && !empty($permissiontoadd)) {
|
||||
if ($action == "update_extras" && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) {
|
||||
$object->fetch(GETPOST('id', 'int'));
|
||||
|
||||
$attributekey = GETPOST('attribute', 'alpha');
|
||||
|
||||
@ -211,7 +211,21 @@ class Form
|
||||
|
||||
// Check parameters
|
||||
if (empty($typeofdata)) {
|
||||
return 'ErrorBadParameter';
|
||||
return 'ErrorBadParameter typeofdata is empty';
|
||||
}
|
||||
// Clean paramater $typeofdata
|
||||
if ($typeofdata == 'datetime') {
|
||||
$typeofdata = 'dayhour';
|
||||
}
|
||||
$reg = array();
|
||||
if (preg_match('/^(\w+)\((\d+)\)$/', $typeofdata, $reg)) {
|
||||
if ($reg[1] == 'varchar') {
|
||||
$typeofdata = 'string';
|
||||
} elseif ($reg[1] == 'int') {
|
||||
$typeofdata = 'numeric';
|
||||
} else {
|
||||
return 'ErrorBadParameter '.$typeofdata;
|
||||
}
|
||||
}
|
||||
|
||||
// When option to edit inline is activated
|
||||
|
||||
@ -1782,6 +1782,8 @@ class FormFile
|
||||
|
||||
$result = 0;
|
||||
if (is_object($object_instance)) {
|
||||
$object_instance->id = 0;
|
||||
$object_instance->ref = '';
|
||||
if ($id) {
|
||||
$result = $object_instance->fetch($id);
|
||||
} else {
|
||||
|
||||
@ -2970,7 +2970,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
$accessallowed = 1;
|
||||
}
|
||||
$original_file = $conf->resource->dir_output.'/'.$original_file;
|
||||
} elseif ($modulepart == 'remisecheque' && !empty($conf->bank->dir_output)) {
|
||||
} elseif (($modulepart == 'remisecheque' || $modulepart == 'chequereceipt') && !empty($conf->bank->dir_output)) {
|
||||
// Wrapping pour les remises de cheques
|
||||
if ($fuser->rights->banque->{$lire} || preg_match('/^specimen/i', $original_file)) {
|
||||
$accessallowed = 1;
|
||||
|
||||
@ -95,7 +95,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
||||
// Edit class files
|
||||
$contentclass = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r');
|
||||
|
||||
// Update ->fields (add or remove entries)
|
||||
// Update ->fields (to add or remove entries defined into $addfieldentry)
|
||||
if (count($object->fields)) {
|
||||
if (is_array($addfieldentry) && count($addfieldentry)) {
|
||||
$name = $addfieldentry['name'];
|
||||
@ -133,6 +133,9 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
||||
if (!empty($val['noteditable'])) {
|
||||
$texttoinsert .= " 'noteditable'=>'".$val['noteditable']."',";
|
||||
}
|
||||
if (!empty($val['alwayseditable'])) {
|
||||
$texttoinsert .= " 'alwayseditable'=>'".$val['alwayseditable']."',";
|
||||
}
|
||||
if (!empty($val['default']) || (isset($val['default']) && $val['default'] === '0')) {
|
||||
$texttoinsert .= " 'default'=>'".$val['default']."',";
|
||||
}
|
||||
@ -189,6 +192,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
||||
}
|
||||
|
||||
$texttoinsert .= "),\n";
|
||||
//print $texttoinsert;
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,14 +216,16 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
||||
|
||||
$texttoinsert .= "\t".'// END MODULEBUILDER PROPERTIES';
|
||||
|
||||
//print($texttoinsert);exit;
|
||||
//print($texttoinsert);
|
||||
|
||||
$contentclass = preg_replace('/\/\/ BEGIN MODULEBUILDER PROPERTIES.*END MODULEBUILDER PROPERTIES/ims', $texttoinsert, $contentclass);
|
||||
//print $contentclass;
|
||||
|
||||
dol_mkdir(dirname($pathoffiletoedittarget));
|
||||
|
||||
//file_put_contents($pathoffiletoedittmp, $contentclass);
|
||||
$result = file_put_contents(dol_osencode($pathoffiletoedittarget), $contentclass);
|
||||
|
||||
if ($result) {
|
||||
@chmod($pathoffiletoedittarget, octdec($newmask));
|
||||
} else {
|
||||
|
||||
@ -64,15 +64,23 @@ foreach ($object->fields as $key => $val) {
|
||||
print ' tdtop';
|
||||
}
|
||||
print '">';
|
||||
|
||||
$labeltoshow = '';
|
||||
if (!empty($val['help'])) {
|
||||
print $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help']));
|
||||
$labeltoshow .= $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help']));
|
||||
} else {
|
||||
if (isset($val['copytoclipboard']) && $val['copytoclipboard'] == 1) {
|
||||
print showValueWithClipboardCPButton($value, 0, $langs->transnoentitiesnoconv($val['label']));
|
||||
$labeltoshow .= showValueWithClipboardCPButton($value, 0, $langs->transnoentitiesnoconv($val['label']));
|
||||
} else {
|
||||
print $langs->trans($val['label']);
|
||||
$labeltoshow .= $langs->trans($val['label']);
|
||||
}
|
||||
}
|
||||
if (empty($val['alwayseditable'])) {
|
||||
print $labeltoshow;
|
||||
} else {
|
||||
print $form->editfieldkey($labeltoshow, $key, $value, $object, 1, $val['type']);
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
print '<td class="valuefield fieldname_'.$key;
|
||||
if ($val['type'] == 'text') {
|
||||
@ -82,25 +90,29 @@ foreach ($object->fields as $key => $val) {
|
||||
print ' '.$val['cssview'];
|
||||
}
|
||||
print '">';
|
||||
if (in_array($val['type'], array('text', 'html'))) {
|
||||
print '<div class="longmessagecut">';
|
||||
}
|
||||
if ($key == 'lang') {
|
||||
$langs->load("languages");
|
||||
$labellang = ($value ? $langs->trans('Language_'.$value) : '');
|
||||
print picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"');
|
||||
print $labellang;
|
||||
} else {
|
||||
if (isset($val['copytoclipboard']) && $val['copytoclipboard'] == 2) {
|
||||
$out = $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||
print showValueWithClipboardCPButton($out, 0, $out);
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||
if (empty($val['alwayseditable'])) {
|
||||
if (in_array($val['type'], array('text', 'html'))) {
|
||||
print '<div class="longmessagecut">';
|
||||
}
|
||||
}
|
||||
//print dol_escape_htmltag($object->$key, 1, 1);
|
||||
if (in_array($val['type'], array('text', 'html'))) {
|
||||
print '</div>';
|
||||
if ($key == 'lang') {
|
||||
$langs->load("languages");
|
||||
$labellang = ($value ? $langs->trans('Language_'.$value) : '');
|
||||
print picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"');
|
||||
print $labellang;
|
||||
} else {
|
||||
if (isset($val['copytoclipboard']) && $val['copytoclipboard'] == 2) {
|
||||
$out = $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||
print showValueWithClipboardCPButton($out, 0, $out);
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||
}
|
||||
}
|
||||
//print dol_escape_htmltag($object->$key, 1, 1);
|
||||
if (in_array($val['type'], array('text', 'html'))) {
|
||||
print '</div>';
|
||||
}
|
||||
} else {
|
||||
print $form->editfieldval($labeltoshow, $key, $value, $object, 1, $val['type']);
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -144,10 +156,20 @@ foreach ($object->fields as $key => $val) {
|
||||
$rightpart .= ' tdtop';
|
||||
}
|
||||
$rightpart.= '">';
|
||||
$labeltoshow = '';
|
||||
if (!empty($val['help'])) {
|
||||
$rightpart .= $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help']));
|
||||
$labeltoshow .= $form->textwithpicto($langs->trans($val['label']), $langs->trans($val['help']));
|
||||
} else {
|
||||
$rightpart .= $langs->trans($val['label']);
|
||||
if (isset($val['copytoclipboard']) && $val['copytoclipboard'] == 1) {
|
||||
$labeltoshow .= showValueWithClipboardCPButton($value, 0, $langs->transnoentitiesnoconv($val['label']));
|
||||
} else {
|
||||
$labeltoshow .= $langs->trans($val['label']);
|
||||
}
|
||||
}
|
||||
if (empty($val['alwayseditable'])) {
|
||||
$rightpart .= $labeltoshow;
|
||||
} else {
|
||||
$rightpart .= $form->editfieldkey($labeltoshow, $key, $value, $object, 1, $val['type']);
|
||||
}
|
||||
$rightpart .= '</td>';
|
||||
$rightpart .= '<td class="valuefield fieldname_'.$key;
|
||||
@ -158,14 +180,31 @@ foreach ($object->fields as $key => $val) {
|
||||
$rightpart .= ' '.$val['cssview'];
|
||||
}
|
||||
$rightpart .= '">';
|
||||
if (in_array($val['type'], array('text', 'html'))) {
|
||||
$rightpart .= '<div class="longmessagecut">';
|
||||
}
|
||||
$rightpart .= $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||
//$rightpart .= dol_escape_htmltag($object->$key, 1, 1);
|
||||
if (in_array($val['type'], array('text', 'html'))) {
|
||||
$rightpart .= '</div>';
|
||||
|
||||
if (empty($val['alwayseditable'])) {
|
||||
if (in_array($val['type'], array('text', 'html'))) {
|
||||
$rightpart .= '<div class="longmessagecut">';
|
||||
}
|
||||
if ($key == 'lang') {
|
||||
$langs->load("languages");
|
||||
$labellang = ($value ? $langs->trans('Language_'.$value) : '');
|
||||
$rightpart .= picto_from_langcode($value, 'class="paddingrightonly saturatemedium opacitylow"');
|
||||
$rightpart .= $labellang;
|
||||
} else {
|
||||
if (isset($val['copytoclipboard']) && $val['copytoclipboard'] == 2) {
|
||||
$out = $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||
$rightpart .= showValueWithClipboardCPButton($out, 0, $out);
|
||||
} else {
|
||||
$rightpart.= $object->showOutputField($val, $key, $value, '', '', '', 0);
|
||||
}
|
||||
}
|
||||
if (in_array($val['type'], array('text', 'html'))) {
|
||||
$rightpart .= '</div>';
|
||||
}
|
||||
} else {
|
||||
$rightpart .= $form->editfieldval($labeltoshow, $key, $value, $object, 1, $val['type']);
|
||||
}
|
||||
|
||||
$rightpart .= '</td>';
|
||||
$rightpart .= '</tr>';
|
||||
}
|
||||
|
||||
@ -294,6 +294,7 @@ ErrorFailedToLoadThirdParty=Failed to find/load thirdparty from id=%s, email=%s,
|
||||
ErrorThisPaymentModeIsNotSepa=This payment mode is not a bank account
|
||||
ErrorStripeCustomerNotFoundCreateFirst=Stripe customer is not set for this thirdparty (or set to a value deleted on Stripe side). Create (or re-attach) it first.
|
||||
ErrorCharPlusNotSupportedByImapForSearch=IMAP search is not able to search into sender or recipient for a string containing the character +
|
||||
ErrorTableNotFound=Table <b>%s</b> not found
|
||||
|
||||
# Warnings
|
||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||
|
||||
@ -133,11 +133,11 @@ UseSpecificEditorURL = Use a specific editor URL
|
||||
UseSpecificFamily = Use a specific family
|
||||
UseSpecificAuthor = Use a specific author
|
||||
UseSpecificVersion = Use a specific initial version
|
||||
IncludeRefGeneration=The reference of object must be generated automatically by custom numbering rules
|
||||
IncludeRefGeneration=The reference of this object must be generated automatically by custom numbering rules
|
||||
IncludeRefGenerationHelp=Check this if you want to include code to manage the generation of the reference automatically using custom numbering rules
|
||||
IncludeDocGeneration=I want to generate some documents from templates for the object
|
||||
IncludeDocGeneration=I want the feature to generate some documents (PDF, ODT) from templates for this object
|
||||
IncludeDocGenerationHelp=If you check this, some code will be generated to add a "Generate document" box on the record.
|
||||
ShowOnCombobox=Show value into combobox
|
||||
ShowOnCombobox=Show value into combo boxes
|
||||
KeyForTooltip=Key for tooltip
|
||||
CSSClass=CSS for edit/create form
|
||||
CSSViewClass=CSS for read form
|
||||
@ -156,4 +156,7 @@ LinkToParentMenu=Parent menu (fk_xxxxmenu)
|
||||
ListOfTabsEntries=List of tab entries
|
||||
TabsDefDesc=Define here the tabs provided by your module
|
||||
TabsDefDescTooltip=The tabs provided by your module/application are defined into the array <strong>$this->tabs</strong> into the module descriptor file. You can edit manually this file or use the embedded editor.
|
||||
BadValueForType=Bad value for type %s
|
||||
BadValueForType=Bad value for type %s
|
||||
DefinePropertiesFromExistingTable=Define properties from an existing table
|
||||
DefinePropertiesFromExistingTableDesc=If a table in the database (for the object to create) already exists, you can use it to define the properties of the object.
|
||||
DefinePropertiesFromExistingTableDesc2=Keep empty if the table does not exist yet. The code generator will use different kinds of fields to build an example of table that you can edit later.
|
||||
|
||||
@ -202,10 +202,10 @@ foreach ($dirsrootforscan as $dirread) {
|
||||
}
|
||||
$textforlistofdirs .= '<strong class="wordbreakimp">'.$dirread.'</strong>';
|
||||
if ($dirread == DOL_DOCUMENT_ROOT) {
|
||||
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
|
||||
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
|
||||
$textforlistofdirs .= $form->textwithpicto('', $langs->trans("ConstantIsOn", "MAIN_FEATURES_LEVEL"));
|
||||
}
|
||||
if (!empty($conf->global->MODULEBUILDER_ADD_DOCUMENT_ROOT)) {
|
||||
if (getDolGlobalString('MODULEBUILDER_ADD_DOCUMENT_ROOT')) {
|
||||
$textforlistofdirs .= $form->textwithpicto('', $langs->trans("ConstantIsOn", "MODULEBUILDER_ADD_DOCUMENT_ROOT"));
|
||||
}
|
||||
}
|
||||
@ -317,7 +317,6 @@ if ($dirins && $action == 'initmodule' && $modulename) {
|
||||
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.sql');
|
||||
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.key.sql');
|
||||
dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.key.sql');
|
||||
dol_delete_file($destdir.'/img/object_myobject.png');
|
||||
dol_delete_file($destdir.'/class/myobject.class.php');
|
||||
|
||||
dol_delete_dir($destdir.'/class', 1);
|
||||
@ -895,237 +894,7 @@ if ($dirins && $action == 'confirm_removefile' && !empty($module)) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Build the $fields array from SQL table (initfromtablename)
|
||||
if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', 'alpha')) {
|
||||
$tablename = GETPOST('initfromtablename', 'alpha');
|
||||
$_results = $db->DDLDescTable($tablename);
|
||||
if (empty($_results)) {
|
||||
setEventMessages($langs->trans("ErrorTableNotFound", $tablename), null, 'errors');
|
||||
} else {
|
||||
/**
|
||||
* 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...)
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'noteditable' says if field is not editable (1 or 0)
|
||||
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||
* 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage)
|
||||
* 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200'
|
||||
* 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
|
||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||
* 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar'
|
||||
* 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1.
|
||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||
* 'validate' is 1 if need to validate with $this->validateField()
|
||||
* 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value)
|
||||
*/
|
||||
|
||||
/*public $fields=array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||
'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text'),
|
||||
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text'),
|
||||
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>'LinkToThirdparty'),
|
||||
'description' =>array('type'=>'text', 'label'=>'Descrption', 'enabled'=>1, 'visible'=>0, 'position'=>60),
|
||||
'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61),
|
||||
'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62),
|
||||
'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'=>1, 'position'=>501),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
|
||||
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
|
||||
);*/
|
||||
|
||||
$string = 'public $fields=array('."\n";
|
||||
$string .= "<br>";
|
||||
$i = 10;
|
||||
while ($obj = $db->fetch_object($_results)) {
|
||||
// fieldname
|
||||
$fieldname = $obj->Field;
|
||||
// type
|
||||
$type = $obj->Type;
|
||||
if ($type == 'int(11)') {
|
||||
$type = 'integer';
|
||||
}
|
||||
if ($type == 'float') {
|
||||
$type = 'real';
|
||||
}
|
||||
if (strstr($type, 'tinyint')) {
|
||||
$type = 'integer';
|
||||
}
|
||||
if ($obj->Field == 'fk_soc') {
|
||||
$type = 'integer:Societe:societe/class/societe.class.php';
|
||||
}
|
||||
if (preg_match('/^fk_proj/', $obj->Field)) {
|
||||
$type = 'integer:Project:projet/class/project.class.php:1:fk_statut=1';
|
||||
}
|
||||
if (preg_match('/^fk_prod/', $obj->Field)) {
|
||||
$type = 'integer:Product:product/class/product.class.php:1';
|
||||
}
|
||||
if ($obj->Field == 'fk_warehouse') {
|
||||
$type = 'integer:Entrepot:product/stock/class/entrepot.class.php';
|
||||
}
|
||||
if (preg_match('/^(fk_user|fk_commercial)/', $obj->Field)) {
|
||||
$type = 'integer:User:user/class/user.class.php';
|
||||
}
|
||||
|
||||
// notnull
|
||||
$notnull = ($obj->Null == 'YES' ? 0 : 1);
|
||||
if ($fieldname == 'fk_user_modif') {
|
||||
$notnull = -1;
|
||||
}
|
||||
// label
|
||||
$label = preg_replace('/_/', '', ucfirst($fieldname));
|
||||
if ($fieldname == 'rowid') {
|
||||
$label = 'TechnicalID';
|
||||
}
|
||||
if ($fieldname == 'import_key') {
|
||||
$label = 'ImportId';
|
||||
}
|
||||
if ($fieldname == 'fk_soc') {
|
||||
$label = 'ThirdParty';
|
||||
}
|
||||
if ($fieldname == 'tms') {
|
||||
$label = 'DateModification';
|
||||
}
|
||||
if ($fieldname == 'datec') {
|
||||
$label = 'DateCreation';
|
||||
}
|
||||
if ($fieldname == 'date_valid') {
|
||||
$label = 'DateValidation';
|
||||
}
|
||||
if ($fieldname == 'datev') {
|
||||
$label = 'DateValidation';
|
||||
}
|
||||
if ($fieldname == 'note_private') {
|
||||
$label = 'NotePublic';
|
||||
}
|
||||
if ($fieldname == 'note_public') {
|
||||
$label = 'NotePrivate';
|
||||
}
|
||||
if ($fieldname == 'fk_user_creat') {
|
||||
$label = 'UserAuthor';
|
||||
}
|
||||
if ($fieldname == 'fk_user_modif') {
|
||||
$label = 'UserModif';
|
||||
}
|
||||
if ($fieldname == 'fk_user_valid') {
|
||||
$label = 'UserValidation';
|
||||
}
|
||||
// visible
|
||||
$visible = -1;
|
||||
if ($fieldname == 'entity') {
|
||||
$visible = -2;
|
||||
}
|
||||
if ($fieldname == 'import_key') {
|
||||
$visible = -2;
|
||||
}
|
||||
if ($fieldname == 'fk_user_creat') {
|
||||
$visible = -2;
|
||||
}
|
||||
if ($fieldname == 'fk_user_modif') {
|
||||
$visible = -2;
|
||||
}
|
||||
if (in_array($fieldname, array('ref_ext', 'model_pdf', 'note_public', 'note_private'))) {
|
||||
$visible = 0;
|
||||
}
|
||||
// enabled
|
||||
$enabled = 1;
|
||||
// default
|
||||
$default = '';
|
||||
if ($fieldname == 'entity') {
|
||||
$default = 1;
|
||||
}
|
||||
// position
|
||||
$position = $i;
|
||||
if (in_array($fieldname, array('status', 'statut', 'fk_status', 'fk_statut'))) {
|
||||
$position = 500;
|
||||
}
|
||||
if ($fieldname == 'import_key') {
|
||||
$position = 900;
|
||||
}
|
||||
// index
|
||||
$index = 0;
|
||||
if ($fieldname == 'entity') {
|
||||
$index = 1;
|
||||
}
|
||||
// css, cssview, csslist
|
||||
$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';
|
||||
}
|
||||
|
||||
// type
|
||||
$picto = $obj->Picto;
|
||||
if ($obj->Field == 'fk_soc') {
|
||||
$picto = 'company';
|
||||
}
|
||||
if (preg_match('/^fk_proj/', $obj->Field)) {
|
||||
$picto = 'project';
|
||||
}
|
||||
|
||||
// Build the property string
|
||||
$string .= "'".$obj->Field."'=>array('type'=>'".$type."', 'label'=>'".$label."',";
|
||||
if ($default != '') {
|
||||
$string .= " 'default'=>".$default.",";
|
||||
}
|
||||
$string .= " 'enabled'=>".$enabled.",";
|
||||
$string .= " 'visible'=>".$visible;
|
||||
if ($notnull) {
|
||||
$string .= ", 'notnull'=>".$notnull;
|
||||
}
|
||||
if ($fieldname == 'ref' || $fieldname == 'code') {
|
||||
$string .= ", 'showoncombobox'=>1";
|
||||
}
|
||||
$string .= ", 'position'=>".$position;
|
||||
if ($index) {
|
||||
$string .= ", 'index'=>".$index;
|
||||
}
|
||||
if ($picto) {
|
||||
$string .= ", 'picto'=>'".$picto."'";
|
||||
}
|
||||
if ($css) {
|
||||
$string .= ", 'css'=>".$css;
|
||||
}
|
||||
if ($cssview) {
|
||||
$string .= ", 'cssview'=>".$cssview;
|
||||
}
|
||||
if ($csslist) {
|
||||
$string .= ", 'csslist'=>".$csslist;
|
||||
}
|
||||
$string .= "),\n";
|
||||
$string .= "<br>";
|
||||
$i += 5;
|
||||
}
|
||||
$string .= ');'."\n";
|
||||
$string .= "<br>";
|
||||
print $string;
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Init an object
|
||||
if ($dirins && $action == 'initobject' && $module && $objectname) {
|
||||
$objectname = ucfirst($objectname);
|
||||
|
||||
@ -1169,6 +938,247 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
||||
}
|
||||
}
|
||||
|
||||
// If we must reuse a table for properties, define $stringforproperties
|
||||
$stringforproperties = '';
|
||||
$tablename = GETPOST('initfromtablename', 'alpha');
|
||||
if ($tablename) {
|
||||
$_results = $db->DDLDescTable($tablename);
|
||||
if (empty($_results)) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorTableNotFound", $tablename), null, 'errors');
|
||||
} else {
|
||||
/**
|
||||
* 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter[:Sortfield]]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password')
|
||||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...)
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'noteditable' says if field is not editable (1 or 0)
|
||||
* 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0')
|
||||
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||
* 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage)
|
||||
* 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200'
|
||||
* 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
|
||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||
* 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar'
|
||||
* 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1.
|
||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||
* 'validate' is 1 if need to validate with $this->validateField()
|
||||
* 'copytoclipboard' is 1 or 2 to allow to add a picto to copy value into clipboard (1=picto after label, 2=picto after value)
|
||||
*/
|
||||
|
||||
/*public $fields=array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||
'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'alwayseditable'=>'1'),
|
||||
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text'),
|
||||
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>'LinkToThirdparty'),
|
||||
'description' =>array('type'=>'text', 'label'=>'Descrption', 'enabled'=>1, 'visible'=>0, 'position'=>60),
|
||||
'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61),
|
||||
'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62),
|
||||
'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'=>1, 'position'=>501),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
|
||||
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
|
||||
);*/
|
||||
|
||||
$stringforproperties = '// BEGIN MODULEBUILDER PROPERTIES'."\n";
|
||||
$stringforproperties .= 'public $fields=array('."\n";
|
||||
$i = 10;
|
||||
while ($obj = $db->fetch_object($_results)) {
|
||||
// fieldname
|
||||
$fieldname = $obj->Field;
|
||||
// type
|
||||
$type = $obj->Type;
|
||||
if ($type == 'int(11)') {
|
||||
$type = 'integer';
|
||||
}
|
||||
if ($type == 'float') {
|
||||
$type = 'real';
|
||||
}
|
||||
if (strstr($type, 'tinyint')) {
|
||||
$type = 'integer';
|
||||
}
|
||||
if ($obj->Field == 'fk_soc') {
|
||||
$type = 'integer:Societe:societe/class/societe.class.php';
|
||||
}
|
||||
if (preg_match('/^fk_proj/', $obj->Field)) {
|
||||
$type = 'integer:Project:projet/class/project.class.php:1:fk_statut=1';
|
||||
}
|
||||
if (preg_match('/^fk_prod/', $obj->Field)) {
|
||||
$type = 'integer:Product:product/class/product.class.php:1';
|
||||
}
|
||||
if ($obj->Field == 'fk_warehouse') {
|
||||
$type = 'integer:Entrepot:product/stock/class/entrepot.class.php';
|
||||
}
|
||||
if (preg_match('/^(fk_user|fk_commercial)/', $obj->Field)) {
|
||||
$type = 'integer:User:user/class/user.class.php';
|
||||
}
|
||||
|
||||
// notnull
|
||||
$notnull = ($obj->Null == 'YES' ? 0 : 1);
|
||||
if ($fieldname == 'fk_user_modif') {
|
||||
$notnull = -1;
|
||||
}
|
||||
// label
|
||||
$label = preg_replace('/_/', '', ucfirst($fieldname));
|
||||
if ($fieldname == 'rowid') {
|
||||
$label = 'TechnicalID';
|
||||
}
|
||||
if ($fieldname == 'import_key') {
|
||||
$label = 'ImportId';
|
||||
}
|
||||
if ($fieldname == 'fk_soc') {
|
||||
$label = 'ThirdParty';
|
||||
}
|
||||
if ($fieldname == 'tms') {
|
||||
$label = 'DateModification';
|
||||
}
|
||||
if ($fieldname == 'datec') {
|
||||
$label = 'DateCreation';
|
||||
}
|
||||
if ($fieldname == 'date_valid') {
|
||||
$label = 'DateValidation';
|
||||
}
|
||||
if ($fieldname == 'datev') {
|
||||
$label = 'DateValidation';
|
||||
}
|
||||
if ($fieldname == 'note_private') {
|
||||
$label = 'NotePublic';
|
||||
}
|
||||
if ($fieldname == 'note_public') {
|
||||
$label = 'NotePrivate';
|
||||
}
|
||||
if ($fieldname == 'fk_user_creat') {
|
||||
$label = 'UserAuthor';
|
||||
}
|
||||
if ($fieldname == 'fk_user_modif') {
|
||||
$label = 'UserModif';
|
||||
}
|
||||
if ($fieldname == 'fk_user_valid') {
|
||||
$label = 'UserValidation';
|
||||
}
|
||||
// visible
|
||||
$visible = -1;
|
||||
if ($fieldname == 'entity') {
|
||||
$visible = -2;
|
||||
}
|
||||
if ($fieldname == 'import_key') {
|
||||
$visible = -2;
|
||||
}
|
||||
if ($fieldname == 'fk_user_creat') {
|
||||
$visible = -2;
|
||||
}
|
||||
if ($fieldname == 'fk_user_modif') {
|
||||
$visible = -2;
|
||||
}
|
||||
if (in_array($fieldname, array('ref_ext', 'model_pdf', 'note_public', 'note_private'))) {
|
||||
$visible = 0;
|
||||
}
|
||||
// enabled
|
||||
$enabled = 1;
|
||||
// default
|
||||
$default = '';
|
||||
if ($fieldname == 'entity') {
|
||||
$default = 1;
|
||||
}
|
||||
// position
|
||||
$position = $i;
|
||||
if (in_array($fieldname, array('status', 'statut', 'fk_status', 'fk_statut'))) {
|
||||
$position = 500;
|
||||
}
|
||||
if ($fieldname == 'import_key') {
|
||||
$position = 900;
|
||||
}
|
||||
// $alwayseditable
|
||||
if ($fieldname == 'label') {
|
||||
$alwayseditable = 1;
|
||||
}
|
||||
// index
|
||||
$index = 0;
|
||||
if ($fieldname == 'entity') {
|
||||
$index = 1;
|
||||
}
|
||||
// css, cssview, csslist
|
||||
$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';
|
||||
}
|
||||
if (in_array($fieldname, array('ref', 'label')) || preg_match('/integer:/', $type)) {
|
||||
$csslist = 'tdoverflowmax150';
|
||||
}
|
||||
|
||||
// type
|
||||
$picto = $obj->Picto;
|
||||
if ($obj->Field == 'fk_soc') {
|
||||
$picto = 'company';
|
||||
}
|
||||
if (preg_match('/^fk_proj/', $obj->Field)) {
|
||||
$picto = 'project';
|
||||
}
|
||||
|
||||
// Build the property string
|
||||
$stringforproperties .= "'".$obj->Field."'=>array('type'=>'".$type."', 'label'=>'".$label."',";
|
||||
if ($default != '') {
|
||||
$stringforproperties .= " 'default'=>".$default.",";
|
||||
}
|
||||
$stringforproperties .= " 'enabled'=>".$enabled.",";
|
||||
$stringforproperties .= " 'visible'=>".$visible;
|
||||
if ($notnull) {
|
||||
$stringforproperties .= ", 'notnull'=>".$notnull;
|
||||
}
|
||||
if ($alwayseditable) {
|
||||
$stringforproperties .= ", 'alwayseditable'=>1";
|
||||
}
|
||||
if ($fieldname == 'ref' || $fieldname == 'code') {
|
||||
$stringforproperties .= ", 'showoncombobox'=>1";
|
||||
}
|
||||
$stringforproperties .= ", 'position'=>".$position;
|
||||
if ($index) {
|
||||
$stringforproperties .= ", 'index'=>".$index;
|
||||
}
|
||||
if ($picto) {
|
||||
$stringforproperties .= ", 'picto'=>'".$picto."'";
|
||||
}
|
||||
if ($css) {
|
||||
$stringforproperties .= ", 'css'=>'".$css."'";
|
||||
}
|
||||
if ($cssview) {
|
||||
$stringforproperties .= ", 'cssview'=>'".$cssview."'";
|
||||
}
|
||||
if ($csslist) {
|
||||
$stringforproperties .= ", 'csslist'=>'".$csslist."'";
|
||||
}
|
||||
$stringforproperties .= "),\n";
|
||||
$i += 5;
|
||||
}
|
||||
$stringforproperties .= ');'."\n";
|
||||
$stringforproperties .= '// END MODULEBUILDER PROPERTIES'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Copy some files
|
||||
$filetogenerate = array(
|
||||
@ -1186,7 +1196,6 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
||||
'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql',
|
||||
'sql/llx_mymodule_myobject_extrafields.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.key.sql',
|
||||
//'scripts/mymodule.php'=>'scripts/'.strtolower($objectname).'.php',
|
||||
'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
|
||||
'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
|
||||
//'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php',
|
||||
);
|
||||
@ -1210,20 +1219,33 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($filetogenerate as $srcfile => $destfile) {
|
||||
$result = dol_copy($srcdir.'/'.$srcfile, $destdir.'/'.$destfile, $newmask, 0);
|
||||
if ($result <= 0) {
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFailToCopyFile", $srcdir.'/'.$srcfile, $destdir.'/'.$destfile), null, 'errors');
|
||||
} else {
|
||||
// $result == 0
|
||||
setEventMessages($langs->trans("FileAlreadyExists", $destfile), null, 'warnings');
|
||||
|
||||
if (!$error) {
|
||||
foreach ($filetogenerate as $srcfile => $destfile) {
|
||||
$result = dol_copy($srcdir.'/'.$srcfile, $destdir.'/'.$destfile, $newmask, 0);
|
||||
if ($result <= 0) {
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFailToCopyFile", $srcdir.'/'.$srcfile, $destdir.'/'.$destfile), null, 'errors');
|
||||
} else {
|
||||
// $result == 0
|
||||
setEventMessages($langs->trans("FileAlreadyExists", $destfile), null, 'warnings');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Replace property section with $stringforproperties
|
||||
if (!$error && $stringforproperties) {
|
||||
//var_dump($stringforproperties);exit;
|
||||
$arrayreplacement = array(
|
||||
'/\/\/ BEGIN MODULEBUILDER PROPERTIES.*\/\/ END MODULEBUILDER PROPERTIES/ims' => $stringforproperties
|
||||
);
|
||||
|
||||
dolReplaceInFile($destdir.'/class/'.strtolower($objectname).'.class.php', $arrayreplacement, '', 0, 0, 1);
|
||||
}
|
||||
|
||||
// Edit the class 'class/'.strtolower($objectname).'.class.php'
|
||||
if (GETPOST('includerefgeneration', 'aZ09')) {
|
||||
// Replace 'visible'=>1, 'noteditable'=>0, 'default'=>''
|
||||
@ -1386,14 +1408,19 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
||||
if (!$error) {
|
||||
// Edit the class file to write properties
|
||||
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask);
|
||||
if (is_numeric($object) && $object < 0) {
|
||||
|
||||
if (is_numeric($object) && $object <= 0) {
|
||||
$pathoffiletoeditsrc = $destdir.'/class/'.strtolower($objectname).'.class.php';
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', $pathoffiletoeditsrc), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (!$error) {
|
||||
// Edit sql with new properties
|
||||
$result = rebuildObjectSql($destdir, $module, $objectname, $newmask, '', $object);
|
||||
if ($result < 0) {
|
||||
|
||||
if ($result <= 0) {
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', '.sql'), null);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -1401,6 +1428,8 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans('FilesForObjectInitialized', $objectname), null);
|
||||
$tabobj = $objectname;
|
||||
} else {
|
||||
$tabobj = 'newobject';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1485,25 +1514,26 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
||||
|
||||
if (!$error && !GETPOST('regenerateclasssql')&& !GETPOST('regeneratemissing')) {
|
||||
$addfieldentry = array(
|
||||
'name'=>GETPOST('propname', 'aZ09'),
|
||||
'label'=>GETPOST('proplabel', 'alpha'),
|
||||
'type'=>GETPOST('proptype', 'alpha'),
|
||||
'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
|
||||
'visible'=>GETPOST('propvisible', 'int'),
|
||||
'enabled'=>GETPOST('propenabled', 'int'),
|
||||
'position'=>GETPOST('propposition', 'int'),
|
||||
'notnull'=>GETPOST('propnotnull', 'int'),
|
||||
'index'=>GETPOST('propindex', 'int'),
|
||||
'searchall'=>GETPOST('propsearchall', 'int'),
|
||||
'isameasure'=>GETPOST('propisameasure', 'int'),
|
||||
'comment'=>GETPOST('propcomment', 'alpha'),
|
||||
'help'=>GETPOST('prophelp', 'alpha'),
|
||||
'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example
|
||||
'cssview'=>GETPOST('propcssview', 'alpha'),
|
||||
'csslist'=>GETPOST('propcsslist', 'alpha'),
|
||||
'default'=>GETPOST('propdefault', 'restricthtml'),
|
||||
'noteditable'=>intval(GETPOST('propnoteditable', 'int')),
|
||||
'validate' => GETPOST('propvalidate', 'int')
|
||||
'name'=>GETPOST('propname', 'aZ09'),
|
||||
'label'=>GETPOST('proplabel', 'alpha'),
|
||||
'type'=>GETPOST('proptype', 'alpha'),
|
||||
'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
|
||||
'visible'=>GETPOST('propvisible', 'int'),
|
||||
'enabled'=>GETPOST('propenabled', 'int'),
|
||||
'position'=>GETPOST('propposition', 'int'),
|
||||
'notnull'=>GETPOST('propnotnull', 'int'),
|
||||
'index'=>GETPOST('propindex', 'int'),
|
||||
'searchall'=>GETPOST('propsearchall', 'int'),
|
||||
'isameasure'=>GETPOST('propisameasure', 'int'),
|
||||
'comment'=>GETPOST('propcomment', 'alpha'),
|
||||
'help'=>GETPOST('prophelp', 'alpha'),
|
||||
'css'=>GETPOST('propcss', 'alpha'), // Can be 'maxwidth500 widthcentpercentminusxx' for example
|
||||
'cssview'=>GETPOST('propcssview', 'alpha'),
|
||||
'csslist'=>GETPOST('propcsslist', 'alpha'),
|
||||
'default'=>GETPOST('propdefault', 'restricthtml'),
|
||||
'noteditable'=>intval(GETPOST('propnoteditable', 'int')),
|
||||
'alwayseditable'=>intval(GETPOST('propalwayseditable', 'int')),
|
||||
'validate' => GETPOST('propvalidate', 'int')
|
||||
);
|
||||
|
||||
|
||||
@ -1528,6 +1558,8 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
||||
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, $addfieldentry, $moduletype);
|
||||
|
||||
if (is_numeric($object) && $object <= 0) {
|
||||
$pathoffiletoeditsrc = $destdir.'/class/'.strtolower($objectname).'.class.php';
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', $pathoffiletoeditsrc), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -1537,6 +1569,7 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
||||
$result = rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object, $moduletype);
|
||||
|
||||
if ($result <= 0) {
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', '.sql'), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -1568,7 +1601,10 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey) {
|
||||
// Edit the class file to write properties
|
||||
if (!$error) {
|
||||
$object = rebuildObjectClass($destdir, $module, $objectname, $newmask, $srcdir, array(), $propertykey);
|
||||
|
||||
if (is_numeric($object) && $object <= 0) {
|
||||
$pathoffiletoeditsrc = $destdir.'/class/'.strtolower($objectname).'.class.php';
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', $pathoffiletoeditsrc), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -1576,7 +1612,9 @@ if ($dirins && $action == 'confirm_deleteproperty' && $propertykey) {
|
||||
// Edit sql with new properties
|
||||
if (!$error) {
|
||||
$result = rebuildObjectSql($destdir, $module, $objectname, $newmask, $srcdir, $object);
|
||||
|
||||
if ($result <= 0) {
|
||||
setEventMessages($langs->trans('ErrorFailToCreateFile', '.sql'), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -1655,7 +1693,6 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) {
|
||||
'sql/llx_mymodule_myobject.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql',
|
||||
'sql/llx_mymodule_myobject_extrafields.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.key.sql',
|
||||
'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php',
|
||||
'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png',
|
||||
'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php',
|
||||
'class/api_myobject.class.php'=>'class/api_'.strtolower($module).'.class.php',
|
||||
'core/modules/mymodule/mod_myobject_advanced.php'=>'core/modules/'.strtolower($module).'/mod_'.strtolower($objectname).'_advanced.php',
|
||||
@ -1934,7 +1971,7 @@ if ($message) {
|
||||
}
|
||||
|
||||
//print $langs->trans("ModuleBuilderDesc3", count($listofmodules), $FILEFLAG).'<br>';
|
||||
$infomodulesfound = '<div style="padding: 12px 9px 12px">'.$form->textwithpicto('<span class="opacitymedium hideonsmartphone">'.$langs->trans("ModuleBuilderDesc3", count($listofmodules)).'</span>', $langs->trans("ModuleBuilderDesc4", $FILEFLAG).'<br>'.$textforlistofdirs).'</div>';
|
||||
$infomodulesfound = '<div style="padding: 12px 9px 12px">'.$form->textwithpicto('', $langs->trans("ModuleBuilderDesc3", count($listofmodules)).'<br><br>'.$langs->trans("ModuleBuilderDesc4", $FILEFLAG).'<br>'.$textforlistofdirs).'</div>';
|
||||
|
||||
|
||||
// Load module descriptor
|
||||
@ -2013,8 +2050,10 @@ if (is_array($listofmodules) && count($listofmodules) > 0) {
|
||||
}
|
||||
|
||||
$urltomodulesetup = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?search_keyword='.urlencode($module).'">'.$langs->trans('Home').'-'.$langs->trans("Setup").'-'.$langs->trans("Modules").'</a>';
|
||||
if (!empty($conf->global->$const_name)) { // If module is already activated
|
||||
$linktoenabledisable .= '<a class="reposition asetresetmodule valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=reset&value=mod'.$module.$param.'">';
|
||||
|
||||
// Define $linktoenabledisable to show after module title
|
||||
if (isModEnabled($modulelowercase)) { // If module is already activated
|
||||
$linktoenabledisable .= '<a class="reposition asetresetmodule valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=reset&token='.newToken().'&value=mod'.$module.$param.'">';
|
||||
$linktoenabledisable .= img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', '', 1);
|
||||
$linktoenabledisable .= '</a>';
|
||||
|
||||
@ -2074,7 +2113,7 @@ if (is_array($listofmodules) && count($listofmodules) > 0) {
|
||||
}
|
||||
|
||||
$head[$h][0] = $_SERVER["PHP_SELF"].'?module=deletemodule';
|
||||
$head[$h][1] = $langs->trans("DangerZone");
|
||||
$head[$h][1] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("DangerZone");
|
||||
$head[$h][2] = 'deletemodule';
|
||||
$h++;
|
||||
|
||||
@ -2271,6 +2310,8 @@ if ($module == 'initmodule') {
|
||||
$head2[$h][2] = 'buildpackage';
|
||||
$h++;
|
||||
|
||||
$MAXTABFOROBJECT = 15;
|
||||
|
||||
print '<!-- Section for a given module -->';
|
||||
|
||||
// Note module is inside $dirread
|
||||
@ -2282,7 +2323,7 @@ if ($module == 'initmodule') {
|
||||
$pathtochangelog = $modulelowercase.'/ChangeLog.md';
|
||||
|
||||
if ($action != 'editfile' || empty($file)) {
|
||||
print dol_get_fiche_head($head2, $tab, '', -1, '', 0, '', '', 0, 'formodulesuffix'); // Description - level 2
|
||||
print dol_get_fiche_head($head2, $tab, '', -1, '', 0, '', '', $MAXTABFOROBJECT, 'formodulesuffix'); // Description - level 2
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("ModuleBuilderDesc".$tab).'</span>';
|
||||
$infoonmodulepath = '';
|
||||
@ -2442,7 +2483,7 @@ if ($module == 'initmodule') {
|
||||
print '</form>';
|
||||
}
|
||||
} else {
|
||||
print dol_get_fiche_head($head2, $tab, '', -1, '', 0, '', '', 0, 'formodulesuffix'); // Level 2
|
||||
print dol_get_fiche_head($head2, $tab, '', -1, '', 0, '', '', $MAXTABFOROBJECT, 'formodulesuffix'); // Level 2
|
||||
}
|
||||
|
||||
if ($tab == 'languages') {
|
||||
@ -2563,7 +2604,7 @@ if ($module == 'initmodule') {
|
||||
|
||||
if ($h > 1) {
|
||||
$head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabobj=deleteobject';
|
||||
$head3[$h][1] = $langs->trans("DangerZone");
|
||||
$head3[$h][1] =img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("DangerZone");
|
||||
$head3[$h][2] = 'deleteobject';
|
||||
$h++;
|
||||
}
|
||||
@ -2589,12 +2630,38 @@ if ($module == 'initmodule') {
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("EnterNameOfObjectDesc").'</span><br><br>';
|
||||
|
||||
print '<input type="text" name="objectname" maxlength="64" value="'.dol_escape_htmltag(GETPOST('objectname', 'alpha') ? GETPOST('objectname', 'alpha') : $modulename).'" placeholder="'.dol_escape_htmltag($langs->trans("ObjectKey")).'" autofocus><br>';
|
||||
print '<input type="checkbox" name="includerefgeneration" id="includerefgeneration" value="includerefgeneration"> <label for="includerefgeneration">'.$form->textwithpicto($langs->trans("IncludeRefGeneration"), $langs->trans("IncludeRefGenerationHelp")).'</label><br>';
|
||||
print '<div class="tagtable">';
|
||||
|
||||
print '<div class="tagtr"><div class="tagtd">';
|
||||
print '<span class="opacitymedium">'.$langs->trans("ObjectKey").'</span> ';
|
||||
print '</div><div class="tagtd">';
|
||||
print '<input type="text" name="objectname" maxlength="64" value="'.dol_escape_htmltag(GETPOST('objectname', 'alpha') ? GETPOST('objectname', 'alpha') : $modulename).'" autofocus><br>';
|
||||
print '</div></div>';
|
||||
|
||||
print '<div class="tagtr"><div class="tagtd">';
|
||||
print '<span class="opacitymedium">'.$langs->trans("Picto").'</span> ';
|
||||
print '</div><div class="tagtd">';
|
||||
print '<input type="text" name="idpicto" value="fa-generic" placeholder="'.dol_escape_htmltag($langs->trans("Picto")).'">';
|
||||
print $form->textwithpicto('', $langs->trans("Example").': fa-generic, fa-globe, ... any font awesome code.<br>Advanced syntax is fa-fakey[_faprefix[_facolor[_fasize]]]');
|
||||
print '</div></div>';
|
||||
|
||||
print '<div class="tagtr"><div class="tagtd">';
|
||||
print '<span class="opacitymedium">'.$langs->trans("DefinePropertiesFromExistingTable").'</span> ';
|
||||
print '</div><div class="tagtd">';
|
||||
print '<input type="text" name="initfromtablename" value="'.GETPOST('initfromtablename').'" placeholder="'.$langs->trans("TableName").'">';
|
||||
print $form->textwithpicto('', $langs->trans("DefinePropertiesFromExistingTableDesc").'<br>'.$langs->trans("DefinePropertiesFromExistingTableDesc2"));
|
||||
print '</div></div>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
print '<input type="checkbox" name="includerefgeneration" id="includerefgeneration" value="includerefgeneration"> <label class="margintoponly" for="includerefgeneration">'.$form->textwithpicto($langs->trans("IncludeRefGeneration"), $langs->trans("IncludeRefGenerationHelp")).'</label><br>';
|
||||
print '<input type="checkbox" name="includedocgeneration" id="includedocgeneration" value="includedocgeneration"> <label for="includedocgeneration">'.$form->textwithpicto($langs->trans("IncludeDocGeneration"), $langs->trans("IncludeDocGenerationHelp")).'</label><br>';
|
||||
print '<input type="submit" class="button smallpaddingimp" name="create" value="'.dol_escape_htmltag($langs->trans("GenerateCode")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
||||
print '<br>';
|
||||
print '<input type="submit" class="button small" name="create" value="'.dol_escape_htmltag($langs->trans("GenerateCode")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
/*
|
||||
print '<br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("or").'</span>';
|
||||
print '<br>';
|
||||
@ -2604,6 +2671,7 @@ if ($module == 'initmodule') {
|
||||
print '<input type="text" name="initfromtablename" value="" placeholder="'.$langs->trans("TableName").'">';
|
||||
print '<input type="submit" class="button smallpaddingimp" name="createtablearray" value="'.dol_escape_htmltag($langs->trans("GenerateCode")).'"'.($dirins ? '' : ' disabled="disabled"').'>';
|
||||
print '<br>';
|
||||
*/
|
||||
|
||||
print '</form>';
|
||||
} elseif ($tabobj == 'deleteobject') {
|
||||
@ -2665,7 +2733,7 @@ if ($module == 'initmodule') {
|
||||
}
|
||||
if (class_exists($tabobj)) {
|
||||
try {
|
||||
$tmpobjet = @new $tabobj($db);
|
||||
$tmpobject = @new $tabobj($db);
|
||||
} catch (Exception $e) {
|
||||
dol_syslog('Failed to load Constructor of class: '.$e->getMessage(), LOG_WARNING);
|
||||
}
|
||||
@ -2738,13 +2806,22 @@ if ($module == 'initmodule') {
|
||||
$urlofcard = dol_buildpath('/'.$pathtocard, 1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
print '<!-- section for object -->';
|
||||
print '<div class="fichehalfleft smallxxx">';
|
||||
// Main DAO class file
|
||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("ClassFile").' : <strong>'.(dol_is_file($realpathtoclass) ? '' : '<strike>').preg_replace('/^'.strtolower($module).'\//', '', $pathtoclass).(dol_is_file($realpathtoclass) ? '' : '</strike>').'</strong>';
|
||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtoclass).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
// Image
|
||||
if (dol_is_file($realpathtopicto)) {
|
||||
print '<span class="fa fa-file-image-o"></span> '.$langs->trans("Image").' : <strong>'.(dol_is_file($realpathtopicto) ? '' : '<strike>').preg_replace('/^'.strtolower($module).'\//', '', $pathtopicto).(dol_is_file($realpathtopicto) ? '' : '</strike>').'</strong>';
|
||||
//print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtopicto).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
} elseif (!empty($tmpobject)) {
|
||||
print '<span class="fa fa-file-image-o"></span> '.$langs->trans("Image").' : '.img_picto('', $tmpobject->picto, 'class="pictofixedwidth"');
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
// API file
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("ApiClassFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtoapi) ? '' : '<strike><span class="opacitymedium">').preg_replace('/^'.strtolower($module).'\//', '', $pathtoapi).(dol_is_file($realpathtoapi)?'':'</span></strike>').'</strong>';
|
||||
@ -2781,9 +2858,6 @@ if ($module == 'initmodule') {
|
||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("PageForObjLib").' : <strong class="wordbreak">'.(dol_is_file($realpathtoobjlib) ? '' : '<strike>').preg_replace('/^'.strtolower($module).'\//', '', $pathtoobjlib).(dol_is_file($realpathtoobjlib) ? '' : '</strike>').'</strong>';
|
||||
print ' <a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtoobjlib).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file-image-o"></span> '.$langs->trans("Image").' : <strong>'.(dol_is_file($realpathtopicto) ? '' : '<strike>').preg_replace('/^'.strtolower($module).'\//', '', $pathtopicto).(dol_is_file($realpathtopicto) ? '' : '</strike>').'</strong>';
|
||||
//print ' <a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&tabobj='.$tabobj.'&module='.$module.($forceddirread?'@'.$dirread:'').'&action=editfile&token='.newToken().'&format=php&file='.urlencode($pathtopicto).'">'.img_picto($langs->trans("Edit"), 'edit').'</a>';
|
||||
print '<br>';
|
||||
|
||||
print '<br>';
|
||||
print '<span class="fa fa-file-o"></span> '.$langs->trans("SqlFile").' : <strong class="wordbreak">'.(dol_is_file($realpathtosql) ? '' : '<strike>').preg_replace('/^'.strtolower($module).'\//', '', $pathtosql).(dol_is_file($realpathtosql) ? '' : '</strike>').'</strong>';
|
||||
@ -2871,7 +2945,7 @@ if ($module == 'initmodule') {
|
||||
|
||||
print '<br><br><br>';
|
||||
|
||||
if (!empty($tmpobjet)) {
|
||||
if (!empty($tmpobject)) {
|
||||
$reflector = new ReflectionClass($tabobj);
|
||||
$reflectorproperties = $reflector->getProperties(); // Can also use get_object_vars
|
||||
$reflectorpropdefault = $reflector->getDefaultProperties(); // Can also use get_object_vars
|
||||
@ -2911,6 +2985,7 @@ if ($module == 'initmodule') {
|
||||
print '<th class="center">'.$form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc")).'</th>';
|
||||
print '<th class="center">'.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).'</th>';
|
||||
print '<th class="center">'.$langs->trans("NotEditable").'</th>';
|
||||
print '<th class="center">'.$langs->trans("AlwaysEditable").'</th>';
|
||||
print '<th class="center">'.$form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")).'</th>';
|
||||
print '<th class="center">'.$form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")).'</th>';
|
||||
print '<th class="center">'.$langs->trans("CSSClass").'</th>';
|
||||
@ -2924,9 +2999,9 @@ if ($module == 'initmodule') {
|
||||
print '<th class="none"></th>';
|
||||
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 $tmpobject->fields may have been
|
||||
// modified during the constructor and we want value into head of class before constructor is called.
|
||||
//$properties = dol_sort_array($tmpobjet->fields, 'position');
|
||||
//$properties = dol_sort_array($tmpobject->fields, 'position');
|
||||
$properties = dol_sort_array($reflectorpropdefault['fields'], 'position');
|
||||
|
||||
if (!empty($properties)) {
|
||||
@ -2944,6 +3019,7 @@ if ($module == 'initmodule') {
|
||||
print '<td class="center"><input type="text" class="center maxwidth50" name="propenabled" value="'.dol_escape_htmltag(GETPOST('propenabled', 'alpha')).'"></td>';
|
||||
print '<td class="center"><input type="text" class="center maxwidth50" name="propvisible" value="'.dol_escape_htmltag(GETPOST('propvisible', 'alpha')).'"></td>';
|
||||
print '<td class="center"><input type="text" class="center maxwidth50" name="propnoteditable" value="'.dol_escape_htmltag(GETPOST('propnoteditable', 'alpha')).'"></td>';
|
||||
print '<td class="center"><input type="text" class="center maxwidth50" name="propalwayseditable" value="'.dol_escape_htmltag(GETPOST('propalwayseditable', 'alpha')).'"></td>';
|
||||
print '<td class="center"><input type="text" class="center maxwidth50" name="propsearchall" value="'.dol_escape_htmltag(GETPOST('propsearchall', 'alpha')).'"></td>';
|
||||
print '<td class="center"><input type="text" class="center maxwidth50" name="propisameasure" value="'.dol_escape_htmltag(GETPOST('propisameasure', 'alpha')).'"></td>';
|
||||
print '<td class="center"><input type="text" class="maxwidth50" name="propcss" value="'.dol_escape_htmltag(GETPOST('propcss', 'alpha')).'"></td>';
|
||||
@ -2965,7 +3041,7 @@ if ($module == 'initmodule') {
|
||||
{
|
||||
$propname=$propval->getName();
|
||||
$comment=$propval->getDocComment();
|
||||
$type=gettype($tmpobjet->$propname);
|
||||
$type=gettype($tmpobject->$propname);
|
||||
$default=$propdefault[$propname];
|
||||
// Discard generic properties
|
||||
if (in_array($propname, array('element', 'childtables', 'table_element', 'table_element_line', 'class_element_line', 'ismultientitymanaged'))) continue;
|
||||
@ -2986,6 +3062,7 @@ if ($module == 'initmodule') {
|
||||
$propenabled = $propval['enabled'];
|
||||
$propvisible = $propval['visible'];
|
||||
$propnoteditable = !empty($propval['noteditable'])?$propval['noteditable']:0;
|
||||
$propalwayseditable = !empty($propval['alwayseditable'])?$propval['alwayseditable']:0;
|
||||
$propsearchall = !empty($propval['searchall'])?$propval['searchall']:0;
|
||||
$propisameasure = !empty($propval['isameasure'])?$propval['isameasure']:0;
|
||||
$propcss = !empty($propval['css'])?$propval['css']:'';
|
||||
@ -3044,6 +3121,9 @@ if ($module == 'initmodule') {
|
||||
print '<input class="center" name="propnoteditable" size="2" value="'.dol_escape_htmltag($propnoteditable).'">';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input class="center" name="propalwayseditable" size="2" value="'.dol_escape_htmltag($propalwayseditable).'">';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input class="center" name="propsearchall" size="2" value="'.dol_escape_htmltag($propsearchall).'">';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
@ -3110,6 +3190,9 @@ if ($module == 'initmodule') {
|
||||
print $propnoteditable ? dol_escape_htmltag($propnoteditable) : '';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propalwayseditable ? dol_escape_htmltag($propalwayseditable) : '';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
print $propsearchall ? '1' : '';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
|
||||
@ -89,6 +89,7 @@ class MyObject extends CommonObject
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
* 'noteditable' says if field is not editable (1 or 0)
|
||||
* 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0')
|
||||
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...).
|
||||
@ -115,19 +116,19 @@ class MyObject extends CommonObject
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>10),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'noteditable'=>0, 'default'=>'', 'notnull'=> 1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object', '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),
|
||||
'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, 'alwayseditable'=>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),
|
||||
'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'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'OrganizationEventLinkToThirdParty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'),
|
||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'),
|
||||
'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'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'OrganizationEventLinkToThirdParty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'),
|
||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'),
|
||||
'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, 'cssview'=>'wordbreak'),
|
||||
'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),
|
||||
'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),
|
||||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>510, 'foreignkey'=>'user.rowid'),
|
||||
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
|
||||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'notnull'=> 1, 'position'=>510, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax150'),
|
||||
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511, 'csslist'=>'tdoverflowmax150'),
|
||||
//'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||
'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),
|
||||
|
||||
14
htdocs/modulebuilder/template/img/README.md
Normal file
14
htdocs/modulebuilder/template/img/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
Directory for module image files
|
||||
--------------------------------
|
||||
|
||||
You can put here the .png files of your module:
|
||||
|
||||
|
||||
If the picto of your module is an image (property $picto has been set to 'mymodule.png@mymodule', you can put into this
|
||||
directory a .png file called *object_mymodule.png* (16x16 or 32x32 pixels)
|
||||
|
||||
|
||||
If the picto of an object is an image (property $picto of the object.class.php has been set to 'myobject.png@mymodule', then you can put into this
|
||||
directory a .png file called *object_myobject.png* (16x16 or 32x32 pixels)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 219 B |
Binary file not shown.
|
Before Width: | Height: | Size: 208 B |
Binary file not shown.
|
Before Width: | Height: | Size: 219 B |
@ -105,7 +105,7 @@ class Mo extends CommonObject
|
||||
'mrptype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>34, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:0', 'label'=>'Product', 'enabled'=>'$conf->product->enabled', 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'comment'=>"Product to produce", 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax100', 'picto'=>'product'),
|
||||
'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'2', 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'2', 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200', 'alwayseditable'=>1),
|
||||
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax150'),
|
||||
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1, 'css'=>'minwidth200 maxwidth400', 'csslist'=>'tdoverflowmax100'),
|
||||
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>'$conf->stock->enabled', 'visible'=>1, 'position'=>52, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax200'),
|
||||
@ -116,8 +116,8 @@ class Mo extends CommonObject
|
||||
'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502,),
|
||||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'),
|
||||
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1, 'csslist'=>'tdoverflowmax100'),
|
||||
'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap'),
|
||||
'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1,),
|
||||
'date_start_planned' => array('type'=>'datetime', 'label'=>'DateStartPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>55, 'notnull'=>-1, 'index'=>1, 'help'=>'KeepEmptyForAsap', 'alwayseditable'=>1),
|
||||
'date_end_planned' => array('type'=>'datetime', 'label'=>'DateEndPlannedMo', 'enabled'=>1, 'visible'=>1, 'position'=>56, 'notnull'=>-1, 'index'=>1, 'alwayseditable'=>1),
|
||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
||||
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '9'=>'Canceled')),
|
||||
@ -613,11 +613,9 @@ class Mo extends CommonObject
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs');
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
setEventMessages($this->error, $this->errors, 'errors');
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
@ -636,8 +634,9 @@ class Mo extends CommonObject
|
||||
$role = "";
|
||||
|
||||
if ($this->status != self::STATUS_DRAFT) {
|
||||
$this->error = 'BadStatus';
|
||||
return -1;
|
||||
//$this->error = 'BadStatusForUpdateProduction';
|
||||
//return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
@ -136,7 +136,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
$triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
//Create MO with Childs
|
||||
// Create MO with Childs
|
||||
if ($action == 'add' && empty($id) && !empty($TBomLineId)) {
|
||||
$noback = 1;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
@ -165,7 +165,7 @@ if (empty($reshook)) {
|
||||
$res = $object->add_object_linked('mo', $mo_parent->id);
|
||||
}
|
||||
|
||||
header("Location: ".dol_buildpath('/mrp/mo_card.php?id='.$moline->fk_mo, 1));
|
||||
header("Location: ".dol_buildpath('/mrp/mo_card.php?id='.((int) $moline->fk_mo), 1));
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -183,7 +183,7 @@ div#topmenu-quickadd-dropdown a::after, div#topmenu-bookmark-dropdown a::after {
|
||||
border-top-left-radius: 0;
|
||||
padding: 1px 0 0 0;
|
||||
border-top-width: 0;
|
||||
width: 300px;
|
||||
width: 360px;
|
||||
}
|
||||
.topnav .user-menu .dropdown-menu {
|
||||
top: 50px;
|
||||
@ -522,6 +522,9 @@ div.quickaddblock:focus {
|
||||
max-width: 360px;
|
||||
}
|
||||
|
||||
.side-nav-vert .user-menu .dropdown-menu, .topnav .user-menu .dropdown-menu {
|
||||
width: 300px;
|
||||
}
|
||||
.dropdown-menu {
|
||||
border: none;
|
||||
-webkit-box-shadow: none;
|
||||
|
||||
@ -1000,18 +1000,18 @@ if ($action == 'create' || $action == 'adduserldap') {
|
||||
print '<td>';
|
||||
$valuetoshow = '';
|
||||
if (preg_match('/ldap/', $dolibarr_main_authentication)) {
|
||||
$valuetoshow .= ($valuetoshow ? ', ' : '').$langs->trans("PasswordOfUserInLDAP");
|
||||
$valuetoshow .= ($valuetoshow ? ' + ' : '').$langs->trans("PasswordOfUserInLDAP").' (hidden)';
|
||||
}
|
||||
if (preg_match('/http/', $dolibarr_main_authentication)) {
|
||||
$valuetoshow .= ($valuetoshow ? ', ' : '').$langs->trans("HTTPBasicPassword");
|
||||
$valuetoshow .= ($valuetoshow ? ' + ' : '').$langs->trans("HTTPBasicPassword");
|
||||
}
|
||||
if (preg_match('/dolibarr/', $dolibarr_main_authentication)) {
|
||||
if (!empty($ldap_pass)) { // For very old system comaptibilty. Now clear password can't be viewed from LDAP read
|
||||
$valuetoshow .= ($valuetoshow ? ', ' : '').'<input type="hidden" name="password" value="'.dol_escape_htmltag($ldap_pass).'">'; // Dolibarr password is preffiled with LDAP known password
|
||||
$valuetoshow .= ($valuetoshow ? ' + ' : '').'<input type="hidden" name="password" value="'.dol_escape_htmltag($ldap_pass).'">'; // Dolibarr password is preffiled with LDAP known password
|
||||
$valuetoshow .= preg_replace('/./i', '*', $ldap_pass);
|
||||
} else {
|
||||
// We do not use a field password but a field text to show new password to use.
|
||||
$valuetoshow .= ($valuetoshow ? ', ' : '').'<input maxsize="32" type="text" name="password" value="'.dol_escape_htmltag($password).'" autocomplete="new-password">';
|
||||
$valuetoshow .= ($valuetoshow ? ' + '.$langs->trans("DolibarrPassword") : '').'<input maxsize="32" type="text" name="password" value="'.dol_escape_htmltag($password).'" autocomplete="new-password">';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -127,7 +127,7 @@ if ($id > 0) {
|
||||
$langs->load("errors");
|
||||
print '<span class="error">'.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("ClickToDial")).'</span>';
|
||||
} else {
|
||||
print ' '.$form->textwithpicto($langs->trans("KeepEmptyToUseDefault").': '.$conf->global->CLICKTODIAL_URL, $langs->trans("ClickToDialUrlDesc"));
|
||||
print '<br>'.$form->textwithpicto('<span class="opacitymedium">'.$langs->trans("KeepEmptyToUseDefault").'</span>:<br>'.$conf->global->CLICKTODIAL_URL, $langs->trans("ClickToDialUrlDesc"));
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -154,7 +154,7 @@ if ($id > 0) {
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
if (!empty($user->admin)) {
|
||||
print '<tr><td class="titlefield">ClickToDial URL</td>';
|
||||
print '<tr><td class="">ClickToDial URL</td>';
|
||||
print '<td class="valeur">';
|
||||
if (!empty($conf->global->CLICKTODIAL_URL)) {
|
||||
$url = $conf->global->CLICKTODIAL_URL;
|
||||
@ -172,7 +172,7 @@ if ($id > 0) {
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print '<tr><td class="titlefield">ClickToDial '.$langs->trans("IdPhoneCaller").'</td>';
|
||||
print '<tr><td class="">ClickToDial '.$langs->trans("IdPhoneCaller").'</td>';
|
||||
print '<td class="valeur">'.(!empty($object->clicktodial_poste) ? $object->clicktodial_poste : '').'</td>';
|
||||
print "</tr>";
|
||||
|
||||
|
||||
@ -108,7 +108,7 @@ dol_banner_tab($object, 'id', $linkback, (!empty($user->rights->user->user->lire
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Name (already in dol_banner, we keep it to have the GlobalGroup picto, but we should move it in dol_banner)
|
||||
if (!empty($conf->mutlicompany->enabled)) {
|
||||
|
||||
@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/zapier/class/hook.class.php';
|
||||
* @access protected
|
||||
* @class DolibarrApiAccess {@requires user,external}
|
||||
*/
|
||||
class ZapierApi extends DolibarrApi
|
||||
class Zapier extends DolibarrApi
|
||||
{
|
||||
/**
|
||||
* @var array $FIELDS Mandatory fields, checked when create and update object
|
||||
|
||||
Loading…
Reference in New Issue
Block a user