Merge branch 'develop' of github.com:Dolibarr/dolibarr into dev_EventOrganisation

This commit is contained in:
Florian HENRY 2021-03-23 21:05:11 +01:00
commit d043c8f4ba
31 changed files with 112 additions and 210 deletions

View File

@ -246,11 +246,11 @@ if (strlen(trim($search_country))) {
if ($search_country == 'special_allnotme') {
$sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
} elseif ($search_country == 'special_eec') {
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC).")";
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC, 1).")";
} elseif ($search_country == 'special_eecnotme') {
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC_without_me).")";
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC_without_me, 1).")";
} elseif ($search_country == 'special_noteec') {
$sql .= " AND co.code NOT IN (".$db->sanitize($country_code_in_EEC).")";
$sql .= " AND co.code NOT IN (".$db->sanitize($country_code_in_EEC, 1).")";
} else {
$sql .= natural_search("co.code", $search_country);
}

View File

@ -283,11 +283,11 @@ if (strlen(trim($search_country))) {
if ($search_country == 'special_allnotme') {
$sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
} elseif ($search_country == 'special_eec') {
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC).")";
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC, 1).")";
} elseif ($search_country == 'special_eecnotme') {
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC_without_me).")";
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC_without_me, 1).")";
} elseif ($search_country == 'special_noteec') {
$sql .= " AND co.code NOT IN (".$db->sanitize($country_code_in_EEC).")";
$sql .= " AND co.code NOT IN (".$db->sanitize($country_code_in_EEC, 1).")";
} else {
$sql .= natural_search("co.code", $search_country);
}

View File

@ -238,11 +238,11 @@ if (strlen(trim($search_country))) {
if ($search_country == 'special_allnotme') {
$sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
} elseif ($search_country == 'special_eec') {
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC).")";
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC, 1).")";
} elseif ($search_country == 'special_eecnotme') {
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC_without_me).")";
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC_without_me, 1).")";
} elseif ($search_country == 'special_noteec') {
$sql .= " AND co.code NOT IN (".$db->sanitize($country_code_in_EEC).")";
$sql .= " AND co.code NOT IN (".$db->sanitize($country_code_in_EEC, 1).")";
} else {
$sql .= natural_search("co.code", $search_country);
}

View File

@ -288,11 +288,11 @@ if (strlen(trim($search_country))) {
if ($search_country == 'special_allnotme') {
$sql .= " AND co.code <> '".$db->escape($mysoc->country_code)."'";
} elseif ($search_country == 'special_eec') {
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC).")";
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC, 1).")";
} elseif ($search_country == 'special_eecnotme') {
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC_without_me).")";
$sql .= " AND co.code IN (".$db->sanitize($country_code_in_EEC_without_me, 1).")";
} elseif ($search_country == 'special_noteec') {
$sql .= " AND co.code NOT IN (".$db->sanitize($country_code_in_EEC).")";
$sql .= " AND co.code NOT IN (".$db->sanitize($country_code_in_EEC, 1).")";
} else {
$sql .= natural_search("co.code", $search_country);
}

View File

