mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
946239dbf3
File diff suppressed because one or more lines are too long
|
|
@ -133,7 +133,7 @@ print "</tr>\n";
|
|||
// DN pour les groupes
|
||||
print '<!-- LDAP_GROUP_DN -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPGroupDn").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="group" value="'.$conf->global->LDAP_GROUP_DN.'">';
|
||||
print '<input size="48" type="text" name="group" value="'.getDolGlobalString('LDAP_GROUP_DN').'">';
|
||||
print '</td><td>'.$langs->trans("LDAPGroupDnExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
|
@ -141,7 +141,7 @@ print '</tr>';
|
|||
// List of object class used to define attributes in structure
|
||||
print '<!-- LDAP_GROUP_OBJECT_CLASS -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPGroupObjectClassList").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_GROUP_OBJECT_CLASS.'">';
|
||||
print '<input size="48" type="text" name="objectclass" value="'.getDolGlobalString('LDAP_GROUP_OBJECT_CLASS').'">';
|
||||
print '</td><td>'.$langs->trans("LDAPGroupObjectClassListExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
|
@ -149,7 +149,7 @@ print '</tr>';
|
|||
// Filter, used to filter search
|
||||
print '<!-- LDAP_GROUP_FILTER -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
|
||||
print '<input size="48" type="text" name="filter" value="'.$conf->global->LDAP_GROUP_FILTER.'">';
|
||||
print '<input size="48" type="text" name="filter" value="'.getDolGlobalString('LDAP_GROUP_FILTER').'">';
|
||||
print '</td><td>'.$langs->trans("LDAPGroupFilterExample").'</td>';
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
|
@ -170,9 +170,9 @@ print "</tr>\n";
|
|||
|
||||
// Common name
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldName").'</td><td>';
|
||||
print '<input size="25" type="text" name="fieldfullname" value="'.$conf->global->LDAP_GROUP_FIELD_FULLNAME.'">';
|
||||
print '<input size="25" type="text" name="fieldfullname" value="'.getDolGlobalString('LDAP_GROUP_FIELD_FULLNAME').'">';
|
||||
print '</td><td>'.$langs->trans("LDAPFieldCommonNameExample").'</td>';
|
||||
print '<td class="right"><input type="radio" name="key" value="LDAP_GROUP_FIELD_FULLNAME"'.(($conf->global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS == $conf->global->LDAP_GROUP_FIELD_FULLNAME) ? ' checked' : '')."></td>";
|
||||
print '<td class="right"><input type="radio" name="key" value="LDAP_GROUP_FIELD_FULLNAME"'.((getDolGlobalString('LDAP_KEY_GROUPS') == getDolGlobalString('LDAP_GROUP_FIELD_FULLNAME')) ? ' checked' : '')."></td>";
|
||||
print '</tr>';
|
||||
|
||||
// Name
|
||||
|
|
@ -186,21 +186,21 @@ print '</tr>';
|
|||
|
||||
// Description
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldDescription").'</td><td>';
|
||||
print '<input size="25" type="text" name="fielddescription" value="'.$conf->global->LDAP_GROUP_FIELD_DESCRIPTION.'">';
|
||||
print '<input size="25" type="text" name="fielddescription" value="'.getDolGlobalString('LDAP_GROUP_FIELD_DESCRIPTION').'">';
|
||||
print '</td><td>'.$langs->trans("LDAPFieldDescriptionExample").'</td>';
|
||||
print '<td class="right"><input type="radio" name="key" value="LDAP_GROUP_FIELD_DESCRIPTION"'.(($conf->global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS == $conf->global->LDAP_GROUP_FIELD_DESCRIPTION) ? ' checked' : '')."></td>";
|
||||
print '<td class="right"><input type="radio" name="key" value="LDAP_GROUP_FIELD_DESCRIPTION"'.((getDolGlobalString('LDAP_KEY_GROUPS') == getDolGlobalString('LDAP_GROUP_FIELD_DESCRIPTION')) ? ' checked' : '')."></td>";
|
||||
print '</tr>';
|
||||
|
||||
// User group
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldGroupMembers").'</td><td>';
|
||||
print '<input size="25" type="text" name="fieldgroupmembers" value="'.$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS.'">';
|
||||
print '<input size="25" type="text" name="fieldgroupmembers" value="'.getDolGlobalString('LDAP_GROUP_FIELD_GROUPMEMBERS').'">';
|
||||
print '</td><td>'.$langs->trans("LDAPFieldGroupMembersExample").'</td>';
|
||||
print '<td class="right"><input type="radio" name="key" value="LDAP_GROUP_FIELD_GROUPMEMBERS"'.(($conf->global->LDAP_KEY_GROUPS && $conf->global->LDAP_KEY_GROUPS == $conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS) ? ' checked' : '')."></td>";
|
||||
print '<td class="right"><input type="radio" name="key" value="LDAP_GROUP_FIELD_GROUPMEMBERS"'.((getDolGlobalString('LDAP_KEY_GROUPS') == getDolGlobalString('LDAP_GROUP_FIELD_GROUPMEMBERS')) ? ' checked' : '')."></td>";
|
||||
print '</tr>';
|
||||
|
||||
// Group id
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldGroupid").'</td><td>';
|
||||
print '<input size="25" type="text" name="fieldgroupid" value="'.$conf->global->LDAP_GROUP_FIELD_GROUPID.'">';
|
||||
print '<input size="25" type="text" name="fieldgroupid" value="'.getDolGlobalString('LDAP_GROUP_FIELD_GROUPID').'">';
|
||||
print '</td><td>'.$langs->trans("LDAPFieldGroupidExample").'</td>';
|
||||
print '<td class="right"> </td>';
|
||||
print '</tr>';
|
||||
|
|
@ -222,17 +222,17 @@ print '</form>';
|
|||
if (getDolGlobalInt('LDAP_SYNCHRO_ACTIVE') === Ldap::SYNCHRO_DOLIBARR_TO_LDAP) {
|
||||
$butlabel = $langs->trans("LDAPTestSynchroGroup");
|
||||
$testlabel = 'testgroup';
|
||||
$key = $conf->global->LDAP_KEY_GROUPS;
|
||||
$dn = $conf->global->LDAP_GROUP_DN;
|
||||
$objectclass = $conf->global->LDAP_GROUP_OBJECT_CLASS;
|
||||
$key = getDolGlobalString('LDAP_KEY_GROUPS');
|
||||
$dn = getDolGlobalString('LDAP_GROUP_DN');
|
||||
$objectclass = getDolGlobalString('LDAP_GROUP_OBJECT_CLASS');
|
||||
|
||||
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
|
||||
} elseif (getDolGlobalInt('LDAP_SYNCHRO_ACTIVE') === Ldap::SYNCHRO_LDAP_TO_DOLIBARR) {
|
||||
$butlabel = $langs->trans("LDAPTestSearch");
|
||||
$testlabel = 'testsearchgroup';
|
||||
$key = $conf->global->LDAP_KEY_GROUPS;
|
||||
$dn = $conf->global->LDAP_GROUP_DN;
|
||||
$objectclass = $conf->global->LDAP_GROUP_OBJECT_CLASS;
|
||||
$key = getDolGlobalString('LDAP_KEY_GROUPS');
|
||||
$dn = getDolGlobalString('LDAP_GROUP_DN');
|
||||
$objectclass = getDolGlobalString('LDAP_GROUP_OBJECT_CLASS');
|
||||
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
|
||||
}
|
||||
|
||||
|
|
@ -292,18 +292,18 @@ if (function_exists("ldap_connect")) {
|
|||
|
||||
if ($result > 0) {
|
||||
$required_fields = array(
|
||||
$conf->global->LDAP_KEY_GROUPS,
|
||||
// $conf->global->LDAP_GROUP_FIELD_NAME,
|
||||
$conf->global->LDAP_GROUP_FIELD_DESCRIPTION,
|
||||
$conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS,
|
||||
$conf->global->LDAP_GROUP_FIELD_GROUPID
|
||||
getDolGlobalString('LDAP_KEY_GROUPS'),
|
||||
// getDolGlobalString('LDAP_GROUP_FIELD_NAME'),
|
||||
getDolGlobalString('LDAP_GROUP_FIELD_DESCRIPTION'),
|
||||
getDolGlobalString('LDAP_GROUP_FIELD_GROUPMEMBERS'),
|
||||
getDolGlobalString('LDAP_GROUP_FIELD_GROUPID')
|
||||
);
|
||||
|
||||
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
|
||||
$required_fields = array_unique(array_values(array_filter($required_fields, "dol_validElement")));
|
||||
|
||||
// Get from LDAP database an array of results
|
||||
$ldapgroups = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_GROUPS, $required_fields, 'group');
|
||||
$ldapgroups = $ldap->getRecords('*', getDolGlobalString('LDAP_GROUP_DN'), getDolGlobalString('LDAP_KEY_GROUPS'), $required_fields, 'group');
|
||||
//$ldapgroups = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_GROUPS, '', 'group');
|
||||
|
||||
if (is_array($ldapgroups)) {
|
||||
|
|
@ -325,8 +325,8 @@ if (function_exists("ldap_connect")) {
|
|||
print "<br>\n";
|
||||
print "LDAP search for group:<br>\n";
|
||||
print "search: *<br>\n";
|
||||
print "userDN: ".$conf->global->LDAP_GROUP_DN."<br>\n";
|
||||
print "useridentifier: ".$conf->global->LDAP_KEY_GROUPS."<br>\n";
|
||||
print "userDN: ".getDolGlobalString('LDAP_GROUP_DN')."<br>\n";
|
||||
print "useridentifier: ".getDolGlobalString('LDAP_KEY_GROUPS')."<br>\n";
|
||||
print "required_fields: ".implode(',', $required_fields)."<br>\n";
|
||||
print "=> ".count($liste)." records<br>\n";
|
||||
print "\n<br>";
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ if ($action == 'add') {
|
|||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."overwrite_trans(lang, transkey, transvalue, entity) VALUES ('".$db->escape($langcode)."','".$db->escape($transkey)."','".$db->escape($transvalue)."', ".((int) $conf->entity).")";
|
||||
$result = $db->query($sql);
|
||||
if ($result > 0) {
|
||||
if ($result) {
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
|
||||
$action = "";
|
||||
|
|
@ -177,7 +177,7 @@ if ($action == 'add') {
|
|||
if ($action == 'delete') {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."overwrite_trans WHERE rowid = ".((int) $id);
|
||||
$result = $db->query($sql);
|
||||
if ($result >= 0) {
|
||||
if ($result) {
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
|
|
@ -297,7 +297,7 @@ foreach ($modulesdir as $keydir => $tmpsearchdir) {
|
|||
|
||||
$result = $newlang->load($langkey, 0, 0, '', 0); // Load translation files + database overwrite
|
||||
$result = $newlangfileonly->load($langkey, 0, 0, '', 1); // Load translation files only
|
||||
if ($result < 0) {
|
||||
if (!$result) {
|
||||
print 'Failed to load language file '.$tmpfile.'<br>'."\n";
|
||||
} else {
|
||||
$listoffiles[$langkey] = $tmpfile;
|
||||
|
|
|
|||
|
|
@ -1040,7 +1040,8 @@ if (empty($reshook)) {
|
|||
}
|
||||
}
|
||||
|
||||
if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
|
||||
$propal_qty_requirement = (!empty($conf->global->PROPAL_ENABLE_NEGATIVE_QTY) ? ($qty >= 0 || $qty <= 0) : $qty >= 0);
|
||||
if (!$error && $propal_qty_requirement && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
|
||||
$pu_ht = 0;
|
||||
$pu_ttc = 0;
|
||||
$pu_ht_devise = 0;
|
||||
|
|
|
|||
|
|
@ -3420,6 +3420,7 @@ class Facture extends CommonInvoice
|
|||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->error = $mouvP->error;
|
||||
$this->errors = $mouvP->errors;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -3438,6 +3439,7 @@ class Facture extends CommonInvoice
|
|||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->error = $mouvP->error;
|
||||
$this->errors = $mouvP->errors;
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
|
|
@ -3456,6 +3458,7 @@ class Facture extends CommonInvoice
|
|||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->error = $mouvP->error;
|
||||
$this->errors = $mouvP->errors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ if (($action == 'send' || $action == 'relance') && !GETPOST('addfile') && !GETPO
|
|||
$action = 'presend';
|
||||
} else {
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result) {
|
||||
if ($result >= 0) {
|
||||
// Initialisation of datas of object to call trigger
|
||||
if (is_object($object)) {
|
||||
if (empty($actiontypecode)) {
|
||||
|
|
|
|||
|
|
@ -393,15 +393,15 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
}
|
||||
if ($nbofgraph == 2) {
|
||||
$stringtoshow .= '<div class="fichecenter"><div class="containercenter"><div class="fichehalfleft">';
|
||||
if ($showpropalnb) {
|
||||
if (isModEnabled('propal') && $showpropalnb) {
|
||||
$stringtoshow .= $px2->show();
|
||||
} elseif ($showordernb) {
|
||||
} elseif (isModEnabled('commande') && $showordernb) {
|
||||
$stringtoshow .= $px3->show();
|
||||
}
|
||||
$stringtoshow .= '</div><div class="fichehalfright">';
|
||||
if ($showinvoicenb) {
|
||||
if (isModEnabled('facture') && $showinvoicenb) {
|
||||
$stringtoshow .= $px1->show();
|
||||
} elseif ($showordernb) {
|
||||
} elseif (isModEnabled('commande') && $showordernb) {
|
||||
$stringtoshow .= $px3->show();
|
||||
}
|
||||
$stringtoshow .= '</div></div></div>';
|
||||
|
|
|
|||
|
|
@ -9539,7 +9539,12 @@ abstract class CommonObject
|
|||
$line = (object) $line;
|
||||
}
|
||||
|
||||
$result = $line->create($user, 1);
|
||||
$result = 0;
|
||||
if (method_exists($line, 'insert')) {
|
||||
$result = $line->insert($user, 1);
|
||||
} elseif (method_exists($line, 'create')) {
|
||||
$result = $line->create($user, 1);
|
||||
}
|
||||
if ($result < 0) {
|
||||
$this->error = $line->error;
|
||||
$this->db->rollback();
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ function dolEncrypt($chain, $key = '', $ciphering = 'AES-256-CTR', $forceseed =
|
|||
* Decode a string with a symetric encryption. Used to decrypt sensitive data saved into database.
|
||||
* Note: If a backup is restored onto another instance with a different $conf->file->instance_unique_id, then decoded value will differ.
|
||||
*
|
||||
* @param string $chain string to encode
|
||||
* @param string $chain string to decode
|
||||
* @param string $key If '', we use $conf->file->instance_unique_id
|
||||
* @return string encoded string
|
||||
* @since v17
|
||||
|
|
@ -188,8 +188,10 @@ function dolDecrypt($chain, $key = '')
|
|||
|
||||
if (empty($key)) {
|
||||
if (!empty($conf->file->dolcrypt_key)) {
|
||||
// If dolcrypt_key is defined, we used it in priority
|
||||
$key = $conf->file->dolcrypt_key;
|
||||
} else {
|
||||
// We fall back on the instance_unique_id
|
||||
$key = $conf->file->instance_unique_id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
|||
if ($result > 0 && !empty($object->context['newgroupid'])) { // We are in context of adding a new group to user
|
||||
$usergroup = new UserGroup($this->db);
|
||||
|
||||
$usergroup->fetch($object->context['newgroupid']);
|
||||
$usergroup->fetch($object->context['newgroupid'], '', true);
|
||||
|
||||
$oldinfo = $usergroup->_load_ldap_info();
|
||||
$olddn = $usergroup->_load_ldap_dn($oldinfo);
|
||||
|
|
@ -156,7 +156,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
|||
if ($result > 0 && !empty($object->context['oldgroupid'])) { // We are in context of removing a group from user
|
||||
$usergroup = new UserGroup($this->db);
|
||||
|
||||
$usergroup->fetch($object->context['oldgroupid']);
|
||||
$usergroup->fetch($object->context['oldgroupid'], '', true);
|
||||
|
||||
$oldinfo = $usergroup->_load_ldap_info();
|
||||
$olddn = $usergroup->_load_ldap_dn($oldinfo);
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class Position extends CommonObject
|
|||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
|
||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
|
||||
'fk_contrat' => array('type'=>'integer:Contrat:contrat/class/contrat.class.php', 'label'=>'fk_contrat', 'enabled'=>'isModEnabled("contract")', 'position'=>50, 'notnull'=>0, 'visible'=>0,),
|
||||
'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Employee', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'default'=>0),
|
||||
'fk_user' => array('type'=>'integer:User:user/class/user.class.php:0:(t.statut:=:1)', 'label'=>'Employee', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'default'=>0),
|
||||
'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobProfile', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,),
|
||||
'date_start' => array('type'=>'date', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>101, 'notnull'=>1, 'visible'=>1,),
|
||||
'date_end' => array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>102, 'notnull'=>0, 'visible'=>1,),
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ MRP_MO_PRODUCEDInDolibarr=MO produced
|
|||
MRP_MO_DELETEInDolibarr=MO deleted
|
||||
MRP_MO_CANCELInDolibarr=MO canceled
|
||||
PAIDInDolibarr=%s paid
|
||||
ENABLEDISABLEInDolibarr=User enabled or disabled
|
||||
##### End agenda events #####
|
||||
AgendaModelModule=Document templates for event
|
||||
DateActionStart=Start date
|
||||
|
|
|
|||
|
|
@ -67,16 +67,16 @@ print '<script type="text/javascript">
|
|||
init_price();
|
||||
});
|
||||
jQuery("#nbpiece").keyup(function(event) {
|
||||
console.log("We enter a qty on "+event.which);
|
||||
if ( event.which == 54 ) { /* char - */
|
||||
console.log("We enter a qty on "+event.key);
|
||||
if ( event.key == "-" ) { /* char - */
|
||||
console.log("We set direction to value 1");
|
||||
jQuery("#nbpiece").val(jQuery("#nbpiece").val().replace("-", ""));
|
||||
|
||||
jQuery("#mouvement option").removeAttr("selected").change();
|
||||
jQuery("#mouvement option[value=1]").attr("selected","selected").trigger("change");
|
||||
jQuery("#mouvement").trigger("change");
|
||||
} else if ( event.which == 187 ) { /* char + */
|
||||
} else if ( event.key == "+" ) { /* char + */
|
||||
console.log("We set direction to value 0");
|
||||
jQuery("#nbpiece").val(jQuery("#nbpiece").val().replace("+", ""));
|
||||
jQuery("#mouvement option").removeAttr("selected").change();
|
||||
jQuery("#mouvement option[value=0]").attr("selected","selected").trigger("change");
|
||||
jQuery("#mouvement").trigger("change");
|
||||
|
|
|
|||
|
|
@ -277,7 +277,14 @@ if (isModEnabled('stock')) {
|
|||
$disabled = getDolGlobalString('CASHDESK_NO_DECREASE_STOCK'.$terminal);
|
||||
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskIdWareHouse").'</td>'; // Force warehouse (this is not a default value)
|
||||
print '<tr class="oddeven"><td>';
|
||||
if (!$disabled) { print '<span class="fieldrequired">'; }
|
||||
print $langs->trans("CashDeskIdWareHouse");
|
||||
if (!$disabled) { print '</span>'; }
|
||||
if (!getDolGlobalString('CASHDESK_ID_WAREHOUSE'.$terminal)) {
|
||||
print img_warning($langs->trans("DisableStockChange").' - '.$langs->trans("NoWarehouseDefinedForTerminal"));
|
||||
}
|
||||
print '</td>'; // Force warehouse (this is not a default value)
|
||||
print '<td class="minwidth300">';
|
||||
if (!$disabled) {
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
|
|
|
|||
|
|
@ -233,7 +233,12 @@ if (empty($reshook)) {
|
|||
dol_htmloutput_errors($langs->trans("NoLinesToBill", "TakePos"), null, 1);
|
||||
} elseif (isModEnabled('stock') && getDolGlobalString($constantforkey) != "1") {
|
||||
$savconst = $conf->global->STOCK_CALCULATE_ON_BILL;
|
||||
$conf->global->STOCK_CALCULATE_ON_BILL = 1;
|
||||
|
||||
if (isModEnabled('productbatch') && !getDolGlobalInt('CASHDESK_FORCE_DECREASE_STOCK')) {
|
||||
$conf->global->STOCK_CALCULATE_ON_BILL = 0; // To not change the stock (not yet compatible with batch management)
|
||||
} else {
|
||||
$conf->global->STOCK_CALCULATE_ON_BILL = 1; // To force the change of stock
|
||||
}
|
||||
|
||||
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
|
||||
dol_syslog("Validate invoice with stock change into warehouse defined into constant ".$constantforkey." = ".getDolGlobalString($constantforkey));
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
|||
<body>
|
||||
<?php
|
||||
|
||||
$usestripeterminals = 0;
|
||||
|
||||
if (isModEnabled('stripe')) {
|
||||
$service = 'StripeTest';
|
||||
$servicestatus = 0;
|
||||
|
|
@ -166,40 +168,41 @@ if ($invoiceid > 0) {
|
|||
|
||||
?>
|
||||
<script>
|
||||
<?php
|
||||
if ($invoice->type != $invoice::TYPE_CREDIT_NOTE) {
|
||||
if (!getDolGlobalString($keyforstripeterminalbank)) { ?>
|
||||
const config = {simulated: <?php if (empty($servicestatus) && !empty($conf->global->STRIPE_TERMINAL_SIMULATED)) { ?> true <?php } else { ?> false <?php } ?>
|
||||
<?php if (!empty($conf->global->STRIPE_LOCATION)) { ?>, location: '<?php echo $conf->global->STRIPE_LOCATION; ?>'<?php } ?>}
|
||||
terminal.discoverReaders(config).then(function(discoverResult) {
|
||||
if (discoverResult.error) {
|
||||
console.log('Failed to discover: ', discoverResult.error);
|
||||
} else if (discoverResult.discoveredReaders.length === 0) {
|
||||
console.log('No available readers.');
|
||||
} else {
|
||||
// You should show the list of discoveredReaders to the
|
||||
// cashier here and let them select which to connect to (see below).
|
||||
selectedReader = discoverResult.discoveredReaders[0];
|
||||
//console.log('terminal.discoverReaders', selectedReader); // only active for development
|
||||
|
||||
terminal.connectReader(selectedReader).then(function(connectResult) {
|
||||
if (connectResult.error) {
|
||||
document.getElementById("card-present-alert").innerHTML = '<div class="error">'+connectResult.error.message+'</div>';
|
||||
console.log('Failed to connect: ', connectResult.error);
|
||||
} else {
|
||||
document.getElementById("card-present-alert").innerHTML = '';
|
||||
console.log('Connected to reader: ', connectResult.reader.label);
|
||||
if (document.getElementById("StripeTerminal")) {
|
||||
document.getElementById("StripeTerminal").innerHTML = '<button type="button" class="calcbutton2" onclick="ValidateStripeTerminal();"><span class="fa fa-2x fa-credit-card iconwithlabel"></span><br>'+connectResult.reader.label+'</button>';
|
||||
}
|
||||
<?php
|
||||
if ($usestripeterminals && $invoice->type != $invoice::TYPE_CREDIT_NOTE) {
|
||||
if (!getDolGlobalString($keyforstripeterminalbank)) { ?>
|
||||
const config = {
|
||||
simulated: <?php if (empty($servicestatus) && !empty($conf->global->STRIPE_TERMINAL_SIMULATED)) { ?> true <?php } else { ?> false <?php } ?>
|
||||
<?php if (!empty($conf->global->STRIPE_LOCATION)) { ?>, location: '<?php echo $conf->global->STRIPE_LOCATION; ?>'<?php } ?>
|
||||
}
|
||||
});
|
||||
terminal.discoverReaders(config).then(function(discoverResult) {
|
||||
if (discoverResult.error) {
|
||||
console.log('Failed to discover: ', discoverResult.error);
|
||||
} else if (discoverResult.discoveredReaders.length === 0) {
|
||||
console.log('No available readers.');
|
||||
} else {
|
||||
// You should show the list of discoveredReaders to the
|
||||
// cashier here and let them select which to connect to (see below).
|
||||
selectedReader = discoverResult.discoveredReaders[0];
|
||||
//console.log('terminal.discoverReaders', selectedReader); // only active for development
|
||||
|
||||
}
|
||||
});
|
||||
<?php } else { ?>
|
||||
terminal.connectReader(selectedReader).then(function(connectResult) {
|
||||
if (connectResult.error) {
|
||||
document.getElementById("card-present-alert").innerHTML = '<div class="error">'+connectResult.error.message+'</div>';
|
||||
console.log('Failed to connect: ', connectResult.error);
|
||||
} else {
|
||||
document.getElementById("card-present-alert").innerHTML = '';
|
||||
console.log('Connected to reader: ', connectResult.reader.label);
|
||||
if (document.getElementById("StripeTerminal")) {
|
||||
document.getElementById("StripeTerminal").innerHTML = '<button type="button" class="calcbutton2" onclick="ValidateStripeTerminal();"><span class="fa fa-2x fa-credit-card iconwithlabel"></span><br>'+connectResult.reader.label+'</button>';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
<?php } else { ?>
|
||||
terminal.connectReader(<?php echo json_encode($stripe->getSelectedReader(getDolGlobalString($keyforstripeterminalbank), $stripeacc, $servicestatus)); ?>).then(function(connectResult) {
|
||||
if (connectResult.error) {
|
||||
if (connectResult.error) {
|
||||
document.getElementById("card-present-alert").innerHTML = '<div class="error clearboth">'+connectResult.error.message+'</div>';
|
||||
console.log('Failed to connect: ', connectResult.error);
|
||||
} else {
|
||||
|
|
@ -211,7 +214,7 @@ if ($invoiceid > 0) {
|
|||
}
|
||||
});
|
||||
|
||||
<?php } } ?>
|
||||
<?php } } ?>
|
||||
</script>
|
||||
<?php
|
||||
|
||||
|
|
@ -329,6 +332,8 @@ if (getDolGlobalInt('TAKEPOS_NUMPAD') == 0) {
|
|||
|
||||
function Validate(payment)
|
||||
{
|
||||
console.log("Launch Validate");
|
||||
|
||||
var invoiceid = <?php echo ($invoiceid > 0 ? $invoiceid : 0); ?>;
|
||||
var accountid = $("#selectaccountid").val();
|
||||
var amountpayed = $("#change1").val();
|
||||
|
|
|
|||
|
|
@ -790,7 +790,11 @@ if ($object->id > 0) {
|
|||
$person_name = !empty($object->firstname) ? $object->lastname.", ".$object->firstname : $object->lastname;
|
||||
$title = $person_name." - ".$langs->trans('Card');
|
||||
} else {
|
||||
$title = $langs->trans("NewUser");
|
||||
if (GETPOST('employee', 'alphanohtml')) {
|
||||
$title = $langs->trans("NewEmployee");
|
||||
} else {
|
||||
$title = $langs->trans("NewUser");
|
||||
}
|
||||
}
|
||||
$help_url = '';
|
||||
|
||||
|
|
@ -798,7 +802,7 @@ llxHeader('', $title, $help_url);
|
|||
|
||||
|
||||
if ($action == 'create' || $action == 'adduserldap') {
|
||||
print load_fiche_titre($langs->trans("NewUser"), '', 'user');
|
||||
print load_fiche_titre($title, '', 'user');
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("CreateInternalUserDesc")."</span><br>\n";
|
||||
print "<br>";
|
||||
|
|
|
|||
|
|
@ -1383,6 +1383,11 @@ class User extends CommonObject
|
|||
|
||||
dol_syslog(get_class($this)."::setstatus", LOG_DEBUG);
|
||||
if ($result) {
|
||||
if ($status == 0) {
|
||||
$this->context['actionmsg'] = 'User '.$this->login.' disabled';
|
||||
} else {
|
||||
$this->context['actionmsg'] = 'User '.$this->login.' enabled';
|
||||
}
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('USER_ENABLEDISABLE', $user);
|
||||
if ($result < 0) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ if ($user->socid > 0) {
|
|||
}
|
||||
|
||||
$object = new UserGroup($db);
|
||||
$object->fetch($id);
|
||||
$object->fetch($id, '', true);
|
||||
$object->getrights();
|
||||
|
||||
// Users/Groups management only in master entity if transverse mode
|
||||
|
|
@ -69,7 +69,7 @@ if ($action == 'dolibarr2ldap') {
|
|||
$info = $object->_load_ldap_info();
|
||||
|
||||
// Get a gid number for objectclass PosixGroup if none was provided
|
||||
if (empty($info[$conf->global->LDAP_GROUP_FIELD_GROUPID]) && in_array('posixGroup', $info['objectclass'])) {
|
||||
if (empty($info[getDolGlobalString('LDAP_GROUP_FIELD_GROUPID')]) && in_array('posixGroup', $info['objectclass'])) {
|
||||
$info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user