Merge pull request #25 from Dolibarr/develop

Update fork
This commit is contained in:
Damien BENOIT 2021-05-20 15:29:42 +02:00 committed by GitHub
commit 072e98e730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
58 changed files with 663 additions and 499 deletions

View File

@ -15,7 +15,8 @@ NEW: Add a performance center page with all information and advices related to t
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
NEW: All main menu entries are using the picto of the module
NEW: Add a copy to clipboard button on some fields
NEW: Add an example of scheduled job to send email reminder for unpayed invoices
NEW: Add an example of scheduled job to send email reminder for unpayed invoices
NEW: Can make massive stock transfers from a CSV file.
NEW: Accountancy - Add FEC import
NEW: Accountancy - Add a confirmation form with options on export
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
@ -159,6 +160,7 @@ NEW: #13739 #17390 Product API route added to get product stock and product with
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Module SimplePOS is deprecated. If you need a POS module, please use the module TakePOS.
* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup.
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
* Field "total" renamed into to "total_ht" for table llx_facture, llx_facture_rec for better field name consistency

View File

@ -245,6 +245,14 @@ RESTLER:
// @CHANGE LDR
if (!is_string($haystack)) return false;
* Replace
$loaders = array_unique(static::$rogueLoaders);
with
$loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
+With swagger 2 provided into /explorer:
----------------------------------------

View File