@ -86,7 +86,7 @@ if ($id > 0 || !empty($ref)) {
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
/*

View File

@ -76,7 +76,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
$result = restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
$permissionnote = $user->rights->bom->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->bom->write; // Used by the include of actions_dellink.inc.php

View File

@ -83,7 +83,7 @@ if ($id > 0 || !empty($ref)) {
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
/*

View File

@ -63,7 +63,7 @@ $permissionnote = $user->rights->bom->write; // Used by the include of actions_s
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'bom', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
/*

View File

@ -59,15 +59,52 @@ top_httphead();
print '<!-- Ajax page called with url '.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.dol_escape_htmltag($_SERVER["QUERY_STRING"]).' -->'."\n";
// Registering the location of boxes
if (GETPOST('roworder', 'alpha') && GETPOST('table_element_line', 'alpha', 2)
&& GETPOST('fk_element', 'alpha', 2) && GETPOST('element_id', 'int', 2)) {
if (GETPOST('roworder', 'alpha', 2) && GETPOST('table_element_line', 'aZ09', 2)
&& GETPOST('fk_element', 'aZ09', 2) && GETPOST('element_id', 'int', 2)) {
$roworder = GETPOST('roworder', 'alpha', 2);
$table_element_line = GETPOST('table_element_line', 'alpha', 2);
$fk_element = GETPOST('fk_element', 'alpha', 2);
$table_element_line = GETPOST('table_element_line', 'aZ09', 2);
$fk_element = GETPOST('fk_element', 'aZ09', 2);
$element_id = GETPOST('element_id', 'int', 2);
dol_syslog("AjaxRow roworder=".$roworder." table_element_line=".$table_element_line." fk_element=".$fk_element." element_id=".$element_id, LOG_DEBUG);
// Make test on pemrission
$perm = 0;
if ($table_element_line == 'propaldet' && $user->rights->propal->creer) {
$perm = 1;
} elseif ($table_element_line == 'commandedet' && $user->rights->commande->creer) {
$perm = 1;
} elseif ($table_element_line == 'facturedet' && $user->rights->facture->creer) {
$perm = 1;
} elseif ($table_element_line == 'facturerecdet' && $user->rights->facture->creer) {
$perm = 1;
} elseif ($table_element_line == 'ecm_files' && $user->rights->ecm->creer) {
$perm = 1;
} elseif ($table_element_line == 'emailcollector_emailcollectoraction' && $user->admin) {
$perm = 1;
} elseif ($table_element_line == 'bom_bomline' && $user->rights->bom->write) {
$perm = 1;
} elseif ($table_element_line == 'mrp_production' && $user->rights->mrp->write) {
$perm = 1;
} elseif ($table_element_line == 'supplier_proposaldet' && $user->rights->supplier_proposal->write) {
$perm = 1;
} elseif ($table_element_line == 'commande_fournisseurdet' && $user->rights->fourn->commande->creer) {
$perm = 1;
} elseif ($table_element_line == 'facture_fourn_det' && $user->rights->fourn->facture->creer) {
$perm = 1;
} else {
$tmparray = explode('_', $table_element_line);
$tmpmodule = $tmparray[0]; $tmpobject = preg_replace('/line$/', '', $tmparray[1]);
if (!empty($tmpmodule) && !empty($tmpobject) && !empty($conf->$tmpmodule->enabled) && !empty($user->rights->$tmpobject->read)) {
$perm = 1;
}
}
if (! $perm) {
print 'Bad permission to modify position of lines for object in table '.$table_element_line;
accessforbidden('Bad permission to modify position of lines for object in table '.$table_element_line);
}
$rowordertab = explode(',', $roworder);
$newrowordertab = array();
foreach ($rowordertab as $value) {
@ -88,4 +125,6 @@ if (GETPOST('roworder', 'alpha') && GETPOST('table_element_line', 'alpha', 2)
if (in_array($fk_element, array('fk_facture', 'fk_propal', 'fk_commande'))) {
$result = $row->line_order(true);
}
} else {
print 'Bad parameters for row.php';
}

View File

@ -3022,8 +3022,8 @@ abstract class CommonObject
$fieldposition = 'position';
}
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.$rang;
$sql .= ' WHERE rowid = '.$rowid;
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element_line.' SET '.$fieldposition.' = '.((int) $rang);
$sql .= ' WHERE rowid = '.((int) $rowid);
dol_syslog(get_class($this)."::updateRangOfLine", LOG_DEBUG);
if (!$this->db->query($sql)) {

View File

@ -4381,9 +4381,9 @@ class Form
while ($i < $num) {
$obj = $this->db->fetch_object($result);
if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected))) {
$out .= '<option value="'.$obj->rowid.'" selected>';
$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'" selected>';
} else {
$out .= '<option value="'.$obj->rowid.'">';
$out .= '<option value="'.$obj->rowid.'" data-currency-code="'.$obj->currency_code.'">';
}
$out .= trim($obj->label);
if ($showcurrency) {
@ -5676,7 +5676,7 @@ class Form
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.fk_pays = c.rowid";
$sql .= " AND t.active > 0";
$sql .= " AND c.code IN (".$this->db->sanitize($country_code).")";
$sql .= " AND c.code IN (".$this->db->sanitize($country_code, 1).")";
$sql .= " ORDER BY t.code ASC, t.taux ASC, t.recuperableonly ASC";
$resql = $this->db->query($sql);
@ -5759,6 +5759,7 @@ class Form
$defaultnpr = (preg_match('/\*/', $selectedrate) ? 1 : $defaultnpr);
$defaulttx = str_replace('*', '', $selectedrate);
$defaultcode = '';
$reg = array();
if (preg_match('/\((.*)\)/', $defaulttx, $reg)) {
$defaultcode = $reg[1];
$defaulttx = preg_replace('/\s*\(.*\)/', '', $defaulttx);

View File

@ -205,7 +205,7 @@ class FormFile
$out .= ' ';
if ($sectionid) { // Show overwrite if exists for ECM module only
$langs->load('link');
$out .= '<input style="margin-right: 2px;" type="checkbox" id="overwritefile" name="overwritefile" value="1"><label for="overwritefile">'.$langs->trans("OverwriteIfExists").'</label>';
$out .= '<span class="nowraponsmartphone"><input style="margin-right: 2px;" type="checkbox" id="overwritefile" name="overwritefile" value="1"><label for="overwritefile">'.$langs->trans("OverwriteIfExists").'</label></span>';
}
$out .= '<input type="submit" class="button reposition" name="sendit" value="'.$langs->trans("Upload").'"';
$out .= (empty($conf->global->MAIN_UPLOAD_DOC) || empty($perm) ? ' disabled' : '');

View File

@ -2726,16 +2726,15 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$original_file = $conf->bank->dir_output.'/'.$original_file;
} elseif ($modulepart == 'export' && !empty($conf->export->dir_temp)) {
// Wrapping for export module
// Aucun test necessaire car on force le rep de download sur
// le rep export qui est propre a l'utilisateur
$accessallowed = 1;
// Note that a test may not be required because we force the dir of download on the directory of the user that export
$accessallowed = $user->rights->export->run;
$original_file = $conf->export->dir_temp.'/'.$fuser->id.'/'.$original_file;
} elseif ($modulepart == 'import' && !empty($conf->import->dir_temp)) {
// Wrapping for import module
$accessallowed = 1;
$accessallowed = $user->rights->import->run;
$original_file = $conf->import->dir_temp.'/'.$original_file;
} elseif ($modulepart == 'editor' && !empty($conf->fckeditor->dir_output)) {
// Wrapping pour l'editeur wysiwyg
// Wrapping for wysiwyg editor
$accessallowed = 1;
$original_file = $conf->fckeditor->dir_output.'/'.$original_file;
} elseif ($modulepart == 'systemtools' && !empty($conf->admin->dir_output)) {

View File

@ -747,6 +747,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
}
}
//print $sql;
if ($sql) {
$resql = $db->query($sql);
@ -756,6 +757,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
return false;
}
} else {
dol_syslog("Bad forged sql in checkUserAccessToObject", LOG_WARNING);
return false;
}
}