@ -386,7 +386,8 @@ foreach ($modulesdir as $dir) {
}
$moduleposition = ($objMod->module_position ? $objMod->module_position : '50');
if ($moduleposition == '50' && ($objMod->isCoreOrExternalModule() == 'external')) {
if ($objMod->isCoreOrExternalModule() == 'external' && $moduleposition < 100000) {
// an external module should never return a value lower than '80'.
$moduleposition = '80'; // External modules at end by default
}

View File

@ -372,7 +372,7 @@ if ($result) {
print_liste_field_titre("UserAgent", $_SERVER["PHP_SELF"], "e.user_agent", "", $param, '', $sortfield, $sortorder);
}
if (!empty($arrayfields['e.prefix_session']['checked'])) {
print_liste_field_titre("PrefixSession", $_SERVER["PHP_SELF"], "e.prefix_session", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("SuffixSessionName", $_SERVER["PHP_SELF"], "e.prefix_session", "", $param, '', $sortfield, $sortorder);
}
print_liste_field_titre('');
print "</tr>\n";

View File

@ -937,6 +937,7 @@ if ($action == 'create') {
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="donotclearsession" value="1">';
print '<input type="hidden" name="page_y" value="">';
if ($backtopage) {
print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : htmlentities($_SERVER["HTTP_REFERER"])).'">';
}
@ -1183,7 +1184,7 @@ if ($action == 'create') {
$projectid = GETPOST('projectid', 'int');
print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td id="project-input-container">';
print img_picto('', 'project', 'class="paddingrightonly"');
print img_picto('', 'project', 'class="pictofixedwidth"');
print $formproject->select_projects((!empty($societe->id) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
print '&nbsp;<a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$societe->id.'&action=create&amp;backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'">';
@ -1430,6 +1431,7 @@ if ($id > 0) {
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$id.'">';
print '<input type="hidden" name="ref_ext" value="'.$object->ref_ext.'">';
print '<input type="hidden" name="page_y" value="">';
if ($backtopage) {
print '<input type="hidden" name="backtopage" value="'.($backtopage != '1' ? $backtopage : htmlentities($_SERVER["HTTP_REFERER"])).'">';
}

View File

@ -1436,11 +1436,9 @@ if (empty($reshook)) {
*/
$form = new Form($db);
$formother = new FormOther($db);
$formfile = new FormFile($db);
$formpropal = new FormPropal($db);
$formmargin = new FormMargin($db);
$companystatic = new Societe($db);
if (!empty($conf->projet->enabled)) {
$formproject = new FormProjets($db);
}
@ -1582,7 +1580,7 @@ if ($action == 'create') {
//$warehouse_id = $soc->warehouse_id;
} else {
print '<td>';
print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500');
print img_picto('', 'company').$form->select_company('', 'socid', '(s.client = 1 OR s.client = 2 OR s.client = 3) AND status=1', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
// reload page to retrieve customer informations
if (empty($conf->global->RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED)) {
print '<script type="text/javascript">
@ -1638,20 +1636,20 @@ if ($action == 'create') {
// Mode of payment
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
print img_picto('', 'bank').'&ensp;';
$form->select_types_paiements((GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id');
$form->select_types_paiements((GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id), 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
// Bank Account
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL) && !empty($conf->banque->enabled)) {
print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
print img_picto('', 'bank_account');
$form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1);
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($soc->fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
print '</td></tr>';
}
// What trigger creation
// Source / Channel - What trigger creation
print '<tr><td>'.$langs->trans('Source').'</td><td>';
$form->selectInputReason('', 'demand_reason_id', "SRC_PROP", 1);
print img_picto('', 'question', 'class="pictofixedwidth"');
$form->selectInputReason('', 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
// Delivery delay
@ -1661,7 +1659,7 @@ if ($action == 'create') {
}
print '</td><td>';
print img_picto('', 'clock').'&ensp;';
$form->selectAvailabilityDelay('', 'availability_id', '', 1);
$form->selectAvailabilityDelay('', 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
// Shipping Method
@ -1670,8 +1668,8 @@ if ($action == 'create') {
$shipping_method_id = $soc->shipping_method_id;
}
print '<tr><td>'.$langs->trans('SendingMethod').'</td><td>';
print img_picto('', 'object_dollyrevert').'&ensp;';
print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1);
print img_picto('', 'object_dollyrevert', 'class="pictofixedwidth"');
print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
}
@ -1680,7 +1678,7 @@ if ($action == 'create') {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
print img_picto('', 'stock').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth175 maxwidth500 widthcentpercentminusxx');
print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
print '</td></tr>';
}
@ -1703,7 +1701,7 @@ if ($action == 'create') {
$langs->load("projects");
print '<tr>';
print '<td>'.$langs->trans("Project").'</td><td>';
print img_picto('', 'project').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProject").'"></span></a>';
print '</td>';
print '</tr>';
@ -1725,7 +1723,7 @@ if ($action == 'create') {
print img_picto('', 'pdf').'&ensp;';
$liste = ModelePDFPropales::liste_modeles($db);
$preselected = ($conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT ? $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT : $conf->global->PROPALE_ADDON_PDF);
print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', '', 1);
print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200 widthcentpercentminusx', 1);
print "</td></tr>";
// Multicurrency

View File

@ -176,8 +176,8 @@ $arrayfields = array(
'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)),
'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1),
's.town'=>array('label'=>"Town", 'checked'=>1),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1),
's.town'=>array('label'=>"Town", 'checked'=>-1),
's.zip'=>array('label'=>"Zip", 'checked'=>1),
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
@ -203,7 +203,7 @@ $arrayfields = array(
'p.multicurrency_total_ht_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedHT', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
'p.multicurrency_total_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedTTC', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>1),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>-1),
'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'p.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500),
@ -560,7 +560,7 @@ if ($search_societe_alias) {
$sql .= natural_search('s.name_alias', $search_societe_alias);
}
if ($search_login) {
$sql .= natural_search("u.login", $search_login);
$sql .= natural_search(array("u.login", "u.firstname", "u.lastname"), $search_login);
}
if ($search_montant_ht != '') {
$sql .= natural_search("p.total_ht", $search_montant_ht, 1);
@ -616,7 +616,7 @@ if ($search_product_category > 0) {
$sql .= " AND cp.fk_categorie = ".$db->escape($search_product_category);
}
if ($socid > 0) {
$sql .= ' AND s.rowid = '.$socid;
$sql .= ' AND s.rowid = '.((int) $socid);
}
if ($search_status != '' && $search_status != '-1') {
$sql .= ' AND p.fk_statut IN ('.$db->sanitize($search_status).')';
@ -640,10 +640,10 @@ if ($search_datedelivery_end) {
$sql .= " AND p.date_livraison <= '".$db->idate($search_datedelivery_end)."'";
}
if ($search_sale > 0) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$db->escape($search_sale);
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
}
if ($search_user > 0) {
$sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$db->escape($search_user);
$sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".((int) $search_user);
}
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
@ -907,14 +907,14 @@ if ($resql) {
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag');
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300' : 'maxwidth250'), 1);
$moreforfilter .= '</div>';
}
if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle);
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, (empty($conf->dol_optimize_smallscreen) ? 'maxwidth300' : 'maxwidth250'));
$moreforfilter .= '</div>';
}
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROPAL)) {
@ -1715,7 +1715,7 @@ if ($resql) {
// Author
if (!empty($arrayfields['u.login']['checked'])) {
print '<td>';
print '<td class="tdoverflowmax200">';
if ($userstatic->id) {
print $userstatic->getNomUrl(-1);
}
@ -1727,7 +1727,7 @@ if ($resql) {
if (!empty($arrayfields['sale_representative']['checked'])) {
// Sales representatives
print '<td>';
print '<td class="tdoverflowmax200">';
if ($obj->socid > 0) {
$listsalesrepresentatives = $companystatic->getSalesRepresentatives($user);
if ($listsalesrepresentatives < 0) {

View File

@ -1626,36 +1626,36 @@ if ($action == 'create' && $usercancreate) {
print "</td>\n";
print '</tr>';
// terms of the settlement
// Terms of the settlement
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
print img_picto('', 'paiment');
$form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', - 1, 1);
print '</td></tr>';
// Mode de reglement
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
print img_picto('', 'bank').'&ensp;';
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id');
print img_picto('', 'bank', 'class="pictofixedwidth"');
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
// Bank Account
if (!empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER) && !empty($conf->banque->enabled)) {
print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
print img_picto('', 'bank_account');
$form->select_comptes($fk_account, 'fk_account', 0, '', 1);
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
print '</td></tr>';
}
// Delivery delay
print '<tr class="fielddeliverydelay"><td>'.$langs->trans('AvailabilityPeriod').'</td><td>';
print img_picto('', 'clock').'&ensp;';
$form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1);
print img_picto('', 'clock', 'class="pictofixedwidth"');
$form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
// Shipping Method
if (!empty($conf->expedition->enabled)) {
print '<tr><td>'.$langs->trans('SendingMethod').'</td><td>';
print img_picto('', 'object_dollyrevert').'&ensp;';
print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1);
print img_picto('', 'object_dollyrevert', 'class="pictofixedwidth"');
print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
}
@ -1664,13 +1664,14 @@ if ($action == 'create' && $usercancreate) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
print img_picto('', 'stock').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth175 maxwidth500 widthcentpercentminusxx');
print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($warehouse_id, 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
print '</td></tr>';
}
// What trigger creation
// Source / Channle - What trigger creation
print '<tr><td>'.$langs->trans('Channel').'</td><td>';
$form->selectInputReason($demand_reason_id, 'demand_reason_id', '', 1);
print img_picto('', 'question', 'class="pictofixedwidth"');
$form->selectInputReason($demand_reason_id, 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
// TODO How record was recorded OrderMode (llx_c_input_method)
@ -1680,8 +1681,7 @@ if ($action == 'create' && $usercancreate) {
$langs->load("projects");
print '<tr>';
print '<td>'.$langs->trans("Project").'</td><td>';
print img_picto('', 'project');
$numprojet = $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth175 maxwidth500 widthcentpercentminusxx');
print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
print '</td>';
print '</tr>';
@ -1723,11 +1723,11 @@ if ($action == 'create' && $usercancreate) {
// Template to use by default
print '<tr><td>'.$langs->trans('DefaultModel').'</td>';
print '<td>';
print img_picto('', 'pdf').'&ensp;';
print img_picto('', 'pdf', 'class="pictofixedwidth"');
include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
$liste = ModelePDFCommandes::liste_modeles($db);
$preselected = $conf->global->COMMANDE_ADDON_PDF;
print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', '', 1);
print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200 widthcentpercentminusx', 1);
print "</td></tr>";
// Multicurrency

View File

@ -588,7 +588,7 @@ if ($search_multicurrency_montant_ttc != '') {
$sql .= natural_search('c.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
}
if ($search_login) {
$sql .= natural_search("u.login", $search_login);
$sql .= natural_search(array("u.login", "u.firstname", "u.lastname"), $search_login);
}
if ($search_project_ref != '') {
$sql .= natural_search("p.ref", $search_project_ref);
@ -1490,7 +1490,7 @@ if ($resql) {
$totalarray['nbfield']++;
}
}
// Town
// Alias name
if (!empty($arrayfields['s.name_alias']['checked'])) {
print '<td class="nocellnopadd">';
print $obj->alias;
@ -1565,7 +1565,7 @@ if ($resql) {
$totalarray['nbfield']++;
}
}
//Shipping Method
// Shipping Method
if (!empty($arrayfields['c.fk_shipping_method']['checked'])) {
print '<td>';
$form->formSelectShippingMethod('', $obj->fk_shipping_method, 'none', 1);
@ -1690,7 +1690,7 @@ if ($resql) {
// Author
if (!empty($arrayfields['u.login']['checked'])) {
print '<td>';
print '<td class="tdoverflowmax200">';
if ($userstatic->id) {
print $userstatic->getNomUrl(-1);
} else {

View File

@ -1364,7 +1364,7 @@ if (empty($reshook)) {
$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
$object->ref_client = GETPOST('ref_client');
$object->model_pdf = GETPOST('model');
$object->fk_project = GETPOST('projectid');
$object->fk_project = GETPOST('projectid', 'int');
$object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
$object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->fk_account = GETPOST('fk_account', 'int');
@ -3556,7 +3556,7 @@ if ($action == 'create') {
if($( this ).prop("checked") && $.inArray($( this ).val(), '.json_encode($retainedWarrantyInvoiceAvailableType).' ) !== -1)
{
$(".retained-warranty-line").show();
$("#new-situation-invoice-retained-warranty").val("'.doubleval($retained_warranty_js_default).'");
$("#new-situation-invoice-retained-warranty").val("'.floatval($retained_warranty_js_default).'");
}
else{
$(".retained-warranty-line").hide();
@ -3571,14 +3571,15 @@ if ($action == 'create') {
// Payment mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
$form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id') : $mode_reglement_id, 'mode_reglement_id', 'CRDT');
print img_picto('', 'bank', 'class="pictofixedwidth"');
$form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ? GETPOST('mode_reglement_id') : $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
// Bank Account
if (!empty($conf->banque->enabled)) {
print '<tr><td>'.$langs->trans('BankAccount').'</td><td colspan="2">';
$fk_account = GETPOST('fk_account', 'int');
print img_picto('', 'bank_account', 'class="paddingrightonly"').$form->select_comptes(($fk_account < 0 ? '' : $fk_account), 'fk_account', 0, '', 1, '', 0, '', 1);
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(($fk_account < 0 ? '' : $fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
print '</td></tr>';
}
@ -3586,7 +3587,7 @@ if ($action == 'create') {
if (!empty($conf->projet->enabled)) {
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
print '</td></tr>';
}
@ -3626,6 +3627,7 @@ if ($action == 'create') {
// Template to use by default
print '<tr><td>'.$langs->trans('Model').'</td>';
print '<td colspan="2">';
print img_picto('', 'pdf', 'class="pictofixedwidth"');
include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
$liste = ModelePDFFactures::liste_modeles($db);
if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) {
@ -3635,7 +3637,7 @@ if ($action == 'create') {
} else {
$preselected = $conf->global->FACTURE_ADDON_PDF;
}
print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', '', 1);
print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200 widthcentpercentminusx', 1);
print "</td></tr>";
// Multicurrency

View File

@ -301,7 +301,7 @@ class Facture extends CommonInvoice
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>50),
'datef' =>array('type'=>'date', 'label'=>'DateInvoice', 'enabled'=>1, 'visible'=>1, 'position'=>20),
'date_valid' =>array('type'=>'date', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>22),
'date_lim_reglement' =>array('type'=>'date', 'label'=>'DateDue', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
'date_lim_reglement' =>array('type'=>'date', 'label'=>'DateDue', 'enabled'=>1, 'visible'=>1, 'position'=>25),
'date_closing' =>array('type'=>'datetime', 'label'=>'Date closing', 'enabled'=>1, 'visible'=>-1, 'position'=>30),
'paye' =>array('type'=>'smallint(6)', 'label'=>'InvoicePaidCompletely', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>80),
//'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>85),
@ -310,7 +310,7 @@ class Facture extends CommonInvoice
//'remise' =>array('type'=>'double', 'label'=>'Remise', 'enabled'=>1, 'visible'=>-1, 'position'=>100),
'close_code' =>array('type'=>'varchar(16)', 'label'=>'EarlyClosingReason', 'enabled'=>1, 'visible'=>-1, 'position'=>92),
'close_note' =>array('type'=>'varchar(128)', 'label'=>'EarlyClosingComment', 'enabled'=>1, 'visible'=>-1, 'position'=>93),
'total_ht' =>array('type'=>'double(24,8)', 'label'=>'AmountHT', 'enabled'=>1, 'visible'=>-1, 'position'=>95, 'isameasure'=>1),
'total_ht' =>array('type'=>'double(24,8)', 'label'=>'AmountHT', 'enabled'=>1, 'visible'=>1, 'position'=>95, 'isameasure'=>1),
'total_tva' =>array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'enabled'=>1, 'visible'=>-1, 'position'=>100, 'isameasure'=>1),
'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LT1', 'enabled'=>1, 'visible'=>-1, 'position'=>110, 'isameasure'=>1),
'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LT2', 'enabled'=>1, 'visible'=>-1, 'position'=>120, 'isameasure'=>1),

View File

@ -85,8 +85,8 @@ $search_refcustomer = GETPOST('search_refcustomer', 'alpha');
$search_type = GETPOST('search_type', 'int');
$search_project_ref = GETPOST('search_project_ref', 'alpha');
$search_project = GETPOST('search_project', 'alpha');
$search_societe = GETPOST('search_societe', 'alpha');
$search_societe_alias = GETPOST('search_societe_alias', 'alpha');
$search_company = GETPOST('search_company', 'alpha');
$search_company_alias = GETPOST('search_company_alias', 'alpha');
$search_montant_ht = GETPOST('search_montant_ht', 'alpha');
$search_montant_vat = GETPOST('search_montant_vat', 'alpha');
$search_montant_localtax1 = GETPOST('search_montant_localtax1', 'alpha');
@ -304,8 +304,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
$search_type = '';
$search_project_ref = '';
$search_project = '';
$search_societe = '';
$search_societe_alias = '';
$search_company = '';
$search_company_alias = '';
$search_montant_ht = '';
$search_montant_vat = '';
$search_montant_localtax1 = '';
@ -363,7 +363,7 @@ if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
if ($massaction == 'makepayment') {
if ($massaction == 'makepayment_confirm') {
$arrayofselected = is_array($toselect) ? $toselect : array();
$loc = dol_buildpath('/compta/paiement.php', 2).'?action=create&facids='.implode(',', $arrayofselected);
@ -492,7 +492,7 @@ $sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo
if (!$sall) {
$sql .= ', SUM(pf.amount) as dynamount_payed, SUM(pf.multicurrency_amount) as multicurrency_dynamount_payed';
}
if ($search_categ_cus) {
if ($search_categ_cus && $search_categ_cus!=-1) {
$sql .= ", cc.fk_categorie, cc.fk_soc";
}
// Add fields from extrafields
@ -509,7 +509,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
if (!empty($search_categ_cus)) {
if (!empty($search_categ_cus) && $search_categ_cus!=-1) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
}
@ -574,11 +574,11 @@ if ($search_project_ref) {
if ($search_project) {
$sql .= natural_search('p.title', $search_project);
}
if ($search_societe) {
$sql .= natural_search('s.nom', $search_societe);
if ($search_company) {
$sql .= natural_search('s.nom', $search_company);
}
if ($search_societe_alias) {
$sql .= natural_search('s.name_alias', $search_societe_alias);
if ($search_company_alias) {
$sql .= natural_search('s.name_alias', $search_company_alias);
}
if ($search_town) {
$sql .= natural_search('s.town', $search_town);
@ -632,7 +632,7 @@ if ($search_multicurrency_montant_ttc != '') {
$sql .= natural_search('f.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
}
if ($search_login) {
$sql .= natural_search('u.login', $search_login);
$sql .= natural_search(array('u.login', 'u.firstname', 'u.lastname'), $search_login);
}
if ($search_categ_cus > 0) {
$sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
@ -720,7 +720,7 @@ if (!$sall) {
$sql .= ' country.code,';
$sql .= " p.rowid, p.ref, p.title,";
$sql .= " u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender";
if ($search_categ_cus) {
if ($search_categ_cus && $search_categ_cus!=-1) {
$sql .= ", cc.fk_categorie, cc.fk_soc";
}
// Add fields from extrafields
@ -782,8 +782,8 @@ if ($resql) {
if ($socid) {
$soc = new Societe($db);
$soc->fetch($socid);
if (empty($search_societe)) {
$search_societe = $soc->name;
if (empty($search_company)) {
$search_company = $soc->name;
}
}
@ -854,11 +854,11 @@ if ($resql) {
if ($search_type != '') {
$param .= '&search_type='.urlencode($search_type);
}
if ($search_societe) {
$param .= '&search_societe='.urlencode($search_societe);
if ($search_company) {
$param .= '&search_societe='.urlencode($search_company);
}
if ($search_societe_alias) {
$param .= '&search_societe_alias='.urlencode($search_societe_alias);
if ($search_company_alias) {
$param .= '&search_societe_alias='.urlencode($search_company_alias);
}
if ($search_town) {
$param .= '&search_town='.urlencode($search_town);
@ -948,7 +948,7 @@ if ($resql) {
'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
//'makepayment'=>$langs->trans("InvoicePaymentsLimits"), TODO Blank page when using this
//'makepayment'=>$langs->trans("InvoicePaymentsLimits"),
);
if ($conf->prelevement->enabled && !empty($user->rights->prelevement->bons->creer)) {
$langs->load("withdrawals");
@ -1142,11 +1142,11 @@ if ($resql) {
}
// Thirdparty
if (!empty($arrayfields['s.nom']['checked'])) {
print '<td class="liste_titre"><input class="flat maxwidth75imp" type="text" name="search_societe" value="'.$search_societe.'"></td>';
print '<td class="liste_titre"><input class="flat maxwidth75imp" type="text" name="search_company" value="'.$search_company.'"></td>';
}
// Alias
if (!empty($arrayfields['s.name_alias']['checked'])) {
print '<td class="liste_titre"><input class="flat maxwidth75imp" type="text" name="search_societe_alias" value="'.$search_societe_alias.'"></td>';
print '<td class="liste_titre"><input class="flat maxwidth75imp" type="text" name="search_company_alias" value="'.$search_company_alias.'"></td>';
}
// Town
if (!empty($arrayfields['s.town']['checked'])) {
@ -1900,7 +1900,7 @@ if ($resql) {
// Author
if (!empty($arrayfields['u.login']['checked'])) {
print '<td>';
print '<td class="tdoverflowmax200">';
if ($userstatic->id) {
print $userstatic->getNomUrl(-1);
} else {

View File

@ -133,10 +133,10 @@ $arrayfields = array(
's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>30),
's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0, 'position'=>30),
's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0, 'position'=>31),
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0, 'position'=>32),
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1, 'position'=>32),
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0, 'position'=>33),
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0, 'position'=>34),
'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1, 'position'=>80),
'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>-1, 'position'=>80),
'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1, 'position'=>45),
'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),

View File

@ -593,8 +593,10 @@ if (!$error && $massaction == 'confirm_presend') {
if ($mailfile->error) {
$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto);
$resaction .= '<br><div class="error">'.$mailfile->error.'</div>';
} else {
} elseif (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
$resaction .= '<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
} else {
$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '<br><div class="error">(unhandled error)</div>';
}
}
}

View File

@ -926,7 +926,7 @@ class CMailFile
}
// send mail
try {
$result = $this->mailer->send($this->message);
$result = $this->mailer->send($this->message, $failedRecipients);
} catch (Exception $e) {
$this->error = $e->getMessage();
}
@ -936,6 +936,9 @@ class CMailFile
$res = true;
if (!empty($this->error) || !$result) {
if (!empty($failedRecipients)) {
$this->error = 'Transport failed for the following addresses: "' . join('", "', $failedRecipients) . '".';
}
dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR);
$res = false;
} else {

View File

@ -437,7 +437,7 @@ class CUnits // extends CommonObject
*/
public function unitConverter($value, $fk_unit, $fk_new_unit = 0)
{
$value = doubleval(price2num($value));
$value = floatval(price2num($value));
$fk_unit = intval($fk_unit);
// Calcul en unité de base
@ -469,10 +469,10 @@ class CUnits // extends CommonObject
if ($unit) {
// TODO : if base exist in unit dictionary table remove this convertion exception and update convertion infos in database exemple time hour currently scale 3600 will become scale 2 base 60
if ($unit->unit_type == 'time') {
return doubleval($unit->scale);
return floatval($unit->scale);
}
return pow($base, doubleval($unit->scale));
return pow($base, floatval($unit->scale));
}
return 0;

View File

@ -1025,7 +1025,7 @@ class Form
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
}
$out .= '<select id="'.$htmlname.'" class="flat selectincoterm minwidth100imp noenlargeonsmartphone" name="'.$htmlname.'" '.$htmloption.'>';
$out .= '<select id="'.$htmlname.'" class="flat selectincoterm width75" name="'.$htmlname.'" '.$htmloption.'>';
$out .= '<option value="0">&nbsp;</option>';
$num = $this->db->num_rows($resql);
$i = 0;
@ -2131,7 +2131,7 @@ class Form
$out .= ' ('.$langs->trans("Owner").')';
}
if ($nbassignetouser > 1 && $action != 'view') {
$out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">';
$out .= ' <input type="image" style="border: 0px;" src="'.img_picto($langs->trans("Remove"), 'delete', '', 0, 1).'" value="'.$userstatic->id.'" class="removedassigned reposition" id="removedassigned_'.$userstatic->id.'" name="removedassigned_'.$userstatic->id.'">';
}
// Show my availability
if ($showproperties) {
@ -2162,7 +2162,7 @@ class Form
$out .= '});';
$out .= '})</script>';
$out .= $this->select_dolusers('', $htmlname, $show_empty, $exclude, $disabled, $include, $enableonly, $force_entity, $maxlength, $showstatus, $morefilter);
$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
$out .= ' <input type="submit" disabled class="button valignmiddle smallpaddingimp reposition" id="'.$action.'assignedtouser" name="'.$action.'assignedtouser" value="'.dol_escape_htmltag($langs->trans("Add")).'">';
$out .= '<br>';
}
@ -3670,13 +3670,14 @@ class Form
/**
* Retourne la liste des types de delais de livraison possibles
*
* @param int $selected Id du type de delais pre-selectionne
* @param string $htmlname Nom de la zone select
* @param string $filtertype To add a filter
* @param int $selected Id du type de delais pre-selectionne
* @param string $htmlname Nom de la zone select
* @param string $filtertype To add a filter
* @param int $addempty Add empty entry
* @param string $morecss More CSS
* @return void
*/
public function selectAvailabilityDelay($selected = '', $htmlname = 'availid', $filtertype = '', $addempty = 0)
public function selectAvailabilityDelay($selected = '', $htmlname = 'availid', $filtertype = '', $addempty = 0, $morecss = '')
{
global $langs, $user;
@ -3684,7 +3685,7 @@ class Form
dol_syslog(__METHOD__." selected=".$selected.", htmlname=".$htmlname, LOG_DEBUG);
print '<select id="'.$htmlname.'" class="flat" name="'.$htmlname.'">';
print '<select id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'">';
if ($addempty) {
print '<option value="0">&nbsp;</option>';
}
@ -3694,7 +3695,7 @@ class Form
} else {
print '<option value="'.$id.'">';
}
print $arrayavailability['label'];
print dol_escape_htmltag($arrayavailability['label']);
print '</option>';
}
print '</select>';
@ -4154,15 +4155,16 @@ class Form
/**
* Return a HTML select list of shipping mode
*
* @param string $selected Id shipping mode pre-selected
* @param string $htmlname Name of select zone
* @param string $filtre To filter list. This parameter must not come from input of users
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param string $moreattrib To add more attribute on select
* @param string $selected Id shipping mode pre-selected
* @param string $htmlname Name of select zone
* @param string $filtre To filter list. This parameter must not come from input of users
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param string $moreattrib To add more attribute on select
* @param int $noinfoadmin 0=Add admin info, 1=Disable admin info
* @param string $morecss More CSS
* @return void
*/
public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '', $noinfoadmin = 0)
public function selectShippingMethod($selected = '', $htmlname = 'shipping_method_id', $filtre = '', $useempty = 0, $moreattrib = '', $noinfoadmin = 0, $morecss = '')
{
global $langs, $conf, $user;
@ -4183,7 +4185,7 @@ class Form
$num = $this->db->num_rows($result);
$i = 0;
if ($num) {
print '<select id="select'.$htmlname.'" class="flat selectshippingmethod" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
print '<select id="select'.$htmlname.'" class="flat selectshippingmethod'.($morecss ? ' '.$morecss : '').'" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
if ($useempty == 1 || ($useempty == 2 && $num > 1)) {
print '<option value="-1">&nbsp;</option>';
}
@ -4946,16 +4948,18 @@ class Form
$formconfirm .= '<table class="valid centpercent">'."\n";
// Line title
$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="3">'.img_picto('', 'recent').' '.$title.'</td></tr>'."\n";
$formconfirm .= '<tr class="validtitre"><td class="validtitre" colspan="2">';
$formconfirm .= img_picto('', 'recent').' '.$title;
$formconfirm .= '</td></tr>'."\n";
// Line text
if (is_array($formquestion) && !empty($formquestion['text'])) {
$formconfirm .= '<tr class="valid"><td class="valid" colspan="3">'.$formquestion['text'].'</td></tr>'."\n";
$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'.$formquestion['text'].'</td></tr>'."\n";
}
// Line form fields
if ($more) {
$formconfirm .= '<tr class="valid"><td class="valid" colspan="3">'."\n";
$formconfirm .= '<tr class="valid"><td class="valid" colspan="2">'."\n";
$formconfirm .= $more;
$formconfirm .= '</td></tr>'."\n";
}
@ -4963,10 +4967,10 @@ class Form
// Line with question
$formconfirm .= '<tr class="valid">';
$formconfirm .= '<td class="valid">'.$question.'</td>';
$formconfirm .= '<td class="valid">';
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice);
$formconfirm .= '<td class="valid center">';
$formconfirm .= $this->selectyesno("confirm", $newselectedchoice, 0, false, 0, 0, 'marginleftonly marginrightonly');
$formconfirm .= '<input class="button valignmiddle confirmvalidatebutton" type="submit" value="'.$langs->trans("Validate").'">';
$formconfirm .= '</td>';
$formconfirm .= '<td class="valid center"><input class="button valignmiddle confirmvalidatebutton" type="submit" value="'.$langs->trans("Validate").'"></td>';
$formconfirm .= '</tr>'."\n";
$formconfirm .= '</table>'."\n";
@ -7837,9 +7841,10 @@ class Form
* @param bool $disabled true or false
* @param int $useempty 1=Add empty line
* @param int $addjscombo 1=Add js beautifier on combo box
* @param string $morecss More CSS
* @return string See option
*/
public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0)
public function selectyesno($htmlname, $value = '', $option = 0, $disabled = false, $useempty = 0, $addjscombo = 0, $morecss = '')
{
global $langs;
@ -7852,7 +7857,7 @@ class Form
$disabled = ($disabled ? ' disabled' : '');
$resultyesno = '<select class="flat width75" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
$resultyesno = '<select class="flat width75'.($morecss ? ' '.$morecss : '').'" id="'.$htmlname.'" name="'.$htmlname.'"'.$disabled.'>'."\n";
if ($useempty) {
$resultyesno .= '<option value="-1"'.(($value < 0) ? ' selected' : '').'>&nbsp;</option>'."\n";
}

View File

@ -851,7 +851,7 @@ class FormFile
// Show file size
$size = (!empty($file['size']) ? $file['size'] : dol_filesize($filedir."/".$file["name"]));
$out .= '<td class="nowrap right">'.dol_print_size($size, 1, 1).'</td>';
$out .= '<td class="nowraponall right">'.dol_print_size($size, 1, 1).'</td>';
// Show file date
$date = (!empty($file['date']) ? $file['date'] : dol_filemtime($filedir."/".$file["name"]));

View File

@ -214,17 +214,17 @@ print '
print "\n/* JS CODE TO ENABLE ClipBoard copy paste*/\n";
print 'jQuery(\'.clipboardCPShowOnHover\').hover(
function() {
console.log("We hover a value with a copy paste feature");
console.log("We hover a value with a copy paste feature");
$(this).children(".clipboardCPButton, .clipboardCPText").show();
},
function() {
console.log("We hover out the value with a copy paste feature");
console.log("We hover out the value with a copy paste feature");
$(this).children(".clipboardCPButton, .clipboardCPText").hide();
}
);';
print 'jQuery(\'.clipboardCPButton\').click(function() {
print 'jQuery(\'.clipboardCPButton, .clipboardCPValueToPrint\').click(function() {
/* console.log(this.parentNode); */
console.log("We click on a clipboardCPButton tag");
console.log("We click on a clipboardCPButton or clipboardCPValueToPrint class");
if (window.getSelection) {
selection = window.getSelection();

View File

@ -454,7 +454,7 @@ function ajax_combobox($htmlname, $events = array(), $minLengthToAutocomplete =
templateResult: function (data, container) { /* Format visible output into combo list */
/* Code to add class of origin OPTION propagated to the new select2 <li> tag */
if (data.element) { $(container).addClass($(data.element).attr("class")); }
console.log($(data.element).attr("data-html"));
//console.log($(data.element).attr("data-html"));
if (data.id == -1 && $(data.element).attr("data-html") == undefined) {
return \'&nbsp;\';
}

View File

@ -3514,9 +3514,9 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies',
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket',
'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'question', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket',
'error', 'warning',
'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource',
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource',
'shapes', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
'uncheck', 'user-cog', 'website', 'workstation',
@ -3558,7 +3558,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'other'=>'square',
'playdisabled'=>'play', 'pdf'=>'file-pdf', 'poll'=>'check-double', 'pos'=>'cash-register', 'preview'=>'binoculars', 'project'=>'project-diagram', 'projectpub'=>'project-diagram', 'projecttask'=>'tasks', 'propal'=>'file-signature',
'partnership'=>'handshake', 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'previous'=>'arrow-alt-circle-left', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell',
'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
'recent' => 'question', 'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
'refresh'=>'redo', 'resource'=>'laptop-house',
'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s',
@ -10236,7 +10236,8 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1)
}
/**
* Create a button to copy $valuetocopy in the clipboard
* Create a button to copy $valuetocopy in the clipboard.
* Code that handle the click is inside lib_foot.jsp.php
*
* @param string $valuetocopy The value to print
* @param int $showonlyonhover Show the copy-paste button only on hover
@ -10245,6 +10246,12 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1)
*/
function showValueWithClipboardCPButton($valuetocopy, $showonlyonhover = 1, $texttoshow = '')
{
global $conf;
/*if (!empty($conf->dol_no_mouse_hover)) {
$showonlyonhover = 0;
}*/
if ($texttoshow) {
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><span class="clipboardCPValue hidewithsize">'.$valuetocopy.'</span><span class="clipboardCPValueToPrint">'.$texttoshow.'</span><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText opacitymedium"></span></span>';
} else {

View File

@ -2694,7 +2694,7 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
// define progress color according to time spend vs workload
$progressBarClass = 'progress-bar-info';
if ($task->planned_workload) {
$progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2);
$progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2);
// this conf is actually hidden, by default we use 10% for "be carefull or warning"
$warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10;
@ -2702,12 +2702,12 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
$diffTitle = '<br>'.$langs->trans('ProgressDeclared').' : '.$task->progress.($task->progress ? '%' : '');
$diffTitle .= '<br>'.$langs->trans('ProgressCalculated').' : '.$progressCalculated.($progressCalculated ? '%' : '');
//var_dump($progressCalculated.' '.$warningRatio.' '.$task->progress.' '.doubleval($task->progress * $warningRatio));
if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) {
//var_dump($progressCalculated.' '.$warningRatio.' '.$task->progress.' '.floatval($task->progress * $warningRatio));
if (floatval($progressCalculated) > floatval($task->progress * $warningRatio)) {
$progressBarClass = 'progress-bar-danger';
$title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress - $progressCalculated).' '.$langs->trans("point"));
$diff = '<span class="text-danger classfortooltip paddingrightonly" title="'.dol_htmlentities($title.$diffTitle).'" ><i class="fa fa-caret-down"></i> '.($task->progress - $progressCalculated).'%</span>';
} elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10%
} elseif (floatval($progressCalculated) > floatval($task->progress)) { // warning if close at 10%
$progressBarClass = 'progress-bar-warning';
$title = $langs->trans('TheReportedProgressIsLessThanTheCalculatedProgressionByX', abs($task->progress - $progressCalculated).' '.$langs->trans("point"));
$diff = '<span class="text-warning classfortooltip paddingrightonly" title="'.dol_htmlentities($title.$diffTitle).'" ><i class="fa fa-caret-left"></i> '.($task->progress - $progressCalculated).'%</span>';
@ -2771,18 +2771,18 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
$out .= '</span>';
$out .= ' <div class="progress sm '.$spaced.'">';
$diffval = doubleval($task->progress) - doubleval($progressCalculated);
$diffval = floatval($task->progress) - floatval($progressCalculated);
if ($diffval >= 0) {
// good
$out .= ' <div class="progress-bar '.$progressBarClass.'" style="width: '.doubleval($task->progress).'%" title="'.doubleval($task->progress).'%">';
$out .= ' <div class="progress-bar '.$progressBarClass.'" style="width: '.floatval($task->progress).'%" title="'.floatval($task->progress).'%">';
if (!empty($task->progress)) {
$out .= ' <div class="progress-bar progress-bar-consumed" style="width: '.doubleval($progressCalculated / $task->progress * 100).'%" title="'.doubleval($progressCalculated).'%"></div>';
$out .= ' <div class="progress-bar progress-bar-consumed" style="width: '.floatval($progressCalculated / $task->progress * 100).'%" title="'.floatval($progressCalculated).'%"></div>';
}
$out .= ' </div>';
} else {
// bad
$out .= ' <div class="progress-bar progress-bar-consumed" style="width: '.doubleval($progressCalculated).'%" title="'.doubleval($progressCalculated).'%">';
$out .= ' <div class="progress-bar '.$progressBarClass.'" style="width: '.($task->progress ? doubleval($task->progress / $progressCalculated * 100).'%' : '1px').'" title="'.doubleval($task->progress).'%"></div>';
$out .= ' <div class="progress-bar progress-bar-consumed" style="width: '.floatval($progressCalculated).'%" title="'.floatval($progressCalculated).'%">';
$out .= ' <div class="progress-bar '.$progressBarClass.'" style="width: '.($task->progress ? floatval($task->progress / $progressCalculated * 100).'%' : '1px').'" title="'.floatval($task->progress).'%"></div>';
$out .= ' </div>';
}
$out .= ' </div>';
@ -2811,17 +2811,17 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '')
// define color according to time spend vs workload
$badgeClass = 'badge ';
if ($task->planned_workload) {
$progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2);
$progressCalculated = round(100 * floatval($task->duration_effective) / floatval($task->planned_workload), 2);
// this conf is actually hidden, by default we use 10% for "be carefull or warning"
$warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.10;
if (doubleval($progressCalculated) > doubleval($task->progress * $warningRatio)) {
if (floatval($progressCalculated) > floatval($task->progress * $warningRatio)) {
$badgeClass .= 'badge-danger';
if (empty($tooltip)) {
$tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%';
}
} elseif (doubleval($progressCalculated) > doubleval($task->progress)) { // warning if close at 10%
} elseif (floatval($progressCalculated) > floatval($task->progress)) { // warning if close at 10%
$badgeClass .= 'badge-warning';
if (empty($tooltip)) {
$tooltip = $task->progress.'% < '.$langs->trans("TimeConsumed").' '.$progressCalculated.'%';

View File

@ -339,7 +339,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
$thumbsbyrow = 6;
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent'.($edit ? ' editmode' : '').' tableforfield">';
print '<table class="noborder centpercent'.($edit ? ' editmode' : '').'">';
// Title
if ($foruserprofile) {

View File

@ -283,11 +283,11 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
/**
* Save content of the index.php and/or wrapper.php page
* Save content of the index.php and/or the wrapper.php page
*
* @param string $pathofwebsite Path of website root
* @param string $fileindex Full path of file index.php
* @param string $filetpl File tpl the index.php page redirect to
* @param string $filetpl File tpl the index.php page redirect to (used only if $fileindex is provided)
* @param string $filewrapper Full path of file wrapper.php
* @return boolean True if OK
*/

View File

@ -51,7 +51,7 @@ class modCashDesk extends DolibarrModules
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "CashDesk module";
$this->version = 'dolibarr';
$this->version = 'deprecated';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
$this->picto = 'cash-register';

View File

@ -487,8 +487,10 @@ print load_fiche_titre($title);
$infoarray = dol_getImageSize($dir."/".GETPOST("file", 'alpha'));
$height = $infoarray['height'];
$width = $infoarray['width'];
print '<span class="opacitymedium">'.$langs->trans("CurrentInformationOnImage").': ';
print $langs->trans("Width").': <strong>'.$width.'</strong> x '.$langs->trans("Height").': <strong>'.$height.'</strong></span><br>';
print '<span class="opacitymedium hideonsmartphone">'.$langs->trans("CurrentInformationOnImage").': </span>';
print '<span class="opacitymedium">';
print $langs->trans("Width").': <strong>'.$width.'</strong> x '.$langs->trans("Height").': <strong>'.$height.'</strong>';
print '</span><br>';
print '<br>'."\n";
@ -546,36 +548,42 @@ if (!empty($conf->use_javascript_ajax)) {
print '<legend>'.$langs->trans("Recenter").'</legend>';
print $langs->trans("DefineNewAreaToPick").'...<br>';
print '<br><div class="center">';
print '<div style="border: 1px solid #888888; width: '.$widthforcrop.'px;">';
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$object->entity.'&file='.urlencode($original_file).'" alt="" id="cropbox" width="'.$widthforcrop.'px"/>';
print '</div>';
print '</div><br>';
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.($num ? '&num='.$num : '').'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '
<div class="jc_coords">
'.$langs->trans("NewSizeAfterCropping").':
<label>X1 <input type="number" class="flat maxwidth50" id="x" name="x" /></label>
<label>Y1 <input type="number" class="flat maxwidth50" id="y" name="y" /></label>
<label>X2 <input type="number" class="flat maxwidth50" id="x2" name="x2" /></label>
<label>Y2 <input type="number" class="flat maxwidth50" id="y2" name="y2" /></label>
<label>W <input type="number" class="flat maxwidth50" id="w" name="w" /></label>
<label>H <input type="number" class="flat maxwidth50" id="h" name="h" /></label>
</div>
if (empty($conf->dol_no_mouse_hover)) {
print '<div style="border: 1px solid #888888; width: '.$widthforcrop.'px;">';
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$object->entity.'&file='.urlencode($original_file).'" alt="" id="cropbox" width="'.$widthforcrop.'px"/>';
print '</div>';
print '</div><br>';
<input type="hidden" id="file" name="file" value="'.dol_escape_htmltag($original_file).'" />
<input type="hidden" id="action" name="action" value="confirm_crop" />
<input type="hidden" id="product" name="product" value="'.dol_escape_htmltag($id).'" />
<input type="hidden" id="refsizeforcrop" name="refsizeforcrop" value="'.$refsizeforcrop.'" />
<input type="hidden" id="ratioforcrop" name="ratioforcrop" value="'.$ratioforcrop.'" /><!-- field used by core/lib/lib_photoresize.js -->
<input type="hidden" name="modulepart" value="'.dol_escape_htmltag($modulepart).'" />
<input type="hidden" name="id" value="'.dol_escape_htmltag($id).'" />
<br>
<input type="submit" id="submitcrop" name="submitcrop" class="button" value="'.dol_escape_htmltag($langs->trans("Recenter")).'" />
&nbsp;
<input type="submit" id="cancelcrop" name="cancel" class="button button-cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" />
</form>'."\n";
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.($num ? '&num='.$num : '').'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '
<div class="jc_coords">
'.$langs->trans("NewSizeAfterCropping").':
<label>X1 <input type="number" class="flat maxwidth50" id="x" name="x" /></label>
<label>Y1 <input type="number" class="flat maxwidth50" id="y" name="y" /></label>
<label>X2 <input type="number" class="flat maxwidth50" id="x2" name="x2" /></label>
<label>Y2 <input type="number" class="flat maxwidth50" id="y2" name="y2" /></label>
<label>W <input type="number" class="flat maxwidth50" id="w" name="w" /></label>
<label>H <input type="number" class="flat maxwidth50" id="h" name="h" /></label>
</div>
<input type="hidden" id="file" name="file" value="'.dol_escape_htmltag($original_file).'" />
<input type="hidden" id="action" name="action" value="confirm_crop" />
<input type="hidden" id="product" name="product" value="'.dol_escape_htmltag($id).'" />
<input type="hidden" id="refsizeforcrop" name="refsizeforcrop" value="'.$refsizeforcrop.'" />
<input type="hidden" id="ratioforcrop" name="ratioforcrop" value="'.$ratioforcrop.'" /><!-- field used by core/lib/lib_photoresize.js -->
<input type="hidden" name="modulepart" value="'.dol_escape_htmltag($modulepart).'" />
<input type="hidden" name="id" value="'.dol_escape_htmltag($id).'" />
<br>
<input type="submit" id="submitcrop" name="submitcrop" class="button" value="'.dol_escape_htmltag($langs->trans("Recenter")).'" />
&nbsp;
<input type="submit" id="cancelcrop" name="cancel" class="button button-cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" />
</form>'."\n";
} else {
$langs->load("other");
print '<div class="opacitymedium">'.$langs->trans("FeatureNotAvailableOnDevicesWithoutMouse").'</div>';
}
print '</fieldset>'."\n";
print '<br>';
}

View File

@ -1955,7 +1955,7 @@ class FactureFournisseur extends CommonInvoice
$this->line->remise_percent = $remise_percent;
$this->line->date_start = $date_start;
$this->line->date_end = $date_end;
$this->line->ventil = $ventil;
$this->line->fk_code_ventilation = $ventil;
$this->line->rang = $rang;
$this->line->info_bits = $info_bits;
$this->line->fk_remise_except = $fk_remise_except;

View File

@ -75,6 +75,7 @@ $lineid = GETPOST('lineid', 'int');
$projectid = GETPOST('projectid', 'int');
$origin = GETPOST('origin', 'alpha');
$originid = GETPOST('originid', 'int');
$fac_rec = GETPOST('fac_rec', 'int');
// PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
@ -2211,13 +2212,14 @@ if ($action == 'create') {
// Payment mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
$form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ?GETPOST('mode_reglement_id', 'int') : $mode_reglement_id, 'mode_reglement_id', 'DBIT');
print img_picto('', 'bank', 'class="pictofixedwidth"');
$form->select_types_paiements(GETPOSTISSET('mode_reglement_id') ?GETPOST('mode_reglement_id', 'int') : $mode_reglement_id, 'mode_reglement_id', 'DBIT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
// Bank Account
if (!empty($conf->banque->enabled)) {
print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
print img_picto('', 'bank_account').$form->select_comptes((GETPOSTISSET('fk_account') ?GETPOST('fk_account', 'alpha') : $fk_account), 'fk_account', 0, '', 1, '', 0, '', 1);
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes((GETPOSTISSET('fk_account') ?GETPOST('fk_account', 'alpha') : $fk_account), 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
print '</td></tr>';
}
@ -2227,7 +2229,8 @@ if ($action == 'create') {
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td>';
print img_picto('', 'project').$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
print '</td></tr>';
}

View File

@ -263,7 +263,7 @@ class AutoLoader
* @return bool false unless className now exists
*/
private function loadLastResort($className, $loader = null) {
$loaders = array_unique(static::$rogueLoaders);
$loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
if (isset($loader)) {
if (false === array_search($loader, $loaders))
static::$rogueLoaders[] = $loader;

View File

@ -472,7 +472,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
$classe = (!empty($classes[$keyIndex]) ? $classes[$keyIndex] : '');
if (isset($boardloaded[$classe]) && is_object($boardloaded[$classe])) {
$groupElement['globalStats']['total'] = $boardloaded[$classe]->nb[$globalStatsKey] ? $boardloaded[$classe]->nb[$globalStatsKey] : 0;
$nbTotal = doubleval($groupElement['globalStats']['total']);
$nbTotal = floatval($groupElement['globalStats']['total']);
if ($nbTotal >= 10000) {
$nbTotal = round($nbTotal / 1000, 2).'k';
}

View File

@ -106,16 +106,16 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (75
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (76,'HR','HRV','Croatie',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (77,'CU','CUB','Cuba',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (78,'CY','CYP','Cyprus',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (79,'CZ','CZE','République Tchèque',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (80,'DK','DNK','Danemark',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (79,'CZ','CZE','Czech Republic',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (80,'DK','DNK','Denmark',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (81,'DJ','DJI','Djibouti',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (82,'DM','DMA','Dominique',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (83,'DO','DOM','République Dominicaine',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (84,'EC','ECU','Equateur',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (85,'EG','EGY','Egypte',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (86,'SV','SLV','Salvador',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (88,'ER','ERI','Erythrée',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (82,'DM','DMA','Dominica',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (83,'DO','DOM','Dominican Republic',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (84,'EC','ECU','Republic of Ecuador',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (85,'EG','EGY','Egypt',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (86,'SV','SLV','El Salvador',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (87,'GQ','GNQ','Equatorial Guinea',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (88,'ER','ERI','Eritrea',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (89,'EE','EST','Estonia',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (90,'ET','ETH','Ethiopia',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (91,'FK','FLK','Falkland Islands',1,0);

View File

@ -62,6 +62,7 @@
-- Slovenia (need to check code SI-Id)
-- Taiwan
-- Tunisia
-- United States of America
@ -1120,6 +1121,60 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (1001, 'TN24', '', 0, '', 'Zaghouan');
-- USA States (id country=11)
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'AL', '', 0, 'ALABAMA', 'Alabama');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'AK', '', 0, 'ALASKA', 'Alaska');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'AZ', '', 0, 'ARIZONA', 'Arizona');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'AR', '', 0, 'ARKANSAS', 'Arkansas');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'CA', '', 0, 'CALIFORNIA', 'California');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'CO', '', 0, 'COLORADO', 'Colorado');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'CT', '', 0, 'CONNECTICUT', 'Connecticut');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'DE', '', 0, 'DELAWARE', 'Delaware');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'FL', '', 0, 'FLORIDA', 'Florida');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'GA', '', 0, 'GEORGIA', 'Georgia');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'HI', '', 0, 'HAWAII', 'Hawaii');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'ID', '', 0, 'IDAHO', 'Idaho');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'IL', '', 0, 'ILLINOIS','Illinois');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'IN', '', 0, 'INDIANA', 'Indiana');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'IA', '', 0, 'IOWA', 'Iowa');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'KS', '', 0, 'KANSAS', 'Kansas');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'KY', '', 0, 'KENTUCKY', 'Kentucky');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'LA', '', 0, 'LOUISIANA', 'Louisiana');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'ME', '', 0, 'MAINE', 'Maine');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MD', '', 0, 'MARYLAND', 'Maryland');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MA', '', 0, 'MASSACHUSSETTS', 'Massachusetts');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MI', '', 0, 'MICHIGAN', 'Michigan');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MN', '', 0, 'MINNESOTA', 'Minnesota');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MS', '', 0, 'MISSISSIPPI', 'Mississippi');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MO', '', 0, 'MISSOURI', 'Missouri');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'MT', '', 0, 'MONTANA', 'Montana');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NE', '', 0, 'NEBRASKA', 'Nebraska');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NV', '', 0, 'NEVADA', 'Nevada');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NH', '', 0, 'NEW HAMPSHIRE', 'New Hampshire');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NJ', '', 0, 'NEW JERSEY', 'New Jersey');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NM', '', 0, 'NEW MEXICO', 'New Mexico');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NY', '', 0, 'NEW YORK', 'New York');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'NC', '', 0, 'NORTH CAROLINA', 'North Carolina');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'ND', '', 0, 'NORTH DAKOTA', 'North Dakota');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'OH', '', 0, 'OHIO', 'Ohio');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'OK', '', 0, 'OKLAHOMA', 'Oklahoma');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'OR', '', 0, 'OREGON', 'Oregon');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'PA', '', 0, 'PENNSYLVANIA', 'Pennsylvania');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'RI', '', 0, 'RHODE ISLAND', 'Rhode Island');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'SC', '', 0, 'SOUTH CAROLINA', 'South Carolina');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'SD', '', 0, 'SOUTH DAKOTA', 'South Dakota');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'TN', '', 0, 'TENNESSEE', 'Tennessee');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'TX', '', 0, 'TEXAS', 'Texas');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'UT', '', 0, 'UTAH', 'Utah');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'VT', '', 0, 'VERMONT', 'Vermont');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'VA', '', 0, 'VIRGINIA', 'Virginia');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'WA', '', 0, 'WASHINGTON', 'Washington');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'WV', '', 0, 'WEST VIRGINIA', 'West Virginia');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'WI', '', 0, 'WISCONSIN', 'Wisconsin');
insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (1101, 'WY', '', 0, 'WYOMING', 'Wyoming');
-- Provinces Bolivia (id country=52)
@ -1513,59 +1568,6 @@ INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc
-- Provinces US (id country=11)
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AL', 1101, '', 0, 'ALABAMA', 'Alabama', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AK', 1101, '', 0, 'ALASKA', 'Alaska', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AZ', 1101, '', 0, 'ARIZONA', 'Arizona', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AR', 1101, '', 0, 'ARKANSAS', 'Arkansas', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('CA', 1101, '', 0, 'CALIFORNIA', 'California', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('CO', 1101, '', 0, 'COLORADO', 'Colorado', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('CT', 1101, '', 0, 'CONNECTICUT', 'Connecticut', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('DE', 1101, '', 0, 'DELAWARE', 'Delaware', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('FL', 1101, '', 0, 'FLORIDA', 'Florida', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('GA', 1101, '', 0, 'GEORGIA', 'Georgia', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('HI', 1101, '', 0, 'HAWAII', 'Hawaii', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('ID', 1101, '', 0, 'IDAHO', 'Idaho', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('IL', 1101, '', 0, 'ILLINOIS','Illinois', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('IN', 1101, '', 0, 'INDIANA', 'Indiana', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('IA', 1101, '', 0, 'IOWA', 'Iowa', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('KS', 1101, '', 0, 'KANSAS', 'Kansas', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('KY', 1101, '', 0, 'KENTUCKY', 'Kentucky', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('LA', 1101, '', 0, 'LOUISIANA', 'Louisiana', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('ME', 1101, '', 0, 'MAINE', 'Maine', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MD', 1101, '', 0, 'MARYLAND', 'Maryland', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MA', 1101, '', 0, 'MASSACHUSSETTS', 'Massachusetts', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MI', 1101, '', 0, 'MICHIGAN', 'Michigan', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MN', 1101, '', 0, 'MINNESOTA', 'Minnesota', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MS', 1101, '', 0, 'MISSISSIPPI', 'Mississippi', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MO', 1101, '', 0, 'MISSOURI', 'Missouri', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MT', 1101, '', 0, 'MONTANA', 'Montana', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NE', 1101, '', 0, 'NEBRASKA', 'Nebraska', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NV', 1101, '', 0, 'NEVADA', 'Nevada', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NH', 1101, '', 0, 'NEW HAMPSHIRE', 'New Hampshire', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NJ', 1101, '', 0, 'NEW JERSEY', 'New Jersey', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NM', 1101, '', 0, 'NEW MEXICO', 'New Mexico', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NY', 1101, '', 0, 'NEW YORK', 'New York', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NC', 1101, '', 0, 'NORTH CAROLINA', 'North Carolina', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('ND', 1101, '', 0, 'NORTH DAKOTA', 'North Dakota', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('OH', 1101, '', 0, 'OHIO', 'Ohio', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('OK', 1101, '', 0, 'OKLAHOMA', 'Oklahoma', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('OR', 1101, '', 0, 'OREGON', 'Oregon', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('PA', 1101, '', 0, 'PENNSYLVANIA', 'Pennsylvania', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('RI', 1101, '', 0, 'RHODE ISLAND', 'Rhode Island', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('SC', 1101, '', 0, 'SOUTH CAROLINA', 'South Carolina', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('SD', 1101, '', 0, 'SOUTH DAKOTA', 'South Dakota', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('TN', 1101, '', 0, 'TENNESSEE', 'Tennessee', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('TX', 1101, '', 0, 'TEXAS', 'Texas', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('UT', 1101, '', 0, 'UTAH', 'Utah', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('VT', 1101, '', 0, 'VERMONT', 'Vermont', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('VA', 1101, '', 0, 'VIRGINIA', 'Virginia', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WA', 1101, '', 0, 'WASHINGTON', 'Washington', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WV', 1101, '', 0, 'WEST VIRGINIA', 'West Virginia', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WI', 1101, '', 0, 'WISCONSIN', 'Wisconsin', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WY', 1101, '', 0, 'WYOMING', 'Wyoming', 1);
-- San Salvador (id country=86)
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SS', 8601, '', 0, '', 'San Salvador', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('SA', 8603, '', 0, '', 'Santa Ana', 1);

View File

@ -492,12 +492,14 @@ CREATE TABLE llx_knowledgemanagement_knowledgerecord(
model_pdf varchar(255),
question text NOT NULL,
answer text,
url varchar(255),
fk_ticket integer,
status integer NOT NULL
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN fk_ticket integer;
ALTER TABLE llx_knowledgemanagement_knowledgerecord ADD COLUMN url varchar(255);
create table llx_knowledgemanagement_knowledgerecord_extrafields

View File

@ -28,6 +28,7 @@ CREATE TABLE llx_knowledgemanagement_knowledgerecord(
model_pdf varchar(255),
question text NOT NULL,
answer text,
url varchar(255),
fk_ticket integer,
status integer NOT NULL
-- END MODULEBUILDER FIELDS

View File

@ -2103,7 +2103,6 @@ PDF_SHOW_PROJECT=Show project on document
ShowProjectLabel=Project Label
PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated in 2 different languages in the same generated PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF.
FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book.
FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled
RssNote=Note: Each RSS feed definition provides a widget that you must enable to have it available in dashboard
JumpToBoxes=Jump to Setup -> Widgets
MeasuringUnitTypeDesc=Use here a value like "size", "surface", "volume", "weight", "time"

View File

@ -129,6 +129,7 @@ ClosedByLogin=User login who closed
FileWasRemoved=File %s was removed
DirWasRemoved=Directory %s was removed
FeatureNotYetAvailable=Feature not yet available in the current version
FeatureNotAvailableOnDevicesWithoutMouse=Feature not available on devices without mouse
FeaturesSupported=Supported features
Width=Width
Height=Height
@ -263,7 +264,7 @@ ContactCreatedByEmailCollector=Contact/address created by email collector from e
ProjectCreatedByEmailCollector=Project created by email collector from email MSGID %s
TicketCreatedByEmailCollector=Ticket created by email collector from email MSGID %s
OpeningHoursFormatDesc=Use a - to separate opening and closing hours.<br>Use a space to enter different ranges.<br>Example: 8-12 14-18
PrefixSession=Prefix for session ID
SuffixSessionName=Suffix for session name
##### Export #####
ExportsArea=Exports area

View File

@ -131,7 +131,7 @@ $formproject = new FormProjets($db);
if ($object->id > 0) {
$title = $langs->trans("Agenda");
//if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En';
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Agenda';
llxHeader('', $title, $help_url);
if (!empty($conf->notification->enabled)) {

View File

@ -1181,7 +1181,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($type != 1 && !empty($conf->stock->enabled)) {
// Default warehouse
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'pictofixedwidth');
print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"');
print $formproduct->selectWarehouses(GETPOST('fk_default_warehouse'), 'fk_default_warehouse', 'warehouseopen', 1);
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&amp;backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit').'">';
print '<span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddWarehouse").'"></span>';

View File

@ -14,7 +14,7 @@
* Copyright (C) 2014 Ion agorria <ion@agorria.com>
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2017 Gustavo Novaro
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -372,6 +372,9 @@ class Product extends CommonObject
public $oldcopy;
/**
* @var int Default warehouse Id
*/
public $fk_default_warehouse;
/**
* @var int ID
@ -388,6 +391,10 @@ class Product extends CommonObject
* @see $ref_supplier
*/
public $ref_fourn;
/**
* @var string ref supplier
*/
public $ref_supplier;
/**
@ -1627,6 +1634,36 @@ class Product extends CommonObject
}
}
/**
* used to check if price have really change to avoid log pollution
*
* @param int $level price level to change
* @return array
*/
private function getArrayForPriceCompare($level = 0)
{
$testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly');
foreach ($testExit as $field){
if (!isset($this->$field[$level])) {
return array();
}
}
$lastPrice = array(
'level' => $level ? $level : 1,
'multiprices' => doubleval($this->multiprices[$level]),
'multiprices_ttc' => doubleval($this->multiprices_ttc[$level]),
'multiprices_base_type' => $this->multiprices_base_type[$level],
'multiprices_min' => doubleval($this->multiprices_min[$level]),
'multiprices_min_ttc' => doubleval($this->multiprices_min_ttc[$level]),
'multiprices_tva_tx' => doubleval($this->multiprices_tva_tx[$level]),
'multiprices_recuperableonly' => doubleval($this->multiprices_recuperableonly[$level]),
);
return $lastPrice;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -1975,6 +2012,8 @@ class Product extends CommonObject
{
global $conf, $langs;
$lastPriceData = $this->getArrayForPriceCompare($level); // temporary store current price before update
$id = $this->id;
dol_syslog(get_class($this)."::update_price id=".$id." newprice=".$newprice." newpricebase=".$newpricebase." newminprice=".$newminprice." level=".$level." npr=".$newnpr." newdefaultvatcode=".$newdefaultvatcode);
@ -2107,7 +2146,11 @@ class Product extends CommonObject
// Price by quantity
$this->price_by_qty = $newpbq;
$this->_log_price($user, $level); // Save price for level into table product_price
// check if price have really change before log
$newPriceData = $this->getArrayForPriceCompare($level);
if (!empty(array_diff_assoc($newPriceData, $lastPriceData)) || empty($conf->global->PRODUIT_MULTIPRICES)) {
$this->_log_price($user, $level); // Save price for level into table product_price
}
$this->level = $level; // Store level of price edited for trigger

View File

@ -1470,7 +1470,6 @@ if ((empty($conf->global->PRODUIT_CUSTOMER_PRICES) || $action == 'showlog_defaul
}
print '<td class="center">'.$langs->trans("PriceBase").'</td>';
print $conf->global->PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL;
if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
print '<td class="right">'.$langs->trans("DefaultTaxRate").'</td>';
}

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2016 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -612,6 +613,14 @@ if ($action == 'create') {
}
$sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.tobatch, p.fk_product_type as type, p.price, p.price_ttc, p.entity,";
$sql .= "p.tosell, p.tobuy,";
$sql .= "p.accountancy_code_sell,";
$sql .= "p.accountancy_code_sell_intra,";
$sql .= "p.accountancy_code_sell_export,";
$sql .= "p.accountancy_code_buy,";
$sql .= "p.accountancy_code_buy_intra,";
$sql .= "p.accountancy_code_buy_export,";
$sql .= 'p.barcode,';
if ($separatedPMP) {
$sql .= " pa.pmp as ppmp,";
} else {
@ -683,6 +692,15 @@ if ($action == 'create') {
$productstatic->entity = $objp->entity;
$productstatic->status_batch = $objp->tobatch;
$productstatic->fk_unit = $objp->fk_unit;
$productstatic->status = $objp->tosell;
$productstatic->status_buy = $objp->tobuy;
$productstatic->barcode = $objp->barcode;
$productstatic->accountancy_code_sell = $objp->accountancy_code_sell;
$productstatic->accountancy_code_sell_intra = $objp->accountancy_code_sell_intra;
$productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export;
$productstatic->accountancy_code_buy = $objp->accountancy_code_buy;
$productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra;
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export;
print $productstatic->getNomUrl(1, 'stock', 16);
print '</td>';
@ -768,6 +786,7 @@ if ($action == 'create') {
}
print '<td class="liste_total">&nbsp;</td>';
print '<td class="liste_total">&nbsp;</td>';
print '<td class="liste_total">&nbsp;</td>';
print '</tr>';
} else {
dol_print_error($db);

View File

@ -150,7 +150,7 @@ class MouvementStock extends CommonObject
*/
public function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0, $disablestockchangeforsubproduct = 0)
{
// phpcs:disable
// phpcs:enable
global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -160,26 +160,26 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this)."::_create start userid=$user->id, fk_product=$fk_product, warehouse_id=$entrepot_id, qty=$qty, type=$type, price=$price, label=$label, inventorycode=$inventorycode, datem=".$datem.", eatby=".$eatby.", sellby=".$sellby.", batch=".$batch.", skip_batch=".$skip_batch);
// start hook at beginning
global $action, $hookmanager;
$hookmanager->initHooks(array('mouvementstock'));
// Hook of thirdparty module
if (is_object($hookmanager)) {
global $action, $hookmanager;
$hookmanager->initHooks(array('mouvementstock'));
// Hook of thirdparty module
if (is_object($hookmanager)) {
$parameters = array(
'currentcontext' => 'mouvementstock',
'user' => &$user,
'fk_product' => &$fk_product,
'entrepot_id' => &$entrepot_id,
'qty' => &$qty,
'type' => &$type,
'price' => &$price,
'label' => &$label,
'inventorycode' => &$inventorycode,
'datem' => &$datem,
'eatby' => &$eatby,
'sellby' => &$sellby,
'batch' => &$batch,
'skip_batch' => &$skip_batch,
'id_product_batch' => &$id_product_batch
'currentcontext' => 'mouvementstock',
'user' => &$user,
'fk_product' => &$fk_product,
'entrepot_id' => &$entrepot_id,
'qty' => &$qty,
'type' => &$type,
'price' => &$price,
'label' => &$label,
'inventorycode' => &$inventorycode,
'datem' => &$datem,
'eatby' => &$eatby,
'sellby' => &$sellby,
'batch' => &$batch,
'skip_batch' => &$skip_batch,
'id_product_batch' => &$id_product_batch
);
$reshook = $hookmanager->executeHooks('stockMovementCreate', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
@ -190,8 +190,8 @@ class MouvementStock extends CommonObject
} elseif ($reshook > 0) {
return $hookmanager->resPrint;
}
}
// end hook at beginning
}
// end hook at beginning
// Clean parameters
$price = price2num($price, 'MU'); // Clean value for the casse we receive a float zero value, to have it a real zero value.
@ -244,10 +244,8 @@ class MouvementStock extends CommonObject
$product->load_stock('novirtual');
// Test if product require batch data. If yes, and there is not, we throw an error.
if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch)
{
if (empty($batch))
{
if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) {
if (empty($batch)) {
$langs->load("errors");
$this->errors[] = $langs->transnoentitiesnoconv("ErrorTryToMakeMoveOnProductRequiringBatchData", $product->ref);
dol_syslog("Try to make a movement of a product with status_batch on without any batch data");
@ -266,23 +264,17 @@ class MouvementStock extends CommonObject
$sql .= " WHERE pb.fk_product = ".$fk_product." AND pb.batch = '".$this->db->escape($batch)."'";
dol_syslog(get_class($this)."::_create scan serial for this product to check if eatby and sellby match", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
if ($num > 0)
{
while ($i < $num)
{
if ($num > 0) {
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
if ($obj->eatby)
{
if ($eatby)
{
if ($obj->eatby) {
if ($eatby) {
$tmparray = dol_getdate($eatby, true);
$eatbywithouthour = dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']);
if ($this->db->jdate($obj->eatby) != $eatby && $this->db->jdate($obj->eatby) != $eatbywithouthour) // We test date without hours and with hours for backward compatibility
{
if ($this->db->jdate($obj->eatby) != $eatby && $this->db->jdate($obj->eatby) != $eatbywithouthour) { // We test date without hours and with hours for backward compatibility
// If found and eatby/sellby defined into table and provided and differs, return error
$langs->load("stocks");
$this->errors[] = $langs->transnoentitiesnoconv("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->eatby), 'dayhour'), dol_print_date($eatbywithouthour, 'dayhour'));
@ -294,14 +286,12 @@ class MouvementStock extends CommonObject
$eatby = $obj->eatby; // If found and eatby/sellby defined into table and not provided, we take value from table
}
} else {
if ($eatby) // If found and eatby/sellby not defined into table and provided, we update table
{
if ($eatby) { // If found and eatby/sellby not defined into table and provided, we update table
$productlot = new Productlot($this->db);
$result = $productlot->fetch($obj->rowid);
$productlot->eatby = $eatby;
$result = $productlot->update($user);
if ($result <= 0)
{
if ($result <= 0) {
$this->error = $productlot->error;
$this->errors = $productlot->errors;
$this->db->rollback();
@ -309,14 +299,11 @@ class MouvementStock extends CommonObject
}
}
}
if ($obj->sellby)
{
if ($sellby)
{
if ($obj->sellby) {
if ($sellby) {
$tmparray = dol_getdate($sellby, true);
$sellbywithouthour = dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']);
if ($this->db->jdate($obj->sellby) != $sellby && $this->db->jdate($obj->sellby) != $sellbywithouthour) // We test date without hours and with hours for backward compatibility
{
if ($this->db->jdate($obj->sellby) != $sellby && $this->db->jdate($obj->sellby) != $sellbywithouthour) { // We test date without hours and with hours for backward compatibility
// If found and eatby/sellby defined into table and provided and differs, return error
$this->errors[] = $langs->transnoentitiesnoconv("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->sellby)), dol_print_date($sellby));
dol_syslog($langs->transnoentities("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->sellby)), dol_print_date($sellby)), LOG_ERR);
@ -326,17 +313,13 @@ class MouvementStock extends CommonObject
} else {
$sellby = $obj->sellby; // If found and eatby/sellby defined into table and not provided, we take value from table
}
}
else
{
if ($sellby) // If found and eatby/sellby not defined into table and provided, we update table
{
} else {
if ($sellby) { // If found and eatby/sellby not defined into table and provided, we update table
$productlot = new Productlot($this->db);
$result = $productlot->fetch($obj->rowid);
$productlot->sellby = $sellby;
$result = $productlot->update($user);
if ($result <= 0)
{
if ($result <= 0) {
$this->error = $productlot->error;
$this->errors = $productlot->errors;
$this->db->rollback();
@ -347,9 +330,7 @@ class MouvementStock extends CommonObject
$i++;
}
}
else // If not found, we add record
{
} else { // If not found, we add record
$productlot = new Productlot($this->db);
$productlot->entity = $conf->entity;
$productlot->fk_product = $fk_product;
@ -358,17 +339,14 @@ class MouvementStock extends CommonObject
$productlot->eatby = $eatby;
$productlot->sellby = $sellby;
$result = $productlot->create($user);
if ($result <= 0)
{
if ($result <= 0) {
$this->error = $productlot->error;
$this->errors = $productlot->errors;
$this->db->rollback();
return -4;
}
}
}
else
{
} else {
dol_print_error($this->db);
$this->db->rollback();
return -1;
@ -381,21 +359,17 @@ class MouvementStock extends CommonObject
// Check if stock is enough when qty is < 0
// Note that qty should be > 0 with type 0 or 3, < 0 with type 1 or 2.
if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER))
{
if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch)
{
if ($movestock && $qty < 0 && empty($conf->global->STOCK_ALLOW_NEGATIVE_TRANSFER)) {
if (!empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) {
$foundforbatch = 0;
$qtyisnotenough = 0;
foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch)
{
foreach ($product->stock_warehouse[$entrepot_id]->detail_batch as $batchcursor => $prodbatch) {
if ($batch != $batchcursor) continue;
$foundforbatch = 1;
if ($prodbatch->qty < abs($qty)) $qtyisnotenough = $prodbatch->qty;
break;
}
if (!$foundforbatch || $qtyisnotenough)
{
if (!$foundforbatch || $qtyisnotenough) {
$langs->load("stocks");
include_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
$tmpwarehouse = new Entrepot($this->db);
@ -406,11 +380,8 @@ class MouvementStock extends CommonObject
$this->db->rollback();
return -8;
}
}
else
{
if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty))
{
} else {
if (empty($product->stock_warehouse[$entrepot_id]->real) || $product->stock_warehouse[$entrepot_id]->real < abs($qty)) {
$langs->load("stocks");
$this->error = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref;
$this->errors[] = $langs->trans('qtyToTranferIsNotEnough').' : '.$product->ref;
@ -420,8 +391,7 @@ class MouvementStock extends CommonObject
}
}
if ($movestock && $entrepot_id > 0) // Change stock for current product, change for subproduct is done after
{
if ($movestock && $entrepot_id > 0) { // Change stock for current product, change for subproduct is done after
// Set $origintype, fk_origin, fk_project
$fk_project = 0;
if (!empty($this->origin)) { // This is set by caller for tracking reason
@ -431,10 +401,8 @@ class MouvementStock extends CommonObject
$fk_project = $fk_origin;
} else {
$res = $this->origin->fetch($fk_origin);
if ($res > 0)
{
if (!empty($this->origin->fk_project))
{
if ($res > 0) {
if (!empty($this->origin->fk_project)) {
$fk_project = $this->origin->fk_project;
}
}
@ -466,13 +434,10 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this)."::_create insert record into stock_mouvement", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
if ($resql) {
$mvid = $this->db->last_insert_id(MAIN_DB_PREFIX."stock_mouvement");
$this->id = $mvid;
}
else
{
} else {
$this->error = $this->db->lasterror();
$this->errors[] = $this->error;
$error = -1;
@ -485,18 +450,15 @@ class MouvementStock extends CommonObject
// Test if there is already a record for couple (warehouse / product), so later we will make an update or create.
$alreadyarecord = 0;
if (!$error)
{
if (!$error) {
$sql = "SELECT rowid, reel FROM ".MAIN_DB_PREFIX."product_stock";
$sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product); // This is a unique key
dol_syslog(get_class($this)."::_create check if a record already exists in product_stock", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
if ($resql) {
$obj = $this->db->fetch_object($resql);
if ($obj)
{
if ($obj) {
$alreadyarecord = 1;
$oldqtywarehouse = $obj->reel;
$fk_product_stock = $obj->rowid;
@ -510,10 +472,8 @@ class MouvementStock extends CommonObject
// Calculate new AWP (PMP)
$newpmp = 0;
if (!$error)
{
if ($type == 0 || $type == 3)
{
if (!$error) {
if ($type == 0 || $type == 3) {
// After a stock increase
// Note: PMP is calculated on stock input only (type of movement = 0 or 3). If type == 0 or 3, qty should be > 0.
// Note: Price should always be >0 or 0. PMP should be always >0 (calculated on input)
@ -540,10 +500,8 @@ class MouvementStock extends CommonObject
}
}
// Update stock quantity
if (!$error)
{
if ($alreadyarecord > 0)
{
if (!$error) {
if ($alreadyarecord > 0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."product_stock SET reel = reel + ".((float) $qty);
$sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product);
} else {
@ -554,39 +512,29 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this)."::_create update stock value", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql)
{
if (!$resql) {
$this->errors[] = $this->db->lasterror();
$error = -3;
}
elseif (empty($fk_product_stock))
{
} elseif (empty($fk_product_stock)) {
$fk_product_stock = $this->db->last_insert_id(MAIN_DB_PREFIX."product_stock");
}
}
// Update detail stock for batch product
if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch)
{
if (!$error && !empty($conf->productbatch->enabled) && $product->hasbatch() && !$skip_batch) {
// check unicity for serial numbered equipments ( different for lots managed products)
if ( $product->status_batch == 2 && $qty > 0 )
{
if ( $this->getBatchCount($fk_product, $batch) > 0 )
{
if ( $product->status_batch == 2 && $qty > 0 ) {
if ( $this->getBatchCount($fk_product, $batch) > 0 ) {
$error++;
$this->errors[] = $langs->trans("SerialNumberAlreadyInUse", $batch, $product->ref);
}
elseif ( $qty > 1 )
{
} elseif ( $qty > 1 ) {
$error++;
$this->errors[] = $langs->trans("TooManyQtyForSerialNumber", $product->ref, $batch);
}
}
if ( ! $error )
{
if ($id_product_batch > 0)
{
if ( ! $error ) {
if ($id_product_batch > 0) {
$result = $this->createBatch($id_product_batch, $qty);
} else {
$param_batch = array('fk_product_stock' =>$fk_product_stock, 'batchnumber'=>$batch);
@ -597,8 +545,7 @@ class MouvementStock extends CommonObject
}
// Update PMP and denormalized value of stock qty at product level
if (!$error)
{
if (!$error) {
$newpmp = price2num($newpmp, 'MU');
// $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".$newpmp.", stock = ".$this->db->ifsql("stock IS NULL", 0, "stock") . " + ".$qty;
@ -610,8 +557,7 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this)."::_create update AWP", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql)
{
if (!$resql) {
$this->errors[] = $this->db->lasterror();
$error = -4;
}
@ -625,26 +571,21 @@ class MouvementStock extends CommonObject
}
// Add movement for sub products (recursive call)
if (!$error && !empty($conf->global->PRODUIT_SOUSPRODUITS) && empty($conf->global->INDEPENDANT_SUBPRODUCT_STOCK) && empty($disablestockchangeforsubproduct))
{
if (!$error && !empty($conf->global->PRODUIT_SOUSPRODUITS) && empty($conf->global->INDEPENDANT_SUBPRODUCT_STOCK) && empty($disablestockchangeforsubproduct)) {
$error = $this->_createSubProduct($user, $fk_product, $entrepot_id, $qty, $type, 0, $label, $inventorycode); // we use 0 as price, because AWP must not change for subproduct
}
if ($movestock && !$error)
{
if ($movestock && !$error) {
// Call trigger
$result = $this->call_trigger('STOCK_MOVEMENT', $user);
if ($result < 0) $error++;
// End call triggers
}
if (!$error)
{
if (!$error) {
$this->db->commit();
return $mvid;
}
else
{
} else {
$this->db->rollback();
dol_syslog(get_class($this)."::_create error code=".$error, LOG_ERR);
return -6;
@ -768,35 +709,27 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this)."::_createSubProduct for parent product ".$idProduct, LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
if ($resql) {
$i = 0;
while ($obj = $this->db->fetch_object($resql))
{
while ($obj = $this->db->fetch_object($resql)) {
$pids[$i] = $obj->fk_product_fils;
$pqtys[$i] = $obj->qty;
$i++;
}
$this->db->free($resql);
}
else
{
} else {
$error = -2;
}
// Create movement for each subproduct
foreach ($pids as $key => $value)
{
if (!$error)
{
foreach ($pids as $key => $value) {
if (!$error) {
$tmpmove = dol_clone($this, 1);
$result = $tmpmove->_create($user, $pids[$key], $entrepot_id, ($qty * $pqtys[$key]), $type, 0, $label, $inventorycode); // This will also call _createSubProduct making this recursive
if ($result < 0)
{
if ($result < 0) {
$this->error = $tmpmove->error;
$this->errors = array_merge($this->errors, $tmpmove->errors);
if ($result == -2)
{
if ($result == -2) {
$this->errors[] = $langs->trans("ErrorNoteAlsoThatSubProductCantBeFollowedByLot");
}
$error = $result;
@ -862,27 +795,26 @@ class MouvementStock extends CommonObject
}
/**
* Return nb of subproducts lines for a product
*
* @param int $id Id of product
* @return int <0 if KO, nb of subproducts if OK
* @deprecated A count($product->getChildsArbo($id,1)) is same. No reason to have this in this class.
*/
/*
public function nbOfSubProducts($id)
{
$nbSP=0;
// /**
// * Return nb of subproducts lines for a product
// *
// * @param int $id Id of product
// * @return int <0 if KO, nb of subproducts if OK
// * @deprecated A count($product->getChildsArbo($id,1)) is same. No reason to have this in this class.
// */
// public function nbOfSubProducts($id)
// {
// $nbSP=0;
$resql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."product_association";
$resql.= " WHERE fk_product_pere = ".((int) $id);
if ($this->db->query($resql))
{
$obj=$this->db->fetch_object($resql);
$nbSP=$obj->nb;
}
return $nbSP;
}*/
// $resql = "SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."product_association";
// $resql.= " WHERE fk_product_pere = ".((int) $id);
// if ($this->db->query($resql))
// {
// $obj=$this->db->fetch_object($resql);
// $nbSP=$obj->nb;
// }
// return $nbSP;
// }
/**
* Count number of product in stock before a specific date
@ -901,8 +833,7 @@ class MouvementStock extends CommonObject
dol_syslog(get_class($this).__METHOD__.'', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
if ($resql) {
$obj = $this->db->fetch_object($resql);
if ($obj) $nb = $obj->nb;
return (empty($nb) ? 0 : $nb);
@ -930,19 +861,16 @@ class MouvementStock extends CommonObject
$result = 0;
// Try to find an existing record with same batch number or id
if (is_numeric($dluo))
{
if (is_numeric($dluo)) {
$result = $pdluo->fetch($dluo);
if (empty($pdluo->id))
{
if (empty($pdluo->id)) {
// We didn't find the line. May be it was deleted before by a previous move in same transaction.
$this->error = 'Error. You ask a move on a record for a serial that does not exists anymore. May be you take the same serial on same warehouse several times in same shipment or it was used by another shipment. Remove this shipment and prepare another one.';
$this->errors[] = $this->error;
$result = -2;
}
} elseif (is_array($dluo)) {
if (isset($dluo['fk_product_stock']))
{
if (isset($dluo['fk_product_stock'])) {
$vfk_product_stock = $dluo['fk_product_stock'];
$vbatchnumber = $dluo['batchnumber'];
@ -956,8 +884,7 @@ class MouvementStock extends CommonObject
$result = -1;
}
if ($result >= 0)
{
if ($result >= 0) {
// No error
if ($pdluo->id > 0) { // product_batch record found
//print "Avant ".$pdluo->qty." Apres ".($pdluo->qty + $qty)."<br>";
@ -975,8 +902,7 @@ class MouvementStock extends CommonObject
$pdluo->batch = $vbatchnumber;
$result = $pdluo->create($user, 1);
if ($result < 0)
{
if ($result < 0) {
$this->error = $pdluo->error;
$this->errors = $pdluo->errors;
}
@ -1036,6 +962,10 @@ class MouvementStock extends CommonObject
require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php';
$origin = new Reception($this->db);
break;
case 'inventory':
require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php';
$origin = new Inventory($this->db);
break;
default:
if ($origintype) {

View File

@ -3332,17 +3332,58 @@ class Societe extends CommonObject
{
// phpcs:enable
if ($this->id) {
$sql = "UPDATE ".MAIN_DB_PREFIX."societe";
$sql .= " SET parent = ".($id > 0 ? $id : "null");
$sql .= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this).'::set_parent', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$this->parent = $id;
// Check if the id we want to add as parent has not already one parent that is the current id we try to update
$sameparent = $this->validateFamilyTree($id, $this->id, 0);
if ($sameparent < 0) {
return -1;
} elseif ($sameparent == 1) {
setEventMessages('ParentCompanyToAddIsAlreadyAChildOfModifiedCompany', null, 'warnings');
return -1;
} else {
$sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id);
dol_syslog(get_class($this).'::set_parent', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$this->parent = $id;
return 1;
} else {
return -1;
}
}
} else {
return -1;
}
}
/**
* Check if a thirdparty $idchild is or not inside the parents (or grand parents) of another thirdparty id $idparent.
*
* @param int $idparent Id of thirdparty to check
* @param int $idchild Id of thirdparty to compare to
* @param int $counter Counter to protect against infinite loops
* @return int <0 if KO, 0 if OK or 1 if at some level a parent company was the child to compare to
*/
public function validateFamilyTree($idparent, $idchild, $counter = 0)
{
if ($counter > 100) {
dol_syslog("Too high level of parent - child for company. May be an infinite loop ?", LOG_WARNING);
}
$sql = 'SELECT s.parent';
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql .= ' WHERE rowid = '.$idparent;
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
if ($obj->parent == '') {
return 0;
} elseif ($obj->parent == $idchild) {
return 1;
} else {
return -1;
$sameparent = $this->validateFamilyTree($obj->parent, $idchild, ($counter + 1));
}
return $sameparent;
} else {
return -1;
}

View File

@ -467,10 +467,10 @@ if ($search_sale && $search_sale != '-1') {
$sql .= ", sc.fk_soc, sc.fk_user";
}
// We'll need these fields in order to filter by categ
if ($search_categ_cus) {
if ($search_categ_cus && $search_categ_cus!=-1) {
$sql .= ", cc.fk_categorie, cc.fk_soc";
}
if ($search_categ_sup) {
if ($search_categ_sup && $search_categ_sup!=-1) {
$sql .= ", cs.fk_categorie, cs.fk_soc";
}
// Add fields from extrafields
@ -494,10 +494,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_effectif as staff on (staff.id = s.fk_ef
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as region on (region. code_region = state.fk_region)";
// We'll need this table joined to the select in order to filter by categ
if (!empty($search_categ_cus)) {
if (!empty($search_categ_cus) && $search_categ_cus!=-1) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
}
if (!empty($search_categ_sup)) {
if (!empty($search_categ_sup) && $search_categ_sup!=-1) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_fournisseur as cs ON s.rowid = cs.fk_soc"; // We'll need this table joined to the select in order to filter by categ
}
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_stcomm as st ON s.fk_stcomm = st.id";

View File

@ -51,7 +51,12 @@ if (!empty($conf->global->THEME_DARKMODEENABLED)) {
}*/
div.tabsAction > a.butAction, div.tabsAction > a.butActionRefused, div.tabsAction > a.butActionDelete,
div.tabsAction > span.butAction, div.tabsAction > span.butActionRefused, div.tabsAction > span.butActionDelete,
div.tabsAction > div.divButAction > span.butAction {
div.tabsAction > div.divButAction > span.butAction,
div.tabsAction > div.divButAction > span.butActionDelete,
div.tabsAction > div.divButAction > span.butActionRefused,
div.tabsAction > div.divButAction > a.butAction,
div.tabsAction > div.divButAction > a.butActionDelete,
div.tabsAction > div.divButAction > a.butActionRefused {
margin-bottom: 1.4em !important;
margin-right: 0px !important;
}
@ -303,6 +308,23 @@ div.pagination li:first-child a.btnTitle{
}
}
/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
@media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
{
.butAction, .butActionRefused, .butActionDelete {
font-size: 0.9em;
}
}
/* smartphone */
@media only screen and (max-width: 767px)
{
.butAction, .butActionRefused, .butActionDelete {
font-size: 0.85em;
}
}
<?php if (!empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?>
.butActionRefused, .butActionNewRefused, .btnTitle.refused {
display: none !important;

View File

@ -902,8 +902,8 @@ span.fa.fa-plus-circle.paddingleft {
height: 28px;
vertical-align: middle;
}
.divsocialnetwork:not(:first-child) {
padding-left: 20px;
.divsocialnetwork:not(:last-child) {
padding-<?php print $right; ?>: 20px;
}
div.divsearchfield {
float: <?php print $left; ?>;
@ -1027,6 +1027,7 @@ ul.attendees li {
list-style-type: none;
padding-top:1px;
padding-bottom:1px;
line-height: 1.6em;
}
.googlerefreshcal {
padding-top: 4px;
@ -1472,6 +1473,10 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select
width: calc(100% - 40px) !important;
display: inline-block;
}
select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-selection), input.widthcentpercentminusxx {
width: calc(100% - 70px) !important;
display: inline-block;
}
.logopublicpayment #dolpaymentlogo {
max-width: 260px;
@ -6770,10 +6775,14 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
/* For copy-paste feature */
/* ============================================================================== */
span.clipboardCPValueToPrint {
display: inline-block;
}
span.clipboardCPValue.hidewithsize {
width: 0 !important;
display: inline-block;
color: transparent;
white-space: nowrap;
}
.clipboardCPShowOnHover .clipboardCPButton {

View File

@ -379,6 +379,23 @@ div.pagination .btnTitle:hover .btnTitle-label{
}
}
/* rule to reduce top menu - 3rd reduction: The menu for user is on left */
@media only screen and (max-width: <?php echo empty($conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
{
.butAction, .butActionRefused, .butActionDelete {
font-size: 0.9em;
}
}
/* smartphone */
@media only screen and (max-width: 767px)
{
.butAction, .butActionRefused, .butActionDelete {
font-size: 0.85em;
}
}
<?php if (!empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) && (!$user->admin)) { ?>
.butActionRefused, .butActionNewRefused, .btnTitle.refused {
display: none !important;

View File

@ -1002,8 +1002,8 @@ body[class*="colorblind-"] .text-success{
height: 28px;
vertical-align: middle;
}
.divsocialnetwork:not(:first-child) {
padding-left: 20px;
.divsocialnetwork:not(:last-child) {
padding-<?php print $right; ?>: 20px;
}
div.divsearchfield {
float: <?php print $left; ?>;
@ -1496,6 +1496,18 @@ table[summary="list_of_modules"] .fa-cog {
padding-right: 10px !important;
}
.hideonsmartphone { display: none; }
.hideonsmartphoneimp { display: none !important; }
select.minwidth100imp, select.minwidth100, select.minwidth200, select.minwidth200imp, select.minwidth300 {
width: calc(100% - 40px) !important;
display: inline-block;
}
select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-selection), input.widthcentpercentminusxx {
width: calc(100% - 70px) !important;
display: inline-block;
}
.poweredbyimg {
width: 48px;
}
@ -1580,8 +1592,6 @@ table[summary="list_of_modules"] .fa-cog {
line-height: 1.4em;
}
.hideonsmartphone { display: none; }
.hideonsmartphoneimp { display: none !important; }
.noenlargeonsmartphone { width : 50px !important; display: inline !important; }
.maxwidthonsmartphone, #search_newcompany.ui-autocomplete-input { max-width: 100px; }
.maxwidth50onsmartphone { max-width: 40px; }
@ -6634,10 +6644,14 @@ div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before
/* For copy-paste feature */
/* ============================================================================== */
span.clipboardCPValueToPrint {
display: inline-block;
}
span.clipboardCPValue.hidewithsize {
width: 0 !important;
display: inline-block;
color: transparent;
white-space: nowrap;
}
.clipboardCPShowOnHover .clipboardCPButton {

View File

@ -206,15 +206,15 @@ while ($i <= $MAXAGENDA) {
print '<td class="maxwidth50onsmartphone">'.$langs->trans("AgendaExtNb", $key)."</td>";
// Name
$name_value = (GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key) ?GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$key) : (empty($object->conf->$name) ? '' : $object->conf->$name));
print '<td class="maxwidth50onsmartphone"><input type="text" class="flat hideifnotset minwidth100" name="AGENDA_EXT_NAME_'.$id.'_'.$key.'" value="'.$name_value.'"></td>';
print '<td><input type="text" class="flat hideifnotset minwidth100 maxwidth100onsmartphone" name="AGENDA_EXT_NAME_'.$id.'_'.$key.'" value="'.$name_value.'"></td>';
// URL
$src_value = (GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) ?GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$key) : (empty($object->conf->$src) ? '' : $object->conf->$src));
print '<td class="maxwidth50onsmartphone"><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC_'.$id.'_'.$key.'" value="'.$src_value.'"></td>';
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC_'.$id.'_'.$key.'" value="'.$src_value.'"></td>';
// Offset TZ
$offsettz_value = (GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key) : (empty($object->conf->$offsettz) ? 0 : $object->conf->$offsettz));
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key.'" value="'.$offsettz_value.'" size="1"></td>';
// Color (Possible colors are limited by Google)
print '<td class="nowrap right">';
print '<td class="nowraponall right">';
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
$color_value = (GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) ?GETPOST("AGENDA_EXT_COLOR_".$id.'_'.$key) : (empty($object->conf->$color) ? 'ffffff' : $object->conf->$color));
print $formother->selectColor($color_value, "AGENDA_EXT_COLOR_".$id.'_'.$key, 'extsitesconfig', 1, '', 'hideifnotset');

View File

@ -2718,9 +2718,8 @@ if ($action == 'create' || $action == 'adduserldap') {
if ($action != 'edit' && $action != 'presend') {
print '<div class="fichecenter"><div class="fichehalfleft">';
/*
* Generated documents
*/
// Generated documents
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->user->dir_output."/".dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
@ -2741,7 +2740,6 @@ if ($action == 'create' || $action == 'adduserldap') {
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'user', $socid, 1);
print '</div></div></div>';
}

View File

@ -2558,11 +2558,13 @@ class User extends CommonObject
/**
* Return clickable link of login (eventualy with picto)
*
* @param int $withpicto Include picto into link
* @param string $option Sur quoi pointe le lien
* @return string Chaine avec URL
* @param int $withpictoimg Include picto into link
* @param string $option On what the link point to ('leave', 'accountancy', 'nolink', )
* @param integer $notooltip 1=Disable tooltip on picto and name
* @param string $morecss Add more css on link
* @return string String with URL
*/
public function getLoginUrl($withpicto = 0, $option = '')
public function getLoginUrl($withpictoimg = 0, $option = '', $notooltip = 0, $morecss = '')
{
global $langs, $user;
@ -2587,11 +2589,23 @@ class User extends CommonObject
}
$result .= $linkstart;
if ($withpicto) {
$result .= img_object($langs->trans("ShowUser"), 'user', 'class="paddingright"');
if ($withpictoimg) {
$paddafterimage = '';
if (abs($withpictoimg) == 1) {
$paddafterimage = 'style="margin-'.($langs->trans("DIRECTION") == 'rtl' ? 'left' : 'right').': 3px;"';
}
// Only picto
if ($withpictoimg > 0) {
$picto = '<!-- picto user --><span class="nopadding userimg'.($morecss ? ' '.$morecss : '').'">'.img_object('', 'user', $paddafterimage.' '.($notooltip ? '' : 'class="paddingright classfortooltip"'), 0, 0, $notooltip ? 0 : 1).'</span>';
} else {
// Picto must be a photo
$picto = '<!-- picto photo user --><span class="nopadding userimg'.($morecss ? ' '.$morecss : '').'"'.($paddafterimage ? ' '.$paddafterimage : '').'>'.Form::showphoto('userphoto', $this, 0, 0, 0, 'userphoto'.($withpictoimg == -3 ? 'small' : ''), 'mini', 0, 1).'</span>';
}
$result .= $picto;
}
$result .= $this->login;
$result .= $linkend;
return $result;
}

View File

@ -231,19 +231,9 @@ if ($action == 'edit') {
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
if (!empty($conf->use_javascript_ajax)) {/*
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
$("#main_lang_default").change(function() {
$("#check_MAIN_LANG_DEFAULT").prop("checked", true);
});
$("#main_size_liste_limit").keyup(function() {
if ($(this).val().length) $("#check_SIZE_LISTE_LIMIT").prop("checked", true);
else $("#check_SIZE_LISTE_LIMIT").prop("checked", false);
});
});
</script>';*/
}
print dol_get_fiche_end();
if (!empty($conf->use_javascript_ajax)) {
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
@ -282,11 +272,11 @@ if ($action == 'edit') {
clearstatcache();
print '<table class="noborder centpercent tableforfield">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("DefaultValue").'</td><td>&nbsp;</td><td>'.$langs->trans("PersonalValue").'</td></tr>';
// Language by default
print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
print '<tr class="oddeven"><td class="titlefieldmiddle">'.$langs->trans("Language").'</td>';
print '<td>';
$s = picto_from_langcode($conf->global->MAIN_LANG_DEFAULT);
print $s ? $s.' ' : '';
@ -337,8 +327,6 @@ if ($action == 'edit') {
// Theme
showSkins($object, (($user->admin || empty($dolibarr_main_demo)) ? 1 : 0), true);
print dol_get_fiche_end();
print '<div class="center">';
print '<input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
@ -352,8 +340,12 @@ if ($action == 'edit') {
dol_banner_tab($object, 'id', $linkback, $user->rights->user->user->lire || $user->admin);
print '<table class="noborder centpercent tableforfield">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("DefaultValue").'</td><td>&nbsp;</td><td>'.$langs->trans("PersonalValue").'</td></tr>';
print dol_get_fiche_end();
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("DefaultValue").'</td><td>&nbsp;</td><td>'.$langs->trans("PersonalValue").'</td></tr>';
// Language
print '<tr class="oddeven"><td>'.$langs->trans("Language").'</td>';
@ -404,14 +396,14 @@ if ($action == 'edit') {
print '<td class="nowrap" width="20%"><input class="oddeven" type="checkbox" disabled '.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? " checked" : "").'> '.$langs->trans("UsePersonalValue").'</td>';
print '<td>'.(!empty($object->conf->MAIN_SIZE_LISTE_LIMIT) ? $object->conf->MAIN_SIZE_LISTE_LIMIT : '&nbsp;').'</td></tr>';
print '</table><br>';
print '</table>';
print '</div>';
print '<br>';
// Skin
showSkins($object, 0, true);
print dol_get_fiche_end();
print '<div class="tabsAction">';
if (empty($user->admin) && !empty($dolibarr_main_demo)) {

View File

@ -311,21 +311,33 @@ if ($result) {
while ($i < $num) {
$obj = $db->fetch_object($result);
// If line is for a module that doe snot existe anymore (absent of includes/module), we ignore it
// If line is for a module that does not exist anymore (absent of includes/module), we ignore it
if (empty($modules[$obj->module])) {
$i++;
continue;
}
// Save field module_position in database if value is still zero
if (empty($obj->module_position)) {
$objMod = $modules[$obj->module];
// Save field module_position in database if value is wrong
if (empty($obj->module_position) || (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $obj->module_position < 100000)) {
if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0)) {
// TODO Define familyposition
$family = $modules[$obj->module]->family_position;
//$familyposition = $modules[$obj->module]->family_position;
$familyposition = 0;
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $modules[$obj->module]->module_position).",";
$newmoduleposition = $modules[$obj->module]->module_position;
// Correct $newmoduleposition position for external modules
$objMod = $modules[$obj->module];
if (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $newmoduleposition < 100000) {
$newmoduleposition += 100000;
}
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $newmoduleposition).",";
$sqlupdate .= " family_position = ".((int) $familyposition);
$sqlupdate .= " WHERE module_position = 0 AND module = '".$db->escape($obj->module)."'";
$sqlupdate .= " WHERE module_position = ".((int) $obj->module_position)." AND module = '".$db->escape($obj->module)."'";
$db->query($sqlupdate);
}
}
@ -334,7 +346,6 @@ if ($result) {
$oldmod = $obj->module;
// Break detected, we get objMod
$objMod = $modules[$obj->module];
$picto = ($objMod->picto ? $objMod->picto : 'generic');
// Show break line
@ -425,9 +436,9 @@ if ($result) {
print '<td>&nbsp;</td>';
}
// Label of permission
// Descrption of permission
$permlabel = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label)));
print '<td class="maxwidthonsmartphone">';
print '<td class="">';
print $permlabel;
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
if (preg_match('/_advance$/', $obj->perms)) {

View File

@ -513,8 +513,8 @@ class ProductCombination
if ($parent->multiprices[$i] != '' || isset($this->combination_price_levels[$i]->variation_price)) {
$new_type = $parent->multiprices_base_type[$i];
$new_min_price = $parent->multiprices_min[$i];
$variation_price = doubleval(!isset($this->combination_price_levels[$i]->variation_price) ? $this->variation_price : $this->combination_price_levels[$i]->variation_price);
$variation_price_percentage = doubleval(!isset($this->combination_price_levels[$i]->variation_price_percentage) ? $this->variation_price_percentage : $this->combination_price_levels[$i]->variation_price_percentage);
$variation_price = floatval(!isset($this->combination_price_levels[$i]->variation_price) ? $this->variation_price : $this->combination_price_levels[$i]->variation_price);
$variation_price_percentage = floatval(!isset($this->combination_price_levels[$i]->variation_price_percentage) ? $this->variation_price_percentage : $this->combination_price_levels[$i]->variation_price_percentage);
if ($parent->prices_by_qty_list[$i]) {
$new_psq = 1;
@ -1093,9 +1093,9 @@ class ProductCombinationLevel
}
$this->id = $obj->rowid;
$this->fk_product_attribute_combination = doubleval($obj->fk_product_attribute_combination);
$this->fk_product_attribute_combination = floatval($obj->fk_product_attribute_combination);
$this->fk_price_level = intval($obj->fk_price_level);
$this->variation_price = doubleval($obj->variation_price);
$this->variation_price = floatval($obj->variation_price);
$this->variation_price_percentage = (bool) $obj->variation_price_percentage;
return 1;
@ -1129,7 +1129,7 @@ class ProductCombinationLevel
// Update
if (!empty($this->id)) {
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql .= ' SET variation_price = '.doubleval($this->variation_price).' , variation_price_percentage = '.intval($this->variation_price_percentage);
$sql .= ' SET variation_price = '.floatval($this->variation_price).' , variation_price_percentage = '.intval($this->variation_price_percentage);
$sql .= ' WHERE rowid = '.((int) $this->id);
$res = $this->db->query($sql);
@ -1147,7 +1147,7 @@ class ProductCombinationLevel
$sql .= ") VALUES (";
$sql .= (int) $this->fk_product_attribute_combination;
$sql .= ", ".intval($this->fk_price_level);
$sql .= ", ".doubleval($this->variation_price);
$sql .= ", ".floatval($this->variation_price);
$sql .= ", ".intval($this->variation_price_percentage);
$sql .= ")";

View File

@ -169,7 +169,7 @@ function createPayment($authentication, $payment)
$soc->fetch($payment['thirdparty_id']);
$new_payment = new Paiement($db);
$new_payment->amount = doubleval($payment['amount']);
$new_payment->amount = floatval($payment['amount']);
$new_payment->num_payment = $payment['num_payment'];
$new_payment->fk_account = intval($payment['bank_account']);
$new_payment->paiementid = !empty($payment['payment_mode_id']) ? intval($payment['payment_mode_id']) : $soc->mode_reglement_id;

View File

@ -636,7 +636,7 @@ class Website extends CommonObject
}
/**
* Load an object from its id and create a new one in database.
* Load a website its id and create a new one in database.
* This copy website directories, regenerate all the pages + alias pages and recreate the medias link.
*
* @param User $user User making the clone
@ -777,8 +777,8 @@ class Website extends CommonObject
$filetpl = $pathofwebsitenew.'/page'.$newidforhome.'.tpl.php';
$filewrapper = $pathofwebsitenew.'/wrapper.php';
// Generate the index.php page to be the home page
//-------------------------------------------------
// Re-generates the index.php page to be the home page, and re-generates the wrapper.php
//--------------------------------------------------------------------------------------
$result = dolSaveIndexPage($pathofwebsitenew, $fileindex, $filetpl, $filewrapper);
}
}
@ -1278,7 +1278,7 @@ class Website extends CommonObject
}
/**
* Rebuild all files of a containers of a website. TODO Add other files too.
* Rebuild all files of a containers of a website. Rebuild also the wrapper.php file. TODO Add other files too.
* Note: Files are already regenerated during importWebSite so this function is useless when importing a website.
*
* @return int <0 if KO, >=0 if OK
@ -1347,6 +1347,13 @@ class Website extends CommonObject
$i++;
}
if (!$error) {
// Save wrapper.php
$pathofwebsite = $conf->website->dir_output.'/'.$object->ref;
$filewrapper = $pathofwebsite.'/wrapper.php';
dolSaveIndexPage($pathofwebsite, '', '', $filewrapper);
}
if ($error) {
return -1;
} else {

View File

@ -1083,7 +1083,7 @@ if ($action == 'addcontainer' && $usercanedit) {
} else {
$filetpl = $pathofwebsite.'/page'.$pageid.'.tpl.php';
// Generate the index.php page (to be the home page) and wrapper.php file
// Generate the index.php page (to be the home page) and the wrapper.php file
$result = dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl, $filewrapper);
if ($result <= 0) {
@ -1315,7 +1315,7 @@ if (!GETPOSTISSET('pageid')) {
}
}
// Update css Update site properties
// Update css site properties. Re-generates also the wrapper.
if ($action == 'updatecss' && $usercanedit) {
// If we tried to reload another site/page, we stay on editcss mode.
if (GETPOST('refreshsite') || GETPOST('refreshsite_x') || GETPOST('refreshsite.x') || GETPOST('refreshpage') || GETPOST('refreshpage_x') || GETPOST('refreshpage.x')) {

View File

@ -149,8 +149,10 @@ if ($rss) {
}
if ($buildfile) {
$langs->load("other");
$title = $desc = $langs->transnoentities('LatestBlogPosts');
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang($l);
$outputlangs->loadLangs(array("main", "other"));
$title = $desc = $outputlangs->transnoentities('LatestBlogPosts');
// Create temp file
$outputfiletmp = tempnam($dir_temp, 'tmp'); // Temporary file (allow call of function by different threads