View File

@ -343,14 +343,14 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
// Title
if ($foruserprofile) {
print '<tr class="liste_titre"><th class="titlefield">'.$langs->trans("Parameter").'</th><th>'.$langs->trans("DefaultValue").'</th>';
print '<tr class="liste_titre"><th class="titlefieldcreate">'.$langs->trans("Parameter").'</th><th>'.$langs->trans("DefaultValue").'</th>';
print '<th colspan="2">&nbsp;</th>';
print '</tr>';
print '<tr>';
print '<td>'.$langs->trans("DefaultSkin").'</td>';
print '<td>'.$conf->global->MAIN_THEME.'</td>';
print '<td class="nowrap left" width="20%"><input id="check_MAIN_THEME" name="check_MAIN_THEME"'.($edit ? '' : ' disabled').' type="checkbox" '.($selected_theme ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
print '<td class="nowrap left"><input id="check_MAIN_THEME" name="check_MAIN_THEME"'.($edit ? '' : ' disabled').' type="checkbox" '.($selected_theme ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
print '<td>&nbsp;</td>';
print '</tr>';
} else {
@ -359,7 +359,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
$dirthemestring .= '"'.$dirtheme.'" ';
}
print '<tr class="liste_titre"><th class="titlefield">';
print '<tr class="liste_titre"><th class="titlefieldcreate">';
print $form->textwithpicto($langs->trans("DefaultSkin"), $langs->trans("ThemeDir").' : '.$dirthemestring);
print '</th>';
print '<th class="right">';
@ -448,7 +448,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
// Nothing
} else {
// Show logo
print '<tr class="oddeven"><td class="titlefield">'.$langs->trans("EnableShowLogo").'</td><td>';
print '<tr class="oddeven"><td class="titlefieldcreate">'.$langs->trans("EnableShowLogo").'</td><td>';
if ($edit) {
print ajax_constantonoff('MAIN_SHOW_LOGO', array(), null, 0, 0, 1);
//print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1);

View File

@ -368,7 +368,7 @@ class modCommande extends DolibarrModules
//Import CPV Lines
$r++;
$this->import_code[$r] = 'commande_lines_'.$r;
$this->import_label[$r] = 'OrderLine';
$this->import_label[$r] = 'SaleOrderLines';
$this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = [];
$this->import_tables_array[$r] = ['cd' => MAIN_DB_PREFIX.'commandedet', 'extra' => MAIN_DB_PREFIX.'commandedet_extrafields'];

View File

@ -666,7 +666,7 @@ class modFournisseur extends DolibarrModules
$r++;
$this->import_code[$r] = $this->rights_class.'_'.$r;
$this->import_label[$r] = "Supplier Invoice"; // Translation key
$this->import_label[$r] = "SupplierInvoices"; // Translation key
$this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r] = ['f' => MAIN_DB_PREFIX.'facture_fourn', 'extra' => MAIN_DB_PREFIX.'facture_fourn_extrafields'];
@ -759,7 +759,7 @@ class modFournisseur extends DolibarrModules
//Import Supplier Invoice Lines
$r++;
$this->import_code[$r] = $this->rights_class.'_'.$r;
$this->import_label[$r] = "Supplier Invoice Lines"; // Translation key
$this->import_label[$r] = "SupplierInvoiceLines"; // Translation key
$this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r] = ['fd' => MAIN_DB_PREFIX.'facture_fourn_det', 'extra' => MAIN_DB_PREFIX.'facture_fourn_det_extrafields'];
@ -839,7 +839,7 @@ class modFournisseur extends DolibarrModules
//Import Purchase Orders
$r++;
$this->import_code[$r] = 'commande_fournisseur_'.$r;
$this->import_label[$r] = 'Purchase Orders';
$this->import_label[$r] = 'SuppliersOrders';
$this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = [];
$this->import_tables_array[$r] = ['c' => MAIN_DB_PREFIX.'commande_fournisseur', 'extra' => MAIN_DB_PREFIX.'commande_fournisseur_extrafields'];
@ -922,7 +922,7 @@ class modFournisseur extends DolibarrModules
//Import PO Lines
$r++;
$this->import_code[$r] = 'commande_fournisseurdet_'.$r;
$this->import_label[$r] = 'PO Lines';
$this->import_label[$r] = 'PurchaseOrderLines';
$this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = [];
$this->import_tables_array[$r] = ['cd' => MAIN_DB_PREFIX.'commande_fournisseurdet', 'extra' => MAIN_DB_PREFIX.'commande_fournisseurdet_extrafields'];

View File

@ -350,7 +350,7 @@ class modPropale extends DolibarrModules
//Import Proposal Lines
$r++;
$this->import_code[$r] = $this->rights_class.'line_'.$r;
$this->import_label[$r] = "ProposalLine"; // Translation key
$this->import_label[$r] = "ProposalLines"; // Translation key
$this->import_icon[$r] = $this->picto;
$this->import_entities_array[$r] = []; // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r] = [

View File

@ -52,11 +52,12 @@ Invoices=Invoices
InvoiceLine=Invoice line
InvoiceCustomer=Customer invoice
CustomerInvoice=Customer invoice
CustomersInvoices=Customers invoices
CustomersInvoices=Customer invoices
SupplierInvoice=Vendor invoice
SuppliersInvoices=Vendors invoices
SuppliersInvoices=Vendor invoices
SupplierInvoiceLines=Vendor invoice lines
SupplierBill=Vendor invoice
SupplierBills=suppliers invoices
SupplierBills=Vendor invoices
Payment=Payment
PaymentBack=Refund
CustomerInvoicePaymentBack=Refund

View File

@ -16,6 +16,8 @@ ToOrder=Make order
MakeOrder=Make order
SupplierOrder=Purchase order
SuppliersOrders=Purchase orders
SaleOrderLines=Sale order lines
PurchaseOrderLines=Puchase order lines
SuppliersOrdersRunning=Current purchase orders
CustomerOrder=Sales Order
CustomersOrders=Sales Orders

View File

@ -59,6 +59,7 @@ ConfirmClonePropal=Are you sure you want to clone the commercial proposal <b>%s<
ConfirmReOpenProp=Are you sure you want to open back the commercial proposal <b>%s</b>?
ProposalsAndProposalsLines=Commercial proposal and lines
ProposalLine=Proposal line
ProposalLines=Proposal lines
AvailabilityPeriod=Availability delay
SetAvailability=Set availability delay
AfterOrder=after order

View File

@ -1,6 +1,7 @@
# Dolibarr language file - Source file is en_US - vendors
Suppliers=Vendors
SuppliersInvoice=Vendor invoice
SupplierInvoices=Vendor invoices
ShowSupplierInvoice=Show Vendor Invoice
NewSupplier=New vendor
History=History

View File

@ -555,55 +555,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print dol_get_fiche_end();
/*
* Lines
*/
if (!empty($object->table_element_line)) {
// Show object lines
$result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">
';
if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
}
print '<div class="div-table-responsive-no-min">';
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
print '<table id="tablelines" class="noborder noshadow" width="100%">';
}
if (!empty($object->lines)) {
$object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1);
}
// Form to add new line
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
if ($action != 'editline') {
// Add products/services form
$object->formAddObjectLine(1, $mysoc, $soc);
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
}
}
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
print '</table>';
}
print '</div>';
print "</form>\n";
}
// Buttons for actions
if ($action != 'presend' && $action != 'editline') {

View File

@ -412,54 +412,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print dol_get_fiche_end();
/*
* Lines
*/
if (!empty($object->table_element_line)) {
// Show object lines
$result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">
';
if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
}
print '<div class="div-table-responsive-no-min">';
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
print '<table id="tablelines" class="noborder noshadow" width="100%">';
}
if (!empty($object->lines)) {
$object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1);
}
// Form to add new line
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
if ($action != 'editline') {
// Add products/services form
$object->formAddObjectLine(1, $mysoc, $soc);
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
}
}
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
print '</table>';
}
print '</div>';
print "</form>\n";
}
print '<br>'.$langs->trans("FeatureNotYetAvailable");
}

View File

@ -440,54 +440,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print dol_get_fiche_end();
/*
* Lines
*/
if (!empty($object->table_element_line)) {
// Show object lines
$result = $object->getLinesArray();
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
<input type="hidden" name="token" value="' . newToken().'">
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
<input type="hidden" name="mode" value="">
<input type="hidden" name="id" value="' . $object->id.'">
';
if (!empty($conf->use_javascript_ajax) && $object->status == 0) {
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
}
print '<div class="div-table-responsive-no-min">';
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
print '<table id="tablelines" class="noborder noshadow" width="100%">';
}
if (!empty($object->lines)) {
$object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1);
}
// Form to add new line
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
if ($action != 'editline') {
// Add products/services form
$object->formAddObjectLine(1, $mysoc, $soc);
$parameters = array();
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
}
}
if (!empty($object->lines) || ($object->status == $object::STATUS_DRAFT && $permissiontoadd && $action != 'selectlines' && $action != 'editline')) {
print '</table>';
}
print '</div>';
print "</form>\n";
}
// Buttons for actions
if ($action != 'presend' && $action != 'editline') {

View File

@ -960,7 +960,7 @@ if (empty($type) || $type == 'f') {
if ($user->rights->societe->client->voir || $socid) {
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= img_picto('', 'user', 'class="pictofixedwidth"');
$moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $langs->trans('SalesRepresentatives'), 'maxwidth300', 1);
$moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $langs->trans('SalesRepresentatives'), ($conf->dol_optimize_smallscreen ? 'maxwidth200' : 'maxwidth300'), 1);
$moreforfilter .= '</div>';
}
if ($moreforfilter) {

View File

@ -37,7 +37,10 @@ $servicename = 'Stripe';
// Load translation files required by the page
$langs->loadLangs(array('admin', 'other', 'paypal', 'paybox', 'stripe'));
if (!$user->admin) {
if (empty($user->admin)) {
accessforbidden();
}
if (empty($conf->stripe->enabled)) {
accessforbidden();
}
@ -207,24 +210,21 @@ print '</td><td></td></tr>';
if (empty($conf->stripeconnect->enabled)) {
print '<tr class="oddeven"><td>';
print '<span class="fieldrequired">'.$langs->trans("STRIPE_TEST_PUBLISHABLE_KEY").'</span></td><td>';
print '<input class="minwidth300" type="text" name="STRIPE_TEST_PUBLISHABLE_KEY" value="'.$conf->global->STRIPE_TEST_PUBLISHABLE_KEY.'">';
print ' &nbsp; <span class="opacitymedium">'.$langs->trans("Example").': pk_test_xxxxxxxxxxxxxxxxxxxxxxxx</span>';
print '<input class="minwidth300" type="text" name="STRIPE_TEST_PUBLISHABLE_KEY" value="'.$conf->global->STRIPE_TEST_PUBLISHABLE_KEY.'" placeholder="'.$langs->trans("Example").': pk_test_xxxxxxxxxxxxxxxxxxxxxxxx">';
print '</td><td></td></tr>';
print '<tr class="oddeven"><td>';
print '<span class="titlefield fieldrequired">'.$langs->trans("STRIPE_TEST_SECRET_KEY").'</span></td><td>';
print '<input class="minwidth300" type="text" name="STRIPE_TEST_SECRET_KEY" value="'.$conf->global->STRIPE_TEST_SECRET_KEY.'">';
print ' &nbsp; <span class="opacitymedium">'.$langs->trans("Example").': sk_test_xxxxxxxxxxxxxxxxxxxxxxxx<</span>';
print '<input class="minwidth300" type="text" name="STRIPE_TEST_SECRET_KEY" value="'.$conf->global->STRIPE_TEST_SECRET_KEY.'" placeholder="'.$langs->trans("Example").': sk_test_xxxxxxxxxxxxxxxxxxxxxxxx">';
print '</td><td></td></tr>';
print '<tr class="oddeven"><td>';
print '<span class="titlefield">'.$langs->trans("STRIPE_TEST_WEBHOOK_KEY").'</span></td><td>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
print '<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_ID" value="'.$conf->global->STRIPE_TEST_WEBHOOK_ID.'">';
print ' &nbsp; <span class="opacitymedium">'.$langs->trans("Example").': we_xxxxxxxxxxxxxxxxxxxxxxxx</span><br>';
print '<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_ID" value="'.$conf->global->STRIPE_TEST_WEBHOOK_ID.'" placeholder="'.$langs->trans("Example").': we_xxxxxxxxxxxxxxxxxxxxxxxx">';
print '<br>';
}
print '<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="'.$conf->global->STRIPE_TEST_WEBHOOK_KEY.'">';
print ' &nbsp; <span class="opacitymedium">'.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx</span>';
print '<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="'.$conf->global->STRIPE_TEST_WEBHOOK_KEY.'" placeholder="'.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForTestWebhook").'</span> ';
$url = dol_buildpath('/public/stripe/ipn.php?test', 3);
$out .= '<input type="text" id="onlinetestwebhookurl" class="minwidth500" value="'.$url.'" disabled>';
@ -254,7 +254,7 @@ if (empty($conf->stripeconnect->enabled)) {
}
//print $endpoint;
} else {
print img_picto($langs->trans("inactive"), 'statut5');
print img_picto($langs->trans("Inactive"), 'statut5');
}
}
print'</td></tr>';
@ -272,24 +272,21 @@ if (empty($conf->stripeconnect->enabled)) {
if (empty($conf->stripeconnect->enabled)) {
print '<tr class="oddeven"><td>';
print '<span class="fieldrequired">'.$langs->trans("STRIPE_LIVE_PUBLISHABLE_KEY").'</span></td><td>';
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_PUBLISHABLE_KEY" value="'.$conf->global->STRIPE_LIVE_PUBLISHABLE_KEY.'">';
print ' &nbsp; <span class="opacitymedium">'.$langs->trans("Example").': pk_live_xxxxxxxxxxxxxxxxxxxxxxxx</span>';
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_PUBLISHABLE_KEY" value="'.$conf->global->STRIPE_LIVE_PUBLISHABLE_KEY.'" placeholder="'.$langs->trans("Example").': pk_live_xxxxxxxxxxxxxxxxxxxxxxxx">';
print '</td><td></td></tr>';
print '<tr class="oddeven"><td>';
print '<span class="fieldrequired">'.$langs->trans("STRIPE_LIVE_SECRET_KEY").'</span></td><td>';
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_SECRET_KEY" value="'.$conf->global->STRIPE_LIVE_SECRET_KEY.'">';
print ' &nbsp; <span class="opacitymedium">'.$langs->trans("Example").': sk_live_xxxxxxxxxxxxxxxxxxxxxxxx</span>';
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_SECRET_KEY" value="'.$conf->global->STRIPE_LIVE_SECRET_KEY.'" placeholder="'.$langs->trans("Example").': sk_live_xxxxxxxxxxxxxxxxxxxxxxxx">';
print '</td><td></td></tr>';
print '<tr class="oddeven"><td>';
print '<span class="titlefield">'.$langs->trans("STRIPE_LIVE_WEBHOOK_KEY").'</span></td><td>';
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_ID" value="'.$conf->global->STRIPE_LIVE_WEBHOOK_ID.'">';
print ' &nbsp; <span class="opacitymedium">'.$langs->trans("Example").': we_xxxxxxxxxxxxxxxxxxxxxxxx</span><br>';
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_ID" value="'.$conf->global->STRIPE_LIVE_WEBHOOK_ID.'" placeholder="'.$langs->trans("Example").': we_xxxxxxxxxxxxxxxxxxxxxxxx">';
print '<br>';
}
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_KEY" value="'.$conf->global->STRIPE_LIVE_WEBHOOK_KEY.'">';
print ' &nbsp; <span class="opacitymedium">'.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx</span>';
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_KEY" value="'.$conf->global->STRIPE_LIVE_WEBHOOK_KEY.'" placeholder="'.$langs->trans("Example").': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">';
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForLiveWebhook").'</span> ';
$url = dol_buildpath('/public/stripe/ipn.php', 3);
$out .= '<input type="text" id="onlinelivewebhookurl" class="minwidth500" value="'.$url.'" disabled>';
@ -319,7 +316,7 @@ if (empty($conf->stripeconnect->enabled)) {
}
//print $endpoint;
} else {
print img_picto($langs->trans("inactive"), 'statut5');
print img_picto($langs->trans("Inactive"), 'statut5');
}
}
print '</td></tr>';

View File

@ -52,6 +52,7 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$result = restrictedArea($user, 'banque');
/*

View File

@ -52,6 +52,7 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
$result = restrictedArea($user, 'banque');
/*

View File

@ -53,6 +53,8 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
$optioncss = GETPOST('optioncss', 'alpha');
$result = restrictedArea($user, 'banque');
/*
* View

View File

@ -118,6 +118,7 @@ $usercancreateorder = $user->rights->fournisseur->commande->creer;
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
$permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown.inc.php
$permissiontoadd = $usercancreate;
/*
@ -485,7 +486,6 @@ if (empty($reshook)) {
// Actions to build doc
$upload_dir = $conf->supplier_proposal->dir_output;
$permissiontoadd = $usercancreate;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';