diff --git a/.stickler.yml b/.stickler.yml index 4f7c7d06c27..b68804448b2 100644 --- a/.stickler.yml +++ b/.stickler.yml @@ -7,4 +7,4 @@ linters: fixer: true fixers: - enable: true \ No newline at end of file + enable: true diff --git a/ChangeLog b/ChangeLog index 54b40dc0f04..2e0bbf78352 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,8 +18,8 @@ Following changes may create regressions for some external modules, but were nec * The function show_theme() hase been renamed into showSkins() * Rename 'module_part' parameter into 'modulepart' into document APIs, for consistency. * The deprecated method get_OutstandingBill has been removed. You can use getOutstandingBills() instead. - - +* The hook "moreFamily" must return payment into var "totalpayment" and no more "paiement" (english replace french). +* Removed deprecated method actioncomm->add(), use create() instead ***** ChangeLog for 10.0.1 compared to 10.0.0 ***** diff --git a/build/flatpack/org.flatpak.Dolibarr.json b/build/flatpack/org.flatpak.Dolibarr.json index 9e2135cf0a3..69140d32372 100644 --- a/build/flatpack/org.flatpak.Dolibarr.json +++ b/build/flatpack/org.flatpak.Dolibarr.json @@ -1 +1 @@ -Help wanted... \ No newline at end of file +"Help wanted..." \ No newline at end of file diff --git a/doc/images/dolibarr_screenshot5_1280x800.png b/doc/images/dolibarr_screenshot5_1280x800.png deleted file mode 100644 index 92f6dfa521d..00000000000 Binary files a/doc/images/dolibarr_screenshot5_1280x800.png and /dev/null differ diff --git a/doc/images/dolibarr_screenshot5_1920x1080_b.jpg b/doc/images/dolibarr_screenshot5_1920x1080.jpg similarity index 100% rename from doc/images/dolibarr_screenshot5_1920x1080_b.jpg rename to doc/images/dolibarr_screenshot5_1920x1080.jpg diff --git a/doc/images/dolibarr_screenshot5_1920x1080_a.jpg b/doc/images/dolibarr_screenshot5_1920x1080_a.jpg deleted file mode 100644 index 1c6e2cbdbdf..00000000000 Binary files a/doc/images/dolibarr_screenshot5_1920x1080_a.jpg and /dev/null differ diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index ee90a0638fb..2c6b41b7796 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -88,7 +88,7 @@ $hookmanager->initHooks(array('admin')); // Put here declaration of dictionaries properties // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this. -$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,24,28,17,35,36,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,37,0,25,0); +$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,32,33,34,0,6,0,29,0,7,24,28,17,35,36,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,37,0,25,0); // Name of SQL tables of dictionaries $tabname=array(); @@ -123,9 +123,10 @@ $tabname[28]= MAIN_DB_PREFIX."c_holiday_types"; $tabname[29]= MAIN_DB_PREFIX."c_lead_status"; $tabname[30]= MAIN_DB_PREFIX."c_format_cards"; //$tabname[31]= MAIN_DB_PREFIX."accounting_system"; -//$tabname[32]= MAIN_DB_PREFIX."c_accounting_category"; +$tabname[32]= MAIN_DB_PREFIX."c_hrm_public_holiday"; $tabname[33]= MAIN_DB_PREFIX."c_hrm_department"; $tabname[34]= MAIN_DB_PREFIX."c_hrm_function"; + $tabname[35]= MAIN_DB_PREFIX."c_exp_tax_cat"; $tabname[36]= MAIN_DB_PREFIX."c_exp_tax_range"; $tabname[37]= MAIN_DB_PREFIX."c_units"; @@ -163,7 +164,7 @@ $tablib[28]= "DictionaryHolidayTypes"; $tablib[29]= "DictionaryOpportunityStatus"; $tablib[30]= "DictionaryFormatCards"; //$tablib[31]= "DictionaryAccountancysystem"; -//$tablib[32]= "DictionaryAccountancyCategory"; +$tablib[32]= "DictionaryPublicHolidays"; $tablib[33]= "DictionaryDepartment"; $tablib[34]= "DictionaryFunction"; $tablib[35]= "DictionaryExpenseTaxCat"; @@ -203,7 +204,7 @@ $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.new $tabsql[29]= "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status"; $tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards"; //$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s"; -//$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.sens, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; +$tabsql[32]= "SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country=c.rowid AND c.active=1"; $tabsql[33]= "SELECT rowid, pos, code, label, active FROM ".MAIN_DB_PREFIX."c_hrm_department"; $tabsql[34]= "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PREFIX."c_hrm_function"; $tabsql[35]= "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c"; @@ -243,7 +244,7 @@ $tabsqlsort[28]="country ASC, code ASC"; $tabsqlsort[29]="position ASC"; $tabsqlsort[30]="code ASC"; //$tabsqlsort[31]="pcg_version ASC"; -//$tabsqlsort[32]="position ASC"; +$tabsqlsort[32]="year ASC, month ASC, day ASC"; $tabsqlsort[33]="code ASC"; $tabsqlsort[34]="code ASC"; $tabsqlsort[35]="c.label ASC"; @@ -283,7 +284,7 @@ $tabfield[28]= "code,label,affect,delay,newbymonth,country_id,country"; $tabfield[29]= "code,label,percent,position"; $tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfield[31]= "pcg_version,label"; -//$tabfield[32]= "code,label,range_account,sens,category_type,formula,position,country_id,country"; +$tabfield[32]= "code,year,month,day,country_id,country"; $tabfield[33]= "code,label"; $tabfield[34]= "code,label"; $tabfield[35]= "label"; @@ -323,7 +324,7 @@ $tabfieldvalue[28]= "code,label,affect,delay,newbymonth,country"; $tabfieldvalue[29]= "code,label,percent,position"; $tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfieldvalue[31]= "pcg_version,label"; -//$tabfieldvalue[32]= "code,label,range_account,sens,category_type,formula,position,country"; +$tabfieldvalue[32]= "code,day,month,year,country"; $tabfieldvalue[33]= "code,label"; $tabfieldvalue[34]= "code,label"; $tabfieldvalue[35]= "label"; @@ -364,15 +365,16 @@ $tabfieldinsert[29]= "code,label,percent,position"; $tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y"; //$tabfieldinsert[31]= "pcg_version,label"; //$tabfieldinsert[32]= "code,label,range_account,sens,category_type,formula,position,fk_country"; +$tabfieldinsert[32]= "code,day,month,year,fk_country"; $tabfieldinsert[33]= "code,label"; $tabfieldinsert[34]= "code,label"; $tabfieldinsert[35]= "label"; $tabfieldinsert[36]= "range_ik,fk_c_exp_tax_cat"; $tabfieldinsert[37]= "code,label,short_label,unit_type,scale"; -// Rowid name if the field is not autoincrement type -// Example: "" if id field is "rowid" and has autoincrement on -// "nameoffield" if id field is not "rowid" or has not autoincrement on +// Rowid name of field depending if field is autoincrement on or off.. +// Use "" if id field is "rowid" and has autoincrement on +// Use "nameoffield" if id field is not "rowid" or has not autoincrement on $tabrowid=array(); $tabrowid[1] = ""; $tabrowid[2] = ""; @@ -405,7 +407,7 @@ $tabrowid[28]= ""; $tabrowid[29]= ""; $tabrowid[30]= ""; //$tabrowid[31]= ""; -//$tabrowid[32]= ""; +$tabrowid[32]= "id"; $tabrowid[33]= "rowid"; $tabrowid[34]= "rowid"; $tabrowid[35]= ""; @@ -445,7 +447,7 @@ $tabcond[28]= ! empty($conf->holiday->enabled); $tabcond[29]= ! empty($conf->projet->enabled); $tabcond[30]= ! empty($conf->label->enabled); //$tabcond[31]= ! empty($conf->accounting->enabled); -//$tabcond[32]= ! empty($conf->accounting->enabled); +$tabcond[32]= (! empty($conf->holiday->enabled) || ! empty($conf->hrm->enabled)); $tabcond[33]= ! empty($conf->hrm->enabled); $tabcond[34]= ! empty($conf->hrm->enabled); $tabcond[35]= ! empty($conf->expensereport->enabled); @@ -485,12 +487,12 @@ $tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$lan $tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList")); $tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize")); //$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode")); -//$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode")); +$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"), 'daterule'=>"Use 'date'", 'country'=>$langs->trans("EnterACountryOnlyIfSpecificToOneCountry"), 'year'=>$langs->trans("ZeroMeansEveryYear")); $tabhelp[33] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode")); -$tabhelp[35]= array(); -$tabhelp[36]= array('range_ik'=>$langs->trans('PrevRangeToThisRange')); -$tabhelp[37]= array('code'=>$langs->trans("EnterAnyCode")); +$tabhelp[35] = array(); +$tabhelp[36] = array('range_ik'=>$langs->trans('PrevRangeToThisRange')); +$tabhelp[37] = array('code'=>$langs->trans("EnterAnyCode")); // List of check for fields (NOT USED YET) $tabfieldcheck=array(); @@ -525,12 +527,12 @@ $tabfieldcheck[28] = array(); $tabfieldcheck[29] = array(); $tabfieldcheck[30] = array(); //$tabfieldcheck[31] = array(); -//$tabfieldcheck[32] = array(); +$tabfieldcheck[32] = array(); $tabfieldcheck[33] = array(); $tabfieldcheck[34] = array(); -$tabfieldcheck[35]= array(); -$tabfieldcheck[36]= array(); -$tabfieldcheck[37]= array(); +$tabfieldcheck[35] = array(); +$tabfieldcheck[36] = array(); +$tabfieldcheck[37] = array(); // Complete all arrays with entries found into modules complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck); @@ -621,9 +623,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory - if ($value == 'country' && in_array($tablib[$id], array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory - if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; + // Discard check of mandatory fields for country for some tables + if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryPublicHolidays','DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory + if ($value == 'country' && in_array($tablib[$id], array('DictionaryPublicHolidays','DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory + // Discard check of mandatory fiedls for other fields + if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'color' && empty($_POST['color'])) continue; if ($value == 'formula' && empty($_POST['formula'])) continue; @@ -992,8 +996,10 @@ if ($id) if (! preg_match('/ WHERE /', $sql)) $sql.= " WHERE 1 = 1"; if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id; - if ($search_code != '' && $id != 9) $sql.= natural_search("code", $search_code); if ($search_code != '' && $id == 9) $sql.= natural_search("code_iso", $search_code); + elseif ($search_code != '' && $id == 28) $sql.= natural_search("h.code", $search_code); + elseif ($search_code != '' && $id == 32) $sql.= natural_search("a.code", $search_code); + elseif ($search_code != '' && $id != 9) $sql.= natural_search("code", $search_code); if ($sortfield) { @@ -1053,7 +1059,7 @@ if ($id) continue; } - // Define field friedly name from its technical name + // Define field friendly name from its technical name $valuetoshow=ucfirst($fieldlist[$field]); // Par defaut $valuetoshow=$langs->trans($valuetoshow); // try to translate $class=''; @@ -1156,7 +1162,8 @@ if ($id) print ''; // Line to enter new values - print ''; + print ''; + print ''; $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. @@ -1632,10 +1639,10 @@ if ($id) if ($obj->code == 'RECEP') $canbemodified=1; if ($tabname[$id] == MAIN_DB_PREFIX."c_actioncomm") $canbemodified=1; - // Url + // Build Url. The table is id=, the id of line is rowid= $rowidcol=$tabrowid[$id]; // If rowidcol not defined - if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27))) $rowidcol='rowid'; + if (empty($rowidcol) || in_array($id, array(6,7,8,13,17,19,27,32))) $rowidcol='rowid'; $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((! empty($obj->{$rowidcol}) || $obj->{$rowidcol} == '0')?$obj->{$rowidcol}:(! empty($obj->code)?urlencode($obj->code):'')).'&code='.(! empty($obj->code)?urlencode($obj->code):''); if (! empty($param)) $url .= '&'.$param; if (! is_null($withentity)) $url .= '&entity='.$withentity; @@ -1971,7 +1978,6 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } else { - $fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''; if ($fieldlist[$field]=='sortorder') @@ -1981,11 +1987,11 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') $classtd=''; $class=''; if ($fieldlist[$field]=='code') $class='maxwidth100'; - if (in_array($fieldlist[$field], array('pos', 'use_default', 'affect', 'delay', 'position', 'sortorder', 'sens', 'category_type'))) $class='maxwidth50'; + if (in_array($fieldlist[$field], array('dayrule', 'day', 'month', 'year', 'pos', 'use_default', 'affect', 'delay', 'position', 'sortorder', 'sens', 'category_type'))) $class='maxwidth50'; if (in_array($fieldlist[$field], array('libelle', 'label', 'tracking'))) $class='quatrevingtpercent'; print ''; $transfound=0; - if (in_array($fieldlist[$field], array('label','libelle'))) + if (in_array($fieldlist[$field], array('label','libelle'))) // For label { $transkey=''; // Special case for labels diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 4ee9e214890..a2403315614 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -158,8 +158,10 @@ $head = mailmanspip_admin_prepare_head(); if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { print '
'; + print ''; + print ''; - dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); + dol_fiche_head($head, 'mailman', $langs->trans("Setup"), -1, 'user'); //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; @@ -227,14 +229,21 @@ else if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { print ''; + print ''; print ''; + print $langs->trans("TestSubscribe").'
'; print $langs->trans("EMail").'
'; + print ''; + print '
'; + print ''; print ''; + print $langs->trans("TestUnSubscribe").'
'; print $langs->trans("EMail").'
'; + print '
'; } diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php index e0b4b986969..579363395f3 100644 --- a/htdocs/admin/spip.php +++ b/htdocs/admin/spip.php @@ -123,8 +123,10 @@ $head = mailmanspip_admin_prepare_head(); if (! empty($conf->global->ADHERENT_USE_SPIP)) { print '
'; + print ''; + print ''; - dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); + dol_fiche_head($head, 'spip', $langs->trans("Setup"), -1, 'user'); //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 7c22d1a4a58..572f034f259 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -103,14 +103,14 @@ print '
'; print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; $found=0; print ''; print ''; -print ''; print ''; -print ''; print ''; -print ''; print ''; -print ''; - -$boxwork.='
".$langs->trans("RuleForStockManagementDecrease")."'.$langs->trans("Status").''.$langs->trans("Status").'
'.$langs->trans("DeStockOnBill").''; +print ''; if (! empty($conf->facture->enabled)) { if ($conf->use_javascript_ajax) { @@ -130,7 +130,7 @@ $found++; print '
'.$langs->trans("DeStockOnValidateOrder").''; +print ''; if (! empty($conf->commande->enabled)) { if ($conf->use_javascript_ajax) { @@ -152,7 +152,7 @@ $found++; print '
'.$langs->trans("DeStockOnShipment").''; +print ''; if (! empty($conf->expedition->enabled)) { if ($conf->use_javascript_ajax) { @@ -172,7 +172,7 @@ $found++; print '
'.$langs->trans("DeStockOnShipmentOnClosing").''; +print ''; if (! empty($conf->expedition->enabled)) { if ($conf->use_javascript_ajax) { @@ -205,14 +205,14 @@ print '
'; print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; $found=0; print ''; print ''; -print ''; print ''; -print ''; - print ''; - print ''; + print ''; - print ''; - print ''; + print ''; print ''; - print '
".$langs->trans("RuleForStockManagementIncrease")."'.$langs->trans("Status").''.$langs->trans("Status").'
'.$langs->trans("ReStockOnBill").''; +print ''; if (! empty($conf->fournisseur->enabled)) { if ($conf->use_javascript_ajax) { @@ -233,7 +233,7 @@ $found++; print '
'.$langs->trans("ReStockOnValidateOrder").''; +print ''; if (! empty($conf->fournisseur->enabled)) { if ($conf->use_javascript_ajax) { @@ -253,8 +253,8 @@ $found++; if (!empty($conf->reception->enabled)) { print '
'.$langs->trans("StockOnReception").''; + print ''.$langs->trans("StockOnReception").''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION'); @@ -268,8 +268,8 @@ if ($conf->use_javascript_ajax) { print '
'.$langs->trans("StockOnReceptionOnClosing").''; + print ''.$langs->trans("StockOnReceptionOnClosing").''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE'); @@ -284,7 +284,7 @@ else { print '
'.$langs->trans("ReStockOnDispatchOrder").''; + print ''; if (! empty($conf->fournisseur->enabled)) { if ($conf->use_javascript_ajax) { @@ -313,16 +313,17 @@ if ($conf->use_javascript_ajax) { print '
'; print '
'; + print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''; print ''; -print ''; print ''; - print ''; print ''; - print ''; print ''; - print ''; if (! empty($arrayfields['c.libelle']['checked'])) print ''; if (! empty($arrayfields['a.label']['checked'])) print ''; + if (! empty($arrayfields['a.note']['checked'])) print ''; if (! empty($arrayfields['a.datep']['checked'])) { print ''; + print ''; + print ''; + print "
".$langs->trans("RuleForStockAvailability")."'.$langs->trans("Status").''.$langs->trans("Status").'
'.$langs->trans("WarehouseAllowNegativeTransfer").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_ALLOW_NEGATIVE_TRANSFER'); } else { @@ -337,7 +338,7 @@ if($conf->invoice->enabled) { print '
'.$langs->trans("StockMustBeEnoughForInvoice").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE'); } else { @@ -352,7 +353,7 @@ if($conf->order->enabled) { print '
'.$langs->trans("StockMustBeEnoughForOrder").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER'); } else { @@ -367,7 +368,7 @@ if($conf->expedition->enabled) { print '
'.$langs->trans("StockMustBeEnoughForShipment").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT'); } else { @@ -391,12 +392,12 @@ if ($virtualdiffersfromphysical) print ''; print ''; print "\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; print ''; print ''; - print ''; print ''; print ''; print "\n"; -$var=false; -//if ($conf->global->MAIN_FEATURES_LEVEL > 0) -//{ - print '\n"; +print '\n"; -//} // Ask for payment bank during supplier order /* Kept as hidden for the moment @@ -564,6 +560,20 @@ print '\n"; +// Option to add a quality/validation step, on products, after reception. +$langs->load("stocks"); +print ''; +print ''; +print ''; +print '\n\n"; + print '
".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."'.$langs->trans("Status").''.$langs->trans("Status").'
'.$langs->trans("UseVirtualStockByDefault").''; + print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_USE_VIRTUAL_STOCK'); } else { @@ -414,12 +415,12 @@ print ''; print ''; print "\n"; -print ''."\n"; +print ''."\n"; print ''."\n"; print ''; print ''; -print ''; print ''; -print '\n"; print ''; print ''; -print '\n"; print "\n"; -if (! empty($conf->fournisseur->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { - print ''; - print ''; - print '\n\n"; -} - print '
".$langs->trans("Other")."'.$langs->trans("Status").''.$langs->trans("Status").'
'.$langs->trans("UserWarehouseAutoCreate").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_USERSTOCK_AUTOCREATE'); } else { @@ -433,7 +434,7 @@ print '
'; print $form->textwithpicto($langs->trans("StockSupportServices"), $langs->trans("StockSupportServicesDesc")); print ''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_SUPPORTS_SERVICES'); } else { @@ -445,7 +446,7 @@ print "
'.$langs->trans("AllowAddLimitStockByWarehouse").''; +print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE'); } else { @@ -455,19 +456,6 @@ if ($conf->use_javascript_ajax) { print "
'.$langs->trans("UseDispatchStatus").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS); -} - print "
'; print '
'; @@ -476,43 +464,45 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print ''; print ''; print ''."\n"; - print ''."\n"; - print ''."\n"; + print ''."\n"; + print ''."\n"; // Example with a yes / no select - print ''; + /*print ''; print ''; - print ''; + */ // Example with a yes / no select - print ''; + /*print ''; print ''; - print ''; + print ''; + */ - // Example with a yes / no select + // Example with a yes / no select print ''; - print ''; - print ''; + print ''; print '
'.$langs->trans("Inventory").''.$langs->trans("Status").'
'.$langs->trans("Status").'
'.$langs->trans("INVENTORY_DISABLE_VIRTUAL").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVENTORY_DISABLE_VIRTUAL'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVENTORY_DISABLE_VIRTUAL", $arrval, $conf->global->INVENTORY_DISABLE_VIRTUAL); -} + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('INVENTORY_DISABLE_VIRTUAL'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("INVENTORY_DISABLE_VIRTUAL", $arrval, $conf->global->INVENTORY_DISABLE_VIRTUAL); + } print '
'.$langs->trans("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVENTORY_USE_MIN_PA_IF_NO_LAST_PA'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA", $arrval, $conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA); -} - print '
'; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('INVENTORY_USE_MIN_PA_IF_NO_LAST_PA'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("INVENTORY_USE_MIN_PA_IF_NO_LAST_PA", $arrval, $conf->global->INVENTORY_USE_MIN_PA_IF_NO_LAST_PA); + } + print '
'.$langs->trans("INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT); -} + print ''.$langs->trans("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT").''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT); + } print '
'; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index e895a0b4005..f1fbbd4b286 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -494,20 +494,16 @@ print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; - print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
'; - print $langs->trans("IfSetToYesDontForgetPermission"); - print '
'; - print ''; - print ''; - print ''; - print "
'; +print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'
'; +print $langs->trans("IfSetToYesDontForgetPermission"); +print '
'; +print ''; +print ''; +print ''; +print "
'; print ''; print "
'.$langs->trans("UseDispatchStatus").''; +if ($conf->use_javascript_ajax) { + print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS'); +} else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS); +} +print "

'; print ''; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index e07e7999414..3c6bc1d48ec 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -586,7 +586,7 @@ print "\n"; ?>
-
" id="buttonGo" />

diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index c1ddedfea53..4f9e8b933d2 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -112,21 +112,27 @@ $utils = new Utils($db); if ($compression == 'zip') { - $ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression); + $ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, '/(\.log|\/temp\/|documents\/admin\/documents\/)/'); if ($ret < 0) { - $errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputfile); + $errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir); } } elseif (in_array($compression, array('gz', 'bz'))) { - $file = substr($file, 0, strrpos($file, '.')); + $userlogin = ($user->login ? $user->login : 'unknown'); + + $outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method + + $file = substr($file, 0, strrpos($file, '.')); $file .= '.tar'; - $cmd = 'tar -cf '.$outputdir."/".$file." --exclude=documents/admin/documents -C ".DOL_DATA_ROOT." ".DOL_DATA_ROOT."/../documents/"; - exec($cmd, $out, $retval); - //var_dump($cmd, DOL_DATA_ROOT);exit; - - if ($retval != 0) + // We also exclude '/temp/' dir and 'documents/admin/documents' + $cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude='documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT); + + $result = $utils->executeCLI($cmd, $outputfile); + + $retval = $result['error']; + if ($result['result'] || ! empty($retval)) { $langs->load("errors"); dol_syslog("Documents tar retval after exec=".$retval, LOG_ERR); @@ -136,15 +142,17 @@ elseif (in_array($compression, array('gz', 'bz'))) { if ($compression == 'gz') { - $cmd = "gzip " . $outputdir."/".$file; + $cmd = "gzip -f " . $outputdir."/".$file; } if ($compression == 'bz') { - $cmd = "bzip2 " . $outputdir."/".$file; + $cmd = "bzip2 -f " . $outputdir."/".$file; } - - exec($cmd, $out, $retval); - if ($retval != 0) + + $result = $utils->executeCLI($cmd, $outputfile); + + $retval = $result['error']; + if ($result['result'] || ! empty($retval)) { $errormsg = 'Error '.$compression.' generation return '.$retval; unlink($outputdir."/".$file); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 2caff8d242c..12926f9b360 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -497,20 +497,6 @@ class ActionComm extends CommonObject } } - /** - * Add an action/event into database. - * $this->type_id OR $this->type_code must be set. - * - * @param User $user Object user making action - * @param int $notrigger 1 = disable triggers, 0 = enable triggers - * @return int Id of created event, < 0 if KO - * @deprecated Use create instead - */ - public function add(User $user, $notrigger = 0) - { - return $this->create($user, $notrigger); - } - /** * Load an object from its id and create a new one in database * diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index bd57005b7bf..2ef4c74f765 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -452,6 +452,7 @@ if ($resql) if (! empty($arrayfields['owner']['checked'])) print '
'; print $form->selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 9adc0bff336..5b9bf0f9eab 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2500,7 +2500,7 @@ $formquestion = array_merge($formquestion, array( if ($usercansend) { print ''; } else - print ''; + print ''; } // Create an order @@ -2538,7 +2538,14 @@ $formquestion = array_merge($formquestion, array( $arrayofinvoiceforpropal = $object->getInvoiceArrayList(); if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) { - print ''; + if ($usercanclose) + { + print ''; + } + else + { + print ''; + } } } diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index d89eecfed1a..ac4c9c767e8 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -213,9 +213,9 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $i = 0; while ($i < $num) { - $paiement = ''; $ref = ''; $refcomp = ''; + $totalpayment = ''; $obj = array_shift($tab_sqlobj); @@ -236,7 +236,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $societestatic->name = $obj->name; $refcomp=$societestatic->getNomUrl(1, '', 24); - $paiement = -1*$facturefournstatic->getSommePaiement(); // Payment already done + $totalpayment = -1*$facturefournstatic->getSommePaiement(); // Payment already done } } if ($obj->family == 'invoice') @@ -250,9 +250,9 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $societestatic->name = $obj->name; $refcomp=$societestatic->getNomUrl(1, '', 24); - $paiement = $facturestatic->getSommePaiement(); // Payment already done - $paiement+= $facturestatic->getSumDepositsUsed(); - $paiement+= $facturestatic->getSumCreditNotesUsed(); + $totalpayment = $facturestatic->getSommePaiement(); // Payment already done + $totalpayment+= $facturestatic->getSumDepositsUsed(); + $totalpayment+= $facturestatic->getSumCreditNotesUsed(); } if ($obj->family == 'social_contribution') { @@ -261,19 +261,19 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $socialcontribstatic->lib=$obj->type; $ref = $socialcontribstatic->getNomUrl(1, 24); - $paiement = -1*$socialcontribstatic->getSommePaiement(); // Payment already done + $totalpayment = -1*$socialcontribstatic->getSommePaiement(); // Payment already done } - $parameters = array('obj' => $obj); + $parameters = array('obj' => $obj, 'ref' => $ref, 'refcomp' => $refcomp, 'totalpayment' => $totalpayment); $reshook = $hookmanager->executeHooks('moreFamily', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if(empty($reshook)){ $ref = isset($hookmanager->resArray['ref']) ? $hookmanager->resArray['ref'] : $ref; $refcomp = isset($hookmanager->resArray['refcomp']) ? $hookmanager->resArray['refcomp'] : $refcomp; - $paiement = isset($hookmanager->resArray['paiement']) ? $hookmanager->resArray['paiement'] : $paiement; + $totalpayment = isset($hookmanager->resArray['totalpayment']) ? $hookmanager->resArray['totalpayment'] : $totalpayment; } $total_ttc = $obj->total_ttc; - if ($paiement) $total_ttc = $obj->total_ttc - $paiement; + if ($totalpayment) $total_ttc = $obj->total_ttc - $totalpayment; $solde += $total_ttc; // We discard lines with a remainder to pay to 0 diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 4bbe5c723e1..54fa04d33a2 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -170,7 +170,7 @@ $amountcust=$langs->trans("AmountHT"); $vatcust=$langs->trans("VATReceived"); $namecust=$langs->trans("Name"); if ($mysoc->tva_assuj) { - $vatcust.=' ('.$langs->trans("ToPay").')'; + $vatcust.=' ('.$langs->trans("StatusToPay").')'; } // Suppliers invoices diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index e0775313dd3..e977b31e5e4 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -185,7 +185,7 @@ $productcust=$langs->trans("Description"); $namerate=$langs->trans("VATRate"); $amountcust=$langs->trans("AmountHT"); if ($mysoc->tva_assuj) { - $vatcust.=' ('.$langs->trans("ToPay").')'; + $vatcust.=' ('.$langs->trans("StatusToPay").')'; } $elementsup=$langs->trans("SuppliersInvoices"); $productsup=$langs->trans("Description"); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index c48bc385c53..26601308ccf 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -173,7 +173,7 @@ $amountcust=$langs->trans("AmountHT"); $vatcust=$langs->trans("VATReceived"); $namecust=$langs->trans("Name"); if ($mysoc->tva_assuj) { - $vatcust.=' ('.$langs->trans("ToPay").')'; + $vatcust.=' ('.$langs->trans("VATToPay").')'; } // Suppliers invoices diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index fad72d69637..b7ecd4b9844 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -87,21 +87,6 @@ class Contact extends CommonObject public $zip; public $town; - /** - * @deprecated - * @see $state_id - */ - public $fk_departement; - /** - * @deprecated - * @see $state_code - */ - public $departement_code; - /** - * @deprecated - * @see $state - */ - public $departement; public $state_id; // Id of department public $state_code; // Code of department public $state; // Label of department @@ -1052,7 +1037,7 @@ class Contact extends CommonObject // Removed extrafields if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) { // For avoid conflicts if trigger used - $result=$this->deleteExtraFields($this); + $result=$this->deleteExtraFields(); if ($result < 0) $error++; } diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index e86433af85d..9371a9ea835 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -705,7 +705,7 @@ while ($i < min($num, $limit)) print ''; if ($obj->cstatut == 0) // If contract is draft, we say line is also draft { - print $contractstatic->LibStatut(0, 5, ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now)); + print $contractstatic->LibStatut(0, 5); } else { diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 5aa7d0575c6..05ab5db50fd 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -156,7 +156,7 @@ class box_factures extends ModeleBoxes ); $this->info_box_contents[$line][] = array( - 'td' => '', + 'td' => 'class="tdoverflowmax200"', 'text' => $societestatic->getNomUrl(1, '', 40), 'asis' => 1, ); diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index fadd0c02fde..1df572c8a35 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -497,8 +497,16 @@ abstract class CommonDocGenerator $resarray['object_total_up'] = $totalUp; $resarray['object_total_up_locale'] = price($resarray['object_total_up'], 0, $outputlangs); if (method_exists($object, 'getTotalDiscount')) { - $resarray['object_total_discount'] = round(100 / $totalUp * $object->getTotalDiscount(), 2); + $totalDiscount=$object->getTotalDiscount(); + } else { + $totalDiscount=0; + } + if (!empty($totalUp) && !empty($totalDiscount)) { + $resarray['object_total_discount'] = round(100 / $totalUp * $totalDiscount, 2); $resarray['object_total_discount_locale'] = price($resarray['object_total_discount'], 0, $outputlangs); + } else { + $resarray['object_total_discount']=''; + $resarray['object_total_discount_locale']=''; } } @@ -766,10 +774,20 @@ abstract class CommonDocGenerator //Add value to store price with currency $array_to_fill=array_merge($array_to_fill, array($array_key.'_options_'.$key.'_currency' => $object->array_options['options_'.$key.'_currency'])); } - elseif($extrafields->attribute_type[$key] == 'select' || $extrafields->attribute_type[$key] == 'checkbox') + elseif($extrafields->attribute_type[$key] == 'select') { $object->array_options['options_'.$key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_'.$key]]; } + elseif($extrafields->attribute_type[$key] == 'checkbox') { + $valArray=explode(',', $object->array_options['options_'.$key]); + $output=array(); + foreach($extrafields->attribute_param[$key]['options'] as $keyopt=>$valopt) { + if (in_array($keyopt, $valArray)) { + $output[]=$valopt; + } + } + $object->array_options['options_'.$key] = implode(', ', $output); + } elseif($extrafields->attribute_type[$key] == 'date') { if (strlen($object->array_options['options_'.$key])>0) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 37d72a7f65c..a1d01136401 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5216,7 +5216,7 @@ class Form * @param datetime $adddateof Add a link "Date of invoice" using the following date. * @return string|void Nothing or string if nooutput is 1 * @deprecated - * @see form_date(), select_month(), select_year(), select_dayofweek() + * @see selectDate(), form_date(), select_month(), select_year(), select_dayofweek() */ public function select_date($set_time = '', $prefix = 're', $h = 0, $m = 0, $empty = 0, $form_name = "", $d = 1, $addnowlink = 0, $nooutput = 0, $disabled = 0, $fullday = '', $addplusone = '', $adddateof = '') { diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 283b296b3e3..a5242c597c4 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -355,22 +355,27 @@ class Link extends CommonObject /** * Delete a link from database * - * @return int <0 if KO, 0 if nothing done, >0 if OK + * @param User $user Object suer + * @return int <0 if KO, 0 if nothing done, >0 if OK */ - public function delete() + public function delete($user) { - global $user, $langs, $conf; + global $langs, $conf; dol_syslog(get_class($this)."::delete", LOG_DEBUG); $error = 0; + $this->db->begin(); + // Call trigger $result=$this->call_trigger('LINK_DELETE', $user); - if ($result < 0) return -1; + if ($result < 0) + { + $this->db->rollback(); + return -1; + } // End call triggers - $this->db->begin(); - // Remove link $sql = "DELETE FROM " . MAIN_DB_PREFIX . "links"; $sql.= " WHERE rowid = " . $this->id; diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index be220c90487..13596bc26c3 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -316,27 +316,29 @@ class Utils // TODO Replace with executeCLI function if ($execmethod == 1) { - exec($fullcommandclear, $readt, $retval); - $result = $retval; + $output_arr = array(); $retval = null; + exec($fullcommandclear, $output_arr, $retval); if ($retval != 0) { $langs->load("errors"); dol_syslog("Datadump retval after exec=".$retval, LOG_ERR); - $error = 'Error '.$retval; + $errormsg = 'Error '.$retval; $ok=0; } else { $i=0; - if (!empty($readt)) - foreach($readt as $key=>$read) + if (!empty($output_arr)) { - $i++; // output line number - if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue; - fwrite($handle, $read.($execmethod == 2 ? '' : "\n")); - if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) $ok=1; - elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) $ok=1; + foreach($output_arr as $key => $read) + { + $i++; // output line number + if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue; + fwrite($handle, $read.($execmethod == 2 ? '' : "\n")); + if (preg_match('/'.preg_quote('-- Dump completed').'/i', $read)) $ok=1; + elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i', $read)) $ok=1; + } } } } @@ -534,6 +536,7 @@ class Utils if ($execmethod == 1) { + $retval = null; exec($command, $output_arr, $retval); $result = $retval; if ($retval != 0) @@ -545,7 +548,6 @@ class Utils } if ($execmethod == 2) // With this method, there is no way to get the return code, only output { - $ok=0; $handle = fopen($outputfile, 'w+b'); if ($handle) { diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 6635220cc23..cf5ab8dc7e0 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1094,6 +1094,8 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab { global $db, $modules, $conf, $langs; + dol_syslog("complete_dictionary_with_modules Search external modules to complete the list of dictionnary tables", LOG_DEBUG, 1); + // Search modules $modulesdir = dolGetModulesDirs(); $i = 0; // is a sequencer of modules found @@ -1191,6 +1193,8 @@ function complete_dictionary_with_modules(&$taborder, &$tabname, &$tablib, &$tab } } + dol_syslog("", LOG_DEBUG, -1); + return 1; } @@ -1259,7 +1263,7 @@ function activateModulesRequiredByCountry($country_code) } /** - * Add external modules to list of contact element + * Search external modules to complete the list of contact element * * @param array $elementList elementList * @return int 1 @@ -1278,6 +1282,8 @@ function complete_elementList_with_modules(&$elementList) $i = 0; // is a sequencer of modules found $j = 0; // j is module number. Automatically affected if module number not defined. + dol_syslog("complete_elementList_with_modules Search external modules to complete the list of contact element", LOG_DEBUG, 1); + $modulesdir = dolGetModulesDirs(); foreach ($modulesdir as $dir) @@ -1355,6 +1361,8 @@ function complete_elementList_with_modules(&$elementList) } } + dol_syslog("", LOG_DEBUG, -1); + return 1; } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index c6bc31956d6..9316dcbfeb6 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -549,15 +549,13 @@ function calendars_prepare_head($param) $h++; - $object=new stdClass(); - // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'agenda'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'agenda'); - complete_head_from_modules($conf, $langs, $object, $head, $h, 'agenda', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'agenda', 'remove'); return $head; } diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php index b9890533a00..8e8b561ac8e 100644 --- a/htdocs/core/lib/asset.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -48,7 +48,7 @@ function asset_admin_prepare_head() //$this->tabs = array( // 'entity:-tabname:Title:@assets:/asset/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets_admin'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'assets_admin'); $head[$h][0] = DOL_URL_ROOT . '/asset/admin/assets_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); @@ -60,7 +60,7 @@ function asset_admin_prepare_head() $head[$h][2] = 'attributes_type'; $h++; - complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets_admin', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'assets_admin', 'remove'); return $head; } @@ -68,11 +68,12 @@ function asset_admin_prepare_head() /** * Prepare admin pages header * + * @param Contrat $object Object related to tabs * @return array head array with tabs */ -function asset_prepare_head() +function asset_prepare_head(Asset $object) { - global $langs, $conf; + global $db, $langs, $conf; $langs->load("assets"); @@ -96,7 +97,7 @@ function asset_prepare_head() require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->assets->dir_output . '/' . get_exdir($filename, 2, 0, 1, $object, 'assets'). '/'. dol_sanitizeFileName($object->ref); + $upload_dir = $conf->assets->dir_output . '/' . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id; diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index f117bc24daf..54d1c491878 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -163,7 +163,6 @@ function bank_admin_prepare_head($object) */ function various_payment_prepare_head($object) { - global $db, $langs, $conf; $h = 0; diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index d1a4a07689e..80609f524d4 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -101,7 +101,7 @@ function contract_prepare_head(Contrat $object) */ function contract_admin_prepare_head() { - global $langs, $conf, $user; + global $langs, $conf; $h = 0; $head = array(); @@ -127,9 +127,7 @@ function contract_admin_prepare_head() $head[$h][2] = 'attributeslines'; $h++; - - complete_head_from_modules($conf, $langs, null, $head, $h, 'contract_admin', 'remove'); - return $head; + return $head; } diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 91c41ffcced..7b78ac96b91 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -80,7 +80,7 @@ function donation_prepare_head($object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->don->dir_output . '/' . get_exdir($filename, 2, 0, 1, $object, 'donation'). '/'. dol_sanitizeFileName($object->ref); + $upload_dir = $conf->don->dir_output . '/' . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 5861ad07a72..0c72fe35fab 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1222,9 +1222,12 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, } } } - else dol_syslog("Failed to remove file ".$filename, LOG_WARNING); - // TODO Failure to remove can be because file was already removed or because of permission - // If error because it does not exists, we should return true, and we should return false if this is a permission problem + else + { + dol_syslog("Failed to remove file ".$filename, LOG_WARNING); + // TODO Failure to remove can be because file was already removed or because of permission + // If error because it does not exists, we should return true, and we should return false if this is a permission problem + } } } else dol_syslog("No files to delete found", LOG_DEBUG); @@ -1881,14 +1884,16 @@ function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = '' /** - * Compress a file + * Compress a file. + * An error string may be returned into parameters. * * @param string $inputfile Source file name * @param string $outputfile Target file name * @param string $mode 'gz' or 'bz' or 'zip' + * @param string $errorstring Error string * @return int <0 if KO, >0 if OK */ -function dol_compress_file($inputfile, $outputfile, $mode = "gz") +function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring = null) { global $conf; @@ -1913,8 +1918,12 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz") $zip = new ZipArchive; if ($zip->open($outputfile, ZipArchive::CREATE) !== true) { - $errormsg="Failed to open file ".$outputfile."\n"; - dol_syslog("dol_compress_file failure - ".$errormsg, LOG_ERR); + $errorstring="dol_compress_file failure - Failed to open file ".$outputfile."\n"; + dol_syslog($errorstring, LOG_ERR); + + global $errormsg; + $errormsg = $errorstring; + return -6; } @@ -1958,12 +1967,16 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz") { global $errormsg; $errormsg=$archive->errorInfo(true); - dol_syslog("dol_compress_file failure - ".$errormsg, LOG_ERR); + if ($archive->errorCode() == PCLZIP_ERR_WRITE_OPEN_FAIL) { - dol_syslog("dol_compress_file error PCLZIP_ERR_WRITE_OPEN_FAIL", LOG_ERR); + $errorstring = "PCLZIP_ERR_WRITE_OPEN_FAIL"; + dol_syslog("dol_compress_file error - archive->errorCode() = PCLZIP_ERR_WRITE_OPEN_FAIL", LOG_ERR); return -4; } + + $errorstring = "dol_compress_file error archive->errorCode = ".$archive->errorCode()." errormsg=".$errormsg; + dol_syslog("dol_compress_file failure - ".$errormsg, LOG_ERR); return -3; } else @@ -1983,7 +1996,11 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz") } else { - dol_syslog("Try to zip with format ".$mode." with no handler for this format", LOG_ERR); + $errorstring = "Try to zip with format ".$mode." with no handler for this format"; + dol_syslog($errorstring, LOG_ERR); + + global $errormsg; + $errormsg = $errorstring; return -2; } } @@ -1991,8 +2008,10 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz") { global $langs, $errormsg; $langs->load("errors"); - dol_syslog("Failed to open file ".$outputfile, LOG_ERR); $errormsg=$langs->trans("ErrorFailedToWriteInDir"); + + $errorstring = "Failed to open file ".$outputfile; + dol_syslog($errorstring, LOG_ERR); return -1; } } @@ -2063,13 +2082,14 @@ function dol_uncompress($inputfile, $outputdir) * @param string $inputdir Source dir name * @param string $outputfile Target file name (output directory must exists and be writable) * @param string $mode 'zip' + * @param string $excludefiles A regex pattern. For example: '/\.log$|\/temp\//' * @return int <0 if KO, >0 if OK */ -function dol_compress_dir($inputdir, $outputfile, $mode = "zip") +function dol_compress_dir($inputdir, $outputfile, $mode = "zip", $excludefiles = '') { $foundhandler=0; - dol_syslog("Try to zip dir ".$inputdir." into ".$outputdir." mode=".$mode); + dol_syslog("Try to zip dir ".$inputdir." into ".$outputfile." mode=".$mode); if (! dol_is_dir(dirname($outputfile)) || ! is_writable(dirname($outputfile))) { @@ -2096,6 +2116,7 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip") return 1; } else*/ + //if (class_exists('ZipArchive') && ! empty($conf->global->MAIN_USE_ZIPARCHIVE_FOR_ZIP_COMPRESS)) if (class_exists('ZipArchive')) { $foundhandler=1; @@ -2103,6 +2124,13 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip") // Initialize archive object $zip = new ZipArchive(); $result = $zip->open($outputfile, ZipArchive::CREATE | ZipArchive::OVERWRITE); + if (! $result) + { + global $langs, $errormsg; + $langs->load("errors"); + $errormsg=$langs->trans("ErrorFailedToWriteInFile", $outputfile); + return -4; + } // Create recursive directory iterator /** @var SplFileInfo[] $files */ @@ -2119,9 +2147,11 @@ function dol_compress_dir($inputdir, $outputfile, $mode = "zip") // Get real and relative path for current file $filePath = $file->getRealPath(); $relativePath = substr($filePath, strlen($inputdir) + 1); - - // Add current file to archive - $zip->addFile($filePath, $relativePath); + if (empty($excludefiles) || ! preg_match($excludefiles, $filePath)) + { + // Add current file to archive + $zip->addFile($filePath, $relativePath); + } } } diff --git a/htdocs/core/lib/multicurrency.lib.php b/htdocs/core/lib/multicurrency.lib.php index 339ca2d01bc..e44511fcb97 100644 --- a/htdocs/core/lib/multicurrency.lib.php +++ b/htdocs/core/lib/multicurrency.lib.php @@ -40,7 +40,7 @@ function multicurrencyAdminPrepareHead() $head[$h][2] = 'settings'; $h++; - complete_head_from_modules($conf, $langs, $object, $head, $h, 'multicurrency'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency'); return $head; } diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 84be86f4a15..c1d42bf25b7 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -59,7 +59,7 @@ function ticketAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@ticket:/ticket/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticketadmin'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'ticketadmin'); return $head; } diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 9a30a063ad3..10e5f9e93c9 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -66,6 +66,7 @@ class mailing_thirdparties extends MailingTargets $cibles = array(); + $addDescription= ""; // Select the third parties from category if (empty($_POST['filter'])) { @@ -77,6 +78,50 @@ class mailing_thirdparties extends MailingTargets } else { + $addFilter =""; + if (isset($_POST["filter_client"]) && $_POST["filter_client"] <> '-1') + { + $addFilter.= " AND s.client=" . $_POST["filter_client"]; + $addDescription= $langs->trans('ProspectCustomer')."="; + if ($_POST["filter_client"] == 0) + { + $addDescription.= $langs->trans('NorProspectNorCustomer'); + } + elseif ($_POST["filter_client"] == 1) + { + $addDescription.= $langs->trans('Customer'); + } + elseif ($_POST["filter_client"] == 2) + { + $addDescription.= $langs->trans('Prospect'); + } + elseif ($_POST["filter_client"] == 3) + { + $addDescription.= $langs->trans('ProspectCustomer'); + } + else + { + $addDescription.= "Unknown status ".$_POST["filter_client"]; + } + } + if (isset($_POST["filter_status"])) + { + if (strlen($addDescription) > 0) + { + $addDescription.= ";"; + } + $addDescription.= $langs->trans("Status")."="; + if ($_POST["filter_status"] == '1') + { + $addFilter.= " AND s.status=1"; + $addDescription.= $langs->trans("Enabled"); + } + else + { + $addFilter.= " AND s.status=0"; + $addDescription.= $langs->trans("Disabled"); + } + } $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_societe as cs, ".MAIN_DB_PREFIX."categorie as c"; $sql.= " WHERE s.email <> ''"; @@ -85,6 +130,7 @@ class mailing_thirdparties extends MailingTargets $sql.= " AND cs.fk_soc = s.rowid"; $sql.= " AND c.rowid = cs.fk_categorie"; $sql.= " AND c.rowid='".$this->db->escape($_POST['filter'])."'"; + $sql.= $addFilter; $sql.= " UNION "; $sql.= "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_fournisseur as cs, ".MAIN_DB_PREFIX."categorie as c"; @@ -94,51 +140,7 @@ class mailing_thirdparties extends MailingTargets $sql.= " AND cs.fk_soc = s.rowid"; $sql.= " AND c.rowid = cs.fk_categorie"; $sql.= " AND c.rowid='".$this->db->escape($_POST['filter'])."'"; - } - - $addDescription= ""; - if (isset($_POST["filter_client"]) && $_POST["filter_client"] <> '-1') - { - $sql.= " AND s.client=" . $_POST["filter_client"]; - $addDescription= $langs->trans('ProspectCustomer')."="; - if ($_POST["filter_client"] == 0) - { - $addDescription.= $langs->trans('NorProspectNorCustomer'); - } - elseif ($_POST["filter_client"] == 1) - { - $addDescription.= $langs->trans('Customer'); - } - elseif ($_POST["filter_client"] == 2) - { - $addDescription.= $langs->trans('Prospect'); - } - elseif ($_POST["filter_client"] == 3) - { - $addDescription.= $langs->trans('ProspectCustomer'); - } - else - { - $addDescription.= "Unknown status ".$_POST["filter_client"]; - } - } - if (isset($_POST["filter_status"])) - { - if (strlen($addDescription) > 0) - { - $addDescription.= ";"; - } - $addDescription.= $langs->trans("Status")."="; - if ($_POST["filter_status"] == '1') - { - $sql.= " AND s.status=1"; - $addDescription.= $langs->trans("Enabled"); - } - else - { - $sql.= " AND s.status=0"; - $addDescription.= $langs->trans("Disabled"); - } + $sql.= $addFilter; } $sql.= " ORDER BY email"; diff --git a/htdocs/core/modules/modDebugBar.class.php b/htdocs/core/modules/modDebugBar.class.php index 8d51a102251..b69406ffb57 100644 --- a/htdocs/core/modules/modDebugBar.class.php +++ b/htdocs/core/modules/modDebugBar.class.php @@ -16,7 +16,7 @@ */ /** - * \defgroup debugbar Debug bar + * \defgroup debugbar Module Debug bar * \brief debugbar module descriptor. * * \file htdocs/core/modules/modDebugBar.class.php diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index e16b6e87fd0..620c1639901 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -19,6 +19,7 @@ /** * \defgroup ticket Module Ticket + * \brief Module for ticket and request management. * \file core/modules/modTicket.class.php * \ingroup ticket * \brief Description and activation file for module Ticket diff --git a/htdocs/datapolicy/lib/datapolicy.lib.php b/htdocs/datapolicy/lib/datapolicy.lib.php index b72417d7ff9..1ea83696a1b 100644 --- a/htdocs/datapolicy/lib/datapolicy.lib.php +++ b/htdocs/datapolicy/lib/datapolicy.lib.php @@ -48,7 +48,9 @@ function datapolicyAdminPrepareHead() $h++; } - complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicy'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'datapolicy'); + + complete_head_from_modules($conf, $langs, null, $head, $h, 'datapolicy', 'remove'); return $head; } diff --git a/htdocs/dav/dav.lib.php b/htdocs/dav/dav.lib.php index 3c213f400c1..058fc635fc7 100644 --- a/htdocs/dav/dav.lib.php +++ b/htdocs/dav/dav.lib.php @@ -63,9 +63,9 @@ function dav_admin_prepare_head() // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'admindav'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'admindav'); - complete_head_from_modules($conf, $langs, $object, $head, $h, 'admindav', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'admindav', 'remove'); return $head; } diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php index e7cc3bcb3a0..e9cb3984819 100644 --- a/htdocs/emailcollector/lib/emailcollector.lib.php +++ b/htdocs/emailcollector/lib/emailcollector.lib.php @@ -81,5 +81,7 @@ function emailcollectorPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailcollector'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailcollector', 'remove'); + return $head; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 9b1a62ed402..32915339297 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2340,7 +2340,7 @@ class ExpenseReport extends CommonObject { $response->warning_delay=$conf->expensereport->payment->warning_delay/60/60/24; $response->label=$langs->trans("ExpenseReportsToPay"); - $response->labelShort=$langs->trans("ToPay"); + $response->labelShort=$langs->trans("StatusToPay"); $response->url=DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=5'; } $response->img=img_object('', "trip"); diff --git a/htdocs/externalsite/frames.php b/htdocs/externalsite/frames.php index eb8e06919d3..9c232cbe710 100644 --- a/htdocs/externalsite/frames.php +++ b/htdocs/externalsite/frames.php @@ -49,6 +49,7 @@ if (empty($keyforcontent) && empty($conf->global->EXTERNALSITE_URL)) llxHeader(); print '
'.$langs->trans('ExternalSiteModuleNotComplete').'
'; llxFooter(); + exit; } if (! empty($keyforcontent)) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 2edd86d1c10..c38107b14b4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1822,10 +1822,9 @@ class CommandeFournisseur extends CommonOrder $error++; } - // Si module stock gere et que incrementation faite depuis un dispatching en stock + // If module stock is enabled and the stock increase is done on purchase order dispatching if (! $error && $entrepot > 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { - $mouv = new MouvementStock($this->db); if ($product > 0) { diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index a3e6666f412..ac19cac8a34 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2203,7 +2203,7 @@ class FactureFournisseur extends CommonInvoice $response = new WorkboardResponse(); $response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24; $response->label=$langs->trans("SupplierBillsToPay"); - $response->labelShort=$langs->trans("ToPay"); + $response->labelShort=$langs->trans("StatusToPay"); $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=billing&leftmenu=suppliers_bills'; $response->img=img_object($langs->trans("Bills"), "bill"); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ff33a42e2a9..66b48164a9e 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2346,7 +2346,7 @@ elseif (! empty($object->id)) }*/ // Modify - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->commander) { @@ -2355,7 +2355,7 @@ elseif (! empty($object->id)) } // Approve - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->approuver) { @@ -2377,7 +2377,7 @@ elseif (! empty($object->id)) // Second approval (if option SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED is set) if (! empty($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) && $conf->global->MAIN_FEATURES_LEVEL > 0 && $object->total_ht >= $conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) { - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->approve2) { @@ -2398,7 +2398,7 @@ elseif (! empty($object->id)) } // Refuse - if ($object->statut == 1) + if ($object->statut == CommandeFournisseur::STATUS_VALIDATED) { if ($user->rights->fournisseur->commande->approuver || $user->rights->fournisseur->commande->approve2) { @@ -2411,7 +2411,7 @@ elseif (! empty($object->id)) } // Send - if (in_array($object->statut, array(2, 3, 4, 5))) + if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED, 3, 4, 5))) { if ($user->rights->fournisseur->commande->commander) { @@ -2420,7 +2420,7 @@ elseif (! empty($object->id)) } // Reopen - if (in_array($object->statut, array(2))) + if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED))) { $buttonshown=0; if (! $buttonshown && $user->rights->fournisseur->commande->approuver) @@ -2462,7 +2462,7 @@ elseif (! empty($object->id)) } } - if ($object->statut == 2) + if ($object->statut == CommandeFournisseur::STATUS_ACCEPTED) { if ($user->rights->fournisseur->commande->commander) { @@ -2474,6 +2474,15 @@ elseif (! empty($object->id)) } } + // Classify received (this does not record reception) + if ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY) + { + if ($user->rights->fournisseur->commande->receptionner) + { + print ''; + } + } + // Create bill //if (! empty($conf->facture->enabled)) //{ @@ -2590,38 +2599,41 @@ elseif (! empty($object->id)) print '
'; - if ($user->rights->fournisseur->commande->receptionner && ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY)) + if ($action == 'classifyreception') { - // Set status to received (action=livraison) - print ''."\n"; - print '
'; - print ''; - print ''; - print load_fiche_titre($langs->trans("Receive"), '', ''); + if ($user->rights->fournisseur->commande->receptionner && ($object->statut == CommandeFournisseur::STATUS_ORDERSENT || $object->statut == CommandeFournisseur::STATUS_RECEIVED_PARTIALLY)) + { + // Set status to received (action=livraison) + print ''."\n"; + print ''; + print ''; + print ''; + print load_fiche_titre($langs->trans("Receive"), '', ''); - print ''; - //print ''; - print '\n"; + print '
'.$langs->trans("Receive").'
'.$langs->trans("DeliveryDate").''; - $datepreselected = dol_now(); - print $form->selectDate($datepreselected, '', 1, 1, '', "commande", 1, 1); - print "
'; + //print ''; + print '\n"; - print ''; - print ''; - print ''; - print "
'.$langs->trans("Receive").'
'.$langs->trans("DeliveryDate").''; + $datepreselected = dol_now(); + print $form->selectDate($datepreselected, '', 1, 1, '', "commande", 1, 1); + print "
'.$langs->trans("Delivery")."\n"; - $liv = array(); - $liv[''] = ' '; - $liv['tot'] = $langs->trans("CompleteOrNoMoreReceptionExpected"); - $liv['par'] = $langs->trans("PartialWoman"); - $liv['nev'] = $langs->trans("NeverReceived"); - $liv['can'] = $langs->trans("Canceled"); + print '
'.$langs->trans("Delivery")."\n"; + $liv = array(); + $liv[''] = ' '; + $liv['tot'] = $langs->trans("CompleteOrNoMoreReceptionExpected"); + $liv['par'] = $langs->trans("PartialWoman"); + $liv['nev'] = $langs->trans("NeverReceived"); + $liv['can'] = $langs->trans("Canceled"); - print $form->selectarray("type", $liv); + print $form->selectarray("type", $liv); - print '
'.$langs->trans("Comment").'
\n"; - print "
\n"; - print "
"; + print '
'.$langs->trans("Comment").'
\n"; + print "\n"; + print "
"; + } } // List of actions on element diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 87305a19fd4..2207148e4ea 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -122,7 +122,7 @@ if ($action == 'create') elseif ($starthalfday == 'afternoon') $halfday=-1; elseif ($endhalfday == 'morning') $halfday=1; - $valideur = GETPOST('valideur'); + $valideur = GETPOST('valideur', 'int'); $description = trim(GETPOST('description')); // If no type @@ -270,8 +270,8 @@ if ($action == 'update' && ! GETPOSTISSET('savevalidator')) // If this is the requestor or has read/write rights if ($cancreate) { - $valideur = $_POST['valideur']; - $description = trim($_POST['description']); + $valideur = GETPOST('valideur', 'int'); + $description = trim(GETPOST('description', 'none')); // If no start date if (empty($_POST['date_debut_'])) { @@ -1297,7 +1297,8 @@ else if (empty($include_users)) print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateHolidays"); else { - $s=$form->select_dolusers($object->fk_validator, "valideur", (($action == 'editvalidator') ? 0 : 1), ($user->admin ? '' : array($user->id)), 0, $include_users); + $arrayofvalidatorstoexclude = (($user->admin || ($user->id != $userRequest->id))? '' : array($user->id)); // Nobody if we are admin or if we are not the user of the leave. + $s=$form->select_dolusers($object->fk_validator, "valideur", (($action == 'editvalidator') ? 0 : 1), $arrayofvalidatorstoexclude, 0, $include_users); print $form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate")); } if ($action == 'editvalidator') diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 66c212ef4c7..d767bcdc691 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -376,7 +376,6 @@ class Holiday extends CommonObject $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; - $this->rowid = $obj->rowid; // deprecated $this->ref = ($obj->ref?$obj->ref:$obj->rowid); $this->fk_user = $obj->fk_user; $this->date_create = $this->db->jdate($obj->date_create); diff --git a/htdocs/index.php b/htdocs/index.php index 4e83f376db3..d50b5248fab 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -366,484 +366,472 @@ if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTAT /* * Dolibarr Working Board with weather */ -$showweather=(empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0; +if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { + $showweather = (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0; //Array that contains all WorkboardResponse classes to process them -$dashboardlines=array(); + $dashboardlines = array(); // Do not include sections without management permission -require_once DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php'; + require_once DOL_DOCUMENT_ROOT . '/core/class/workboardresponse.class.php'; // Number of actions to do (late) -if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->read) -{ - include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - $board=new ActionComm($db); - $dashboardlines[$board->element] = $board->load_board($user); -} + if (!empty($conf->agenda->enabled) && $user->rights->agenda->myactions->read) { + include_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; + $board = new ActionComm($db); + $dashboardlines[$board->element] = $board->load_board($user); + } // Number of project opened -if (! empty($conf->projet->enabled) && $user->rights->projet->lire) -{ - include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - $board=new Project($db); - $dashboardlines[$board->element] = $board->load_board($user); -} + if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { + include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; + $board = new Project($db); + $dashboardlines[$board->element] = $board->load_board($user); + } // Number of tasks to do (late) -if (! empty($conf->projet->enabled) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) -{ - include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; - $board=new Task($db); - $dashboardlines[$board->element] = $board->load_board($user); -} + if (!empty($conf->projet->enabled) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) { + include_once DOL_DOCUMENT_ROOT . '/projet/class/task.class.php'; + $board = new Task($db); + $dashboardlines[$board->element] = $board->load_board($user); + } // Number of commercial proposals opened (expired) -if (! empty($conf->propal->enabled) && $user->rights->propale->lire) -{ - include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; - $board=new Propal($db); - $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); - // Number of commercial proposals CLOSED signed (billed) - $dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed"); -} + if (!empty($conf->propal->enabled) && $user->rights->propale->lire) { + include_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; + $board = new Propal($db); + $dashboardlines[$board->element . '_opened'] = $board->load_board($user, "opened"); + // Number of commercial proposals CLOSED signed (billed) + $dashboardlines[$board->element . '_signed'] = $board->load_board($user, "signed"); + } // Number of commercial proposals opened (expired) -if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) -{ - include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; - $board=new SupplierProposal($db); - $dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened"); - // Number of commercial proposals CLOSED signed (billed) - $dashboardlines[$board->element.'_signed'] = $board->load_board($user, "signed"); -} + if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire) { + include_once DOL_DOCUMENT_ROOT . '/supplier_proposal/class/supplier_proposal.class.php'; + $board = new SupplierProposal($db); + $dashboardlines[$board->element . '_opened'] = $board->load_board($user, "opened"); + // Number of commercial proposals CLOSED signed (billed) + $dashboardlines[$board->element . '_signed'] = $board->load_board($user, "signed"); + } // Number of customer orders a deal -if (! empty($conf->commande->enabled) && $user->rights->commande->lire) -{ - include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; - $board=new Commande($db); - $dashboardlines[$board->element] = $board->load_board($user); -} + if (!empty($conf->commande->enabled) && $user->rights->commande->lire) { + include_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; + $board = new Commande($db); + $dashboardlines[$board->element] = $board->load_board($user); + } // Number of suppliers orders a deal -if (! empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire) -{ - include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; - $board=new CommandeFournisseur($db); - $dashboardlines[$board->element] = $board->load_board($user); -} + if (!empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire) { + include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.commande.class.php'; + $board = new CommandeFournisseur($db); + $dashboardlines[$board->element] = $board->load_board($user); + } // Number of services enabled (delayed) -if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) -{ - include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; - $board=new Contrat($db); - $dashboardlines[$board->element.'_inactive'] = $board->load_board($user, "inactive"); - // Number of active services (expired) - $dashboardlines[$board->element.'_active'] = $board->load_board($user, "active"); -} + if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) { + include_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php'; + $board = new Contrat($db); + $dashboardlines[$board->element . '_inactive'] = $board->load_board($user, "inactive"); + // Number of active services (expired) + $dashboardlines[$board->element . '_active'] = $board->load_board($user, "active"); + } // Number of invoices customers (has paid) -if (! empty($conf->facture->enabled) && $user->rights->facture->lire) -{ - include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $board=new Facture($db); - $dashboardlines[$board->element] = $board->load_board($user); -} + if (!empty($conf->facture->enabled) && $user->rights->facture->lire) { + include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; + $board = new Facture($db); + $dashboardlines[$board->element] = $board->load_board($user); + } // Number of supplier invoices (has paid) -if (! empty($conf->supplier_invoice->enabled) && ! empty($user->rights->fournisseur->facture->lire)) -{ - include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; - $board=new FactureFournisseur($db); - $dashboardlines[$board->element] = $board->load_board($user); -} + if (!empty($conf->supplier_invoice->enabled) && !empty($user->rights->fournisseur->facture->lire)) { + include_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; + $board = new FactureFournisseur($db); + $dashboardlines[$board->element] = $board->load_board($user); + } // Number of transactions to conciliate -if (! empty($conf->banque->enabled) && $user->rights->banque->lire && ! $user->societe_id) -{ - include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; - $board=new Account($db); - $nb = $board::countAccountToReconcile(); // Get nb of account to reconciliate - if ($nb > 0) - { - $dashboardlines[$board->element] = $board->load_board($user); - } -} + if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->societe_id) { + include_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; + $board = new Account($db); + $nb = $board::countAccountToReconcile(); // Get nb of account to reconciliate + if ($nb > 0) { + $dashboardlines[$board->element] = $board->load_board($user); + } + } // Number of cheque to send -if (! empty($conf->banque->enabled) && $user->rights->banque->lire && ! $user->societe_id && empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) -{ - include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; - $board=new RemiseCheque($db); - $dashboardlines['RemiseCheque'] = $board->load_board($user); -} + if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->societe_id && empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) { + include_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php'; + $board = new RemiseCheque($db); + $dashboardlines['RemiseCheque'] = $board->load_board($user); + } // Number of foundation members -if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire && ! $user->societe_id) -{ - include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; - $board=new Adherent($db); - $dashboardlines['Adherent'] = $board->load_board($user); -} + if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire && !$user->societe_id) { + include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php'; + $board = new Adherent($db); + $dashboardlines['Adherent'] = $board->load_board($user); + } // Number of expense reports to approve -if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->approve) -{ - include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; - $board=new ExpenseReport($db); - $dashboardlines['ExpenseReport'] = $board->load_board($user, 'toapprove'); -} + if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->approve) { + include_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; + $board = new ExpenseReport($db); + $dashboardlines['ExpenseReport'] = $board->load_board($user, 'toapprove'); + } // Number of expense reports to pay -if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->to_paid) -{ - include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; - $board=new ExpenseReport($db); - $dashboardlines['ExpenseReport'] = $board->load_board($user, 'topay'); -} + if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->to_paid) { + include_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; + $board = new ExpenseReport($db); + $dashboardlines['ExpenseReport'] = $board->load_board($user, 'topay'); + } // Number of holidays to approve -if (! empty($conf->holiday->enabled) && $user->rights->holiday->approve) -{ - include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; - $board=new Holiday($db); - $dashboardlines['Holiday'] = $board->load_board($user); -} + if (!empty($conf->holiday->enabled) && $user->rights->holiday->approve) { + include_once DOL_DOCUMENT_ROOT . '/holiday/class/holiday.class.php'; + $board = new Holiday($db); + $dashboardlines['Holiday'] = $board->load_board($user); + } -$object=new stdClass(); -$parameters=array(); -$action=''; -$reshook=$hookmanager->executeHooks('addOpenElementsDashboardLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks -if ($reshook == 0) { - $dashboardlines = array_merge($dashboardlines, $hookmanager->resArray); -} + $object = new stdClass(); + $parameters = array(); + $action = ''; + $reshook = $hookmanager->executeHooks('addOpenElementsDashboardLine', $parameters, $object, + $action); // Note that $action and $object may have been modified by some hooks + if ($reshook == 0) { + $dashboardlines = array_merge($dashboardlines, $hookmanager->resArray); + } -/* grouping dashboard stats */ -$dashboardgroup = array ( - 'action' => - array ( - 'groupName' => 'Agenda', - 'stats' => array ('action'), - ), - 'project' => - array ( - 'groupName' => 'Projects', - 'stats' => array ('project','project_task'), - ), - 'propal' => - array ( - 'groupName' => 'Proposals', - 'stats' => - array ('propal_opened','propal_signed'), - ), - 'commande' => - array ( - 'groupName' => 'Orders', - 'stats' => - array ('commande'), - ), - 'facture' => - array ( - 'groupName' => 'Invoices', - 'stats' => - array ('facture'), - ), - 'contrat' => - array ( - 'groupName' => 'Contracts', - 'stats' => - array ('contrat_inactive','contrat_active'), - ), - 'supplier_proposal' => - array ( - 'groupName' => 'SupplierProposals', - 'stats' => - array ('supplier_proposal_opened','supplier_proposal_signed'), - ), - 'order_supplier' => - array ( - 'groupName' => 'SuppliersOrders', - 'stats' => - array ('order_supplier'), - ), - 'invoice_supplier' => - array ( - 'groupName' => 'BillsSuppliers', - 'stats' => - array ('invoice_supplier'), - ), - 'bank_account' => - array ( - 'groupName' => 'BankAccount', - 'stats' => - array ('bank_account','RemiseCheque'), - ), - 'Adherent' => - array ( - 'groupName' => 'Members', - 'stats' => - array ('Adherent'), - ), - 'ExpenseReport' => - array ( - 'groupName' => 'ExpenseReport', - 'stats' => - array ('ExpenseReport'), - ), - 'Holiday' => - array ( - 'groupName' => 'Holidays', - 'stats' => - array ('Holiday'), - ), -); + /* grouping dashboard stats */ + $dashboardgroup = array( + 'action' => + array( + 'groupName' => 'Agenda', + 'stats' => array('action'), + ), + 'project' => + array( + 'groupName' => 'Projects', + 'stats' => array('project', 'project_task'), + ), + 'propal' => + array( + 'groupName' => 'Proposals', + 'stats' => + array('propal_opened', 'propal_signed'), + ), + 'commande' => + array( + 'groupName' => 'Orders', + 'stats' => + array('commande'), + ), + 'facture' => + array( + 'groupName' => 'Invoices', + 'stats' => + array('facture'), + ), + 'contrat' => + array( + 'groupName' => 'Contracts', + 'stats' => + array('contrat_inactive', 'contrat_active'), + ), + 'supplier_proposal' => + array( + 'groupName' => 'SupplierProposals', + 'stats' => + array('supplier_proposal_opened', 'supplier_proposal_signed'), + ), + 'order_supplier' => + array( + 'groupName' => 'SuppliersOrders', + 'stats' => + array('order_supplier'), + ), + 'invoice_supplier' => + array( + 'groupName' => 'BillsSuppliers', + 'stats' => + array('invoice_supplier'), + ), + 'bank_account' => + array( + 'groupName' => 'BankAccount', + 'stats' => + array('bank_account', 'RemiseCheque'), + ), + 'Adherent' => + array( + 'groupName' => 'Members', + 'stats' => + array('Adherent'), + ), + 'ExpenseReport' => + array( + 'groupName' => 'ExpenseReport', + 'stats' => + array('ExpenseReport'), + ), + 'Holiday' => + array( + 'groupName' => 'Holidays', + 'stats' => + array('Holiday'), + ), + ); -$object=new stdClass(); -$parameters=array( - 'dashboardgroup' => $dashboardgroup -); -$reshook=$hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks -if ($reshook == 0) { - $dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray); -} + $object = new stdClass(); + $parameters = array( + 'dashboardgroup' => $dashboardgroup + ); + $reshook = $hookmanager->executeHooks('addOpenElementsDashboardGroup', $parameters, $object, + $action); // Note that $action and $object may have been modified by some hooks + if ($reshook == 0) { + $dashboardgroup = array_merge($dashboardgroup, $hookmanager->resArray); + } // Calculate total nb of late -$totallate=$totaltodo=0; + $totallate = $totaltodo = 0; //Remove any invalid response //load_board can return an integer if failed or WorkboardResponse if OK -$valid_dashboardlines=array(); -foreach($dashboardlines as $infoKey => $tmp) -{ - if ($tmp instanceof WorkboardResponse) $valid_dashboardlines[$infoKey] = $tmp; -} + $valid_dashboardlines = array(); + foreach ($dashboardlines as $infoKey => $tmp) { + if ($tmp instanceof WorkboardResponse) { + $valid_dashboardlines[$infoKey] = $tmp; + } + } // We calculate $totallate. Must be defined before start of next loop because it is show in first fetch on next loop -foreach($valid_dashboardlines as $board) -{ - if ($board->nbtodolate > 0) { - $totaltodo += $board->nbtodo; - $totallate += $board->nbtodolate; + foreach ($valid_dashboardlines as $board) { + if ($board->nbtodolate > 0) { + $totaltodo += $board->nbtodo; + $totallate += $board->nbtodolate; + } } -} -$openedDashBoardSize = 'info-box-sm'; // use sm by default -foreach ($dashboardgroup as $dashbordelement){ - if (is_array($dashbordelement['stats']) && count($dashbordelement['stats'])>2){ - $openedDashBoardSize = ''; // use default info box size : big - break; + $openedDashBoardSize = 'info-box-sm'; // use sm by default + foreach ($dashboardgroup as $dashbordelement) { + if (is_array($dashbordelement['stats']) && count($dashbordelement['stats']) > 2) { + $openedDashBoardSize = ''; // use default info box size : big + break; + } } -} -$totalLateNumber = $totallate; -$totallatePercentage = ((! empty($totaltodo)) ? round($totallate / $totaltodo * 100, 2) : 0); -if(! empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $totallate = $totallatePercentage; + $totalLateNumber = $totallate; + $totallatePercentage = ((!empty($totaltodo)) ? round($totallate / $totaltodo * 100, 2) : 0); + if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) { + $totallate = $totallatePercentage; + } -$boxwork=''; -$boxwork.='
'; -$boxwork.=''."\n"; -$boxwork.=''; -$boxwork.=''; -$boxwork.=''."\n"; + $boxwork = ''; + $boxwork .= '
'; + $boxwork .= '
'.$langs->trans("DolibarrWorkBoard").'
'; -if ($showweather) -{ - if ($totallate > 0) $text=$langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate", $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')'; - else $text=$langs->transnoentitiesnoconv("NoItemLate"); - $text.='. '.$langs->transnoentitiesnoconv("LateDesc"); - //$text.=$form->textwithpicto('',$langs->trans("LateDesc")); - $options='height="24px" style="float: right"'; - $boxwork.=showWeather($totallate, $text, $options, 'inline-block valignmiddle'); -} -$boxwork.='
' . "\n"; + $boxwork .= ''; + $boxwork .= ''; + $boxwork .= '' . "\n"; // Show dashboard -$nbworkboardempty=0; -$isIntopOpenedDashBoard = array(); -if (!empty($valid_dashboardlines)) -{ - $openedDashBoard = ''; + $nbworkboardempty = 0; + $isIntopOpenedDashBoard = array(); + if (!empty($valid_dashboardlines)) { + $openedDashBoard = ''; - $boxwork.=''; + } else { + $boxwork .= ''; + $boxwork .= ''; + $boxwork .= ''; } - $boxwork .='
'; - $boxwork .='
'; - $boxwork .='
'; - $boxwork .='
'; + $boxwork .= ''; - $boxwork .=''; - $boxwork .=''; -} -else -{ - $boxwork.=''; - $boxwork.=''; - $boxwork.=''; + $boxwork .= '
' . $langs->trans("DolibarrWorkBoard") . '
'; + if ($showweather) { + if ($totallate > 0) { + $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate") . ' (' . $langs->transnoentitiesnoconv("NActionsLate", + $totallate . (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')) . ')'; + } else { + $text = $langs->transnoentitiesnoconv("NoItemLate"); + } + $text .= '. ' . $langs->transnoentitiesnoconv("LateDesc"); + //$text.=$form->textwithpicto('',$langs->trans("LateDesc")); + $options = 'height="24px" style="float: right"'; + $boxwork .= showWeather($totallate, $text, $options, 'inline-block valignmiddle'); + } + $boxwork .= '
'; + $boxwork .= '
'; - foreach($dashboardgroup as $groupKey => $groupElement) { - $boards = array(); + foreach ($dashboardgroup as $groupKey => $groupElement) { + $boards = array(); - if(!empty($conf->global->MAIN_DISPLAY_NEW_OPENED_DASH_BOARD) || !empty($conf->global->MAIN_FEATURES_LEVEL)) - { - foreach ($groupElement['stats'] as $infoKey) - { - if(!empty($valid_dashboardlines[$infoKey])) - { - $boards[] = $valid_dashboardlines[$infoKey]; - $isIntopOpenedDashBoard[]=$infoKey; - } - } - } + if (!empty($conf->global->MAIN_DISPLAY_NEW_OPENED_DASH_BOARD) || !empty($conf->global->MAIN_FEATURES_LEVEL)) { + foreach ($groupElement['stats'] as $infoKey) { + if (!empty($valid_dashboardlines[$infoKey])) { + $boards[] = $valid_dashboardlines[$infoKey]; + $isIntopOpenedDashBoard[] = $infoKey; + } + } + } - if(!empty($boards)) - { - $groupName = $langs->trans($groupElement['groupName']); - $groupKeyLowerCase = strtolower($groupKey); + if (!empty($boards)) { + $groupName = $langs->trans($groupElement['groupName']); + $groupKeyLowerCase = strtolower($groupKey); - $openedDashBoard.= '
'."\n"; - $openedDashBoard.= '
'."\n"; - $openedDashBoard.= ' '."\n"; - $openedDashBoard.= '
'."\n"; - $openedDashBoard .= ' '.$groupName.'' . "\n"; + $openedDashBoard .= '
' . "\n"; + $openedDashBoard .= '
' . "\n"; + $openedDashBoard .= ' ' . "\n"; + $openedDashBoard .= '
' . "\n"; + $openedDashBoard .= ' ' . $groupName . '' . "\n"; - foreach($boards as $board) { - if(!empty($board->labelShort)){ - $infoName = ''.$board->labelShort.''; - } - else{ - $infoName = $board->label ; - } + foreach ($boards as $board) { + if (!empty($board->labelShort)) { + $infoName = '' . $board->labelShort . ''; + } else { + $infoName = $board->label; + } - $textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate); - $textLateTitle.= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')'; + $textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate); + $textLateTitle .= ' (' . $langs->trans("Late") . ' = ' . $langs->trans("DateReference") . ' > ' . $langs->trans("DateToday") . ' ' . (ceil($board->warning_delay) >= 0 ? '+' : '') . ceil($board->warning_delay) . ' ' . $langs->trans("days") . ')'; - $textLate = ''; - if($board->nbtodolate>0) - { - $textLate .= ' '; - $textLate .= ' '.$board->nbtodolate; - $textLate .= ''; - } + $textLate = ''; + if ($board->nbtodolate > 0) { + $textLate .= ' '; + $textLate .= ' ' . $board->nbtodolate; + $textLate .= ''; + } - $nbtodClass = ''; - if($board->nbtodo>0){ - $nbtodClass = 'badge badge-info'; - } + $nbtodClass = ''; + if ($board->nbtodo > 0) { + $nbtodClass = 'badge badge-info'; + } - $openedDashBoard .= ' '.$infoName.' : '.$board->nbtodo.''.$textLate.'' . "\n"; + $openedDashBoard .= ' ' . $infoName . ' : ' . $board->nbtodo . '' . $textLate . '' . "\n"; - if ($board->total > 0 && ! empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)){ - $openedDashBoard .= ''.$langs->trans('Total').' : '.price($board->total) .''; - } - } + if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) { + $openedDashBoard .= '' . $langs->trans('Total') . ' : ' . price($board->total) . ''; + } + } - $openedDashBoard.= '
'."\n"; - $openedDashBoard.= '
'."\n"; - $openedDashBoard.= '
'."\n"; - $openedDashBoard.="\n"; - } - } - - if ($showweather && !empty($isIntopOpenedDashBoard)) - { - $appendClass = $conf->global->MAIN_DISABLE_METEO == 2 ?' hideonsmartphone' : ''; - $weather = getWeatherStatus($totallate); - - $text=''; - if ($totallate > 0) $text=$langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate", $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')'; - else $text=$langs->transnoentitiesnoconv("NoItemLate"); - $text.='. '.$langs->transnoentitiesnoconv("LateDesc"); - - $weatherDashBoard= '
'."\n"; - $weatherDashBoard.= '
'."\n"; - $weatherDashBoard.= ' '; - $weatherDashBoard.= img_weather('', $weather->level, '', 0, 'valignmiddle width50'); - $weatherDashBoard.= ' '."\n"; - $weatherDashBoard.= '
'."\n"; - $weatherDashBoard.= ' '.$langs->trans('GlobalOpenedElemView').'' . "\n"; - - if($totallatePercentage>0 && !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) { - $weatherDashBoard.= ' '.$langs->transnoentitiesnoconv("NActionsLate", price($totallatePercentage).'%').'' . "\n"; - $weatherDashBoard.= ' '.$langs->trans('NActionsLate', $totalLateNumber).'' . "\n"; - } - else{ - $weatherDashBoard.= ' '.$langs->transnoentitiesnoconv("NActionsLate", $totalLateNumber).'' . "\n"; - if($totallatePercentage>0) { - $weatherDashBoard.= ' '.$langs->trans('NActionsLate', price($totallatePercentage).'%').'' . "\n"; - } - } - - $weatherDashBoard.= '
'."\n"; - $weatherDashBoard.= '
'."\n"; - $weatherDashBoard.= '
'."\n"; - $weatherDashBoard.="\n"; - - $openedDashBoard=$weatherDashBoard.$openedDashBoard; - } - - if(!empty($isIntopOpenedDashBoard)) - { - for ($i = 1; $i <= 10; $i++) { - $openedDashBoard .= '
'; - } - } - - $nbworkboardcount=0; - foreach($valid_dashboardlines as $infoKey => $board) - { - if(in_array($infoKey, $isIntopOpenedDashBoard)) { - // skip if info is present on top - continue; - } - - if (empty($board->nbtodo)) $nbworkboardempty++; - $nbworkboardcount++; - - - $textlate = $langs->trans("NActionsLate", $board->nbtodolate); - $textlate.= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')'; - - - $boxwork .='
'; - $boxwork .= '
'; - $boxwork .= ''.$board->img.' '.$board->label.'
'; - $boxwork .= ''.$board->nbtodo.''; - if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) - { - $boxwork .= ' / '.price($board->total) .''; + $openedDashBoard .= '
' . "\n"; + $openedDashBoard .= '
' . "\n"; + $openedDashBoard .= '
' . "\n"; + $openedDashBoard .= "\n"; + } } - $boxwork .= '
'; - if ($board->nbtodolate > 0) - { - $boxwork .= '
'; - $boxwork .= ''; - //$boxwork .= img_picto($textlate, "warning_white", 'class="valigntextbottom"').''; - $boxwork .= img_picto($textlate, "warning_white", 'class="inline-block hideonsmartphone valigntextbottom"').''; - $boxwork .= ''; - $boxwork .= $board->nbtodolate; - $boxwork .= ''; - $boxwork .= ''; + + if ($showweather && !empty($isIntopOpenedDashBoard)) { + $appendClass = $conf->global->MAIN_DISABLE_METEO == 2 ? ' hideonsmartphone' : ''; + $weather = getWeatherStatus($totallate); + + $text = ''; + if ($totallate > 0) { + $text = $langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate") . ' (' . $langs->transnoentitiesnoconv("NActionsLate", + $totallate . (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')) . ')'; + } else { + $text = $langs->transnoentitiesnoconv("NoItemLate"); + } + $text .= '. ' . $langs->transnoentitiesnoconv("LateDesc"); + + $weatherDashBoard = '
' . "\n"; + $weatherDashBoard .= '
' . "\n"; + $weatherDashBoard .= ' '; + $weatherDashBoard .= img_weather('', $weather->level, '', 0, 'valignmiddle width50'); + $weatherDashBoard .= ' ' . "\n"; + $weatherDashBoard .= '
' . "\n"; + $weatherDashBoard .= ' ' . $langs->trans('GlobalOpenedElemView') . '' . "\n"; + + if ($totallatePercentage > 0 && !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) { + $weatherDashBoard .= ' ' . $langs->transnoentitiesnoconv("NActionsLate", + price($totallatePercentage) . '%') . '' . "\n"; + $weatherDashBoard .= ' ' . $langs->trans('NActionsLate', + $totalLateNumber) . '' . "\n"; + } else { + $weatherDashBoard .= ' ' . $langs->transnoentitiesnoconv("NActionsLate", + $totalLateNumber) . '' . "\n"; + if ($totallatePercentage > 0) { + $weatherDashBoard .= ' ' . $langs->trans('NActionsLate', + price($totallatePercentage) . '%') . '' . "\n"; + } + } + + $weatherDashBoard .= '
' . "\n"; + $weatherDashBoard .= '
' . "\n"; + $weatherDashBoard .= '
' . "\n"; + $weatherDashBoard .= "\n"; + + $openedDashBoard = $weatherDashBoard . $openedDashBoard; + } + + if (!empty($isIntopOpenedDashBoard)) { + for ($i = 1; $i <= 10; $i++) { + $openedDashBoard .= '
'; + } + } + + $nbworkboardcount = 0; + foreach ($valid_dashboardlines as $infoKey => $board) { + if (in_array($infoKey, $isIntopOpenedDashBoard)) { + // skip if info is present on top + continue; + } + + if (empty($board->nbtodo)) { + $nbworkboardempty++; + } + $nbworkboardcount++; + + + $textlate = $langs->trans("NActionsLate", $board->nbtodolate); + $textlate .= ' (' . $langs->trans("Late") . ' = ' . $langs->trans("DateReference") . ' > ' . $langs->trans("DateToday") . ' ' . (ceil($board->warning_delay) >= 0 ? '+' : '') . ceil($board->warning_delay) . ' ' . $langs->trans("days") . ')'; + + + $boxwork .= '
'; + $boxwork .= '
'; + $boxwork .= '' . $board->img . ' ' . $board->label . '
'; + $boxwork .= '' . $board->nbtodo . ''; + if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) { + $boxwork .= ' / ' . price($board->total) . ''; + } $boxwork .= '
'; + if ($board->nbtodolate > 0) { + $boxwork .= ''; + } + $boxwork .= '
'; + $boxwork .= "\n"; } - $boxwork.='
'; - $boxwork .="\n"; + + $boxwork .= '
'; + $boxwork .= '
'; + $boxwork .= '
'; + $boxwork .= '
'; + + $boxwork .= '
'; + $boxwork .= '
'; + $boxwork .= $langs->trans("NoOpenedElementToProcess"); + $boxwork .= '
'; - $boxwork.=$langs->trans("NoOpenedElementToProcess"); - $boxwork.='
'; // End table array of working board + $boxwork .= '
'; + + if (!empty($isIntopOpenedDashBoard)) { + print '
'; + print '
' . $openedDashBoard . '
'; + print '
'; + } } -$boxwork.='
'; // End table array of working board -$boxwork.=''; - - -if(!empty($isIntopOpenedDashBoard)) { - print '
'; - print '
' . $openedDashBoard . '
'; - print '
'; -} print '
'; diff --git a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql new file mode 100644 index 00000000000..5b6f4bf3f0c --- /dev/null +++ b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql @@ -0,0 +1,43 @@ +-- Copyright (C) 2001-2004 Rodolphe Quiedeville +-- Copyright (C) 2003 Jean-Louis Bergamo +-- Copyright (C) 2004-2010 Laurent Destailleur +-- Copyright (C) 2004 Benoit Mortier +-- Copyright (C) 2004 Guillaume Delecourt +-- Copyright (C) 2005-2012 Regis Houssin +-- Copyright (C) 2007 Patrick Raguin +-- Copyright (C) 2019 Markus Welters +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- + +-- +-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors +-- de l'install et tous les sigles '--' sont supprimés. +-- + + +-- LIST ON https://fr.wikipedia.org/wiki/Jour_férié + + +-- A lot of countries +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('NEWYEARDAY1', 0, 0, 0, 1, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('LABORDAY1', 0, 0, 0, 5, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('CHRISTMASDAY1', 0, 0, 0, 12, 25, 1); + +-- France only +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRVICTORYDAY', 0, 1, 0, 5, 8, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRNATIONALDAY', 0, 1, 0, 7, 14, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRASSOMPTION', 0, 1, 0, 8, 15, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRTOUSSAINT', 0, 1, 0, 11, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, year, month, day, active) VALUES('FRARMISTICE', 0, 1, 0, 11, 11, 1); diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 1b705133a19..7ef80e9b5b6 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -105,3 +105,20 @@ ALTER TABLE llx_societe_contacts ADD UNIQUE INDEX idx_societe_contacts_idx1 (ent ALTER TABLE llx_societe_contacts ADD CONSTRAINT fk_societe_contacts_fk_c_type_contact FOREIGN KEY (fk_c_type_contact) REFERENCES llx_c_type_contact(rowid); ALTER TABLE llx_societe_contacts ADD CONSTRAINT fk_societe_contacts_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe(rowid); ALTER TABLE llx_societe_contacts ADD CONSTRAINT fk_societe_contacts_fk_socpeople FOREIGN KEY (fk_socpeople) REFERENCES llx_socpeople(rowid); + + +create table llx_c_hrm_public_holiday +( + id integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 0 NOT NULL, -- multi company id, 0 = all + fk_country integer, + code varchar(62), + dayrule varchar(255) DEFAULT 'date', -- 'date', 'xxx', ... + day integer, + month integer, + year integer, -- 0 for all years + active integer DEFAULT 1, + import_key varchar(14) +)ENGINE=innodb; + + diff --git a/htdocs/install/mysql/tables/llx_c_field_list.sql b/htdocs/install/mysql/tables/llx_c_field_list.sql index 44b02c35248..fa528bec0ef 100644 --- a/htdocs/install/mysql/tables/llx_c_field_list.sql +++ b/htdocs/install/mysql/tables/llx_c_field_list.sql @@ -36,5 +36,4 @@ create table llx_c_field_list visible tinyint DEFAULT 1 NOT NULL, -- visibility of field. 0=Never visible, 1=Visible on list and forms, 2=Visible on list only enabled varchar(255) DEFAULT 1, -- Condition to show or hide rang integer DEFAULT 0 - )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql new file mode 100644 index 00000000000..23dcbf355b4 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.key.sql @@ -0,0 +1,21 @@ +-- ======================================================================== +-- Copyright (C) 2019 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ======================================================================== + +ALTER TABLE llx_c_hrm_public_holiday ADD UNIQUE INDEX uk_c_hrm_public_holiday(entity, code); +ALTER TABLE llx_c_hrm_public_holiday ADD UNIQUE INDEX uk_c_hrm_public_holiday2(entity, day, month, year); + diff --git a/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql new file mode 100644 index 00000000000..7efbe314875 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_c_hrm_public_holiday.sql @@ -0,0 +1,31 @@ +-- ======================================================================== +-- Copyright (C) 2019 Laurent Destailleur +-- +-- 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 +-- the Free Software Foundation; either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- ======================================================================== + +create table llx_c_hrm_public_holiday +( + id integer AUTO_INCREMENT PRIMARY KEY, + entity integer DEFAULT 0 NOT NULL, -- multi company id, 0 = all + fk_country integer, + code varchar(62), + dayrule varchar(255) DEFAULT 'date', -- 'date', 'xxx', ... + day integer, + month integer, + year integer, -- 0 for all years + active integer DEFAULT 1, + import_key varchar(14) +)ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index c82669df7cc..ac29410873a 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -36,7 +36,7 @@ create table llx_user pass_encoding varchar(24), pass varchar(128), pass_crypted varchar(128), - pass_temp varchar(128), -- temporary password when asked for forget password or 'hashtoallowreset:YYYMMDDHHMMSS' (where date is max date of validaity) + pass_temp varchar(128), -- temporary password when asked for forget password or 'hashtoallowreset:YYYMMDDHHMMSS' (where date is max date of validity) api_key varchar(128), -- key to use REST API by this user gender varchar(10), civility varchar(6), diff --git a/htdocs/langs/en_AU/admin.lang b/htdocs/langs/en_AU/admin.lang index 447918b3b95..f792eabe51a 100644 --- a/htdocs/langs/en_AU/admin.lang +++ b/htdocs/langs/en_AU/admin.lang @@ -1,11 +1,7 @@ # Dolibarr language file - Source file is en_US - admin OldVATRates=Old GST rate NewVATRates=New GST rate -Module600Name=Notifications on business event DictionaryVAT=GST Rates or Sales Tax Rates OptionVatMode=GST due -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications LinkColor=Colour of links OperationParamDesc=Define values to use for action, or how to extract values. For example:
objproperty1=SET:abc
objproperty1=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:abc
objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\\s]+(.*)
options_myextrafield=EXTRACT:SUBJECT:([^\\s]*)
object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/en_AU/withdrawals.lang b/htdocs/langs/en_AU/withdrawals.lang deleted file mode 100644 index 967d1f20411..00000000000 --- a/htdocs/langs/en_AU/withdrawals.lang +++ /dev/null @@ -1,2 +0,0 @@ -# Dolibarr language file - Source file is en_US - withdrawals -RUM=Unique Mandate Reference (UMR) diff --git a/htdocs/langs/en_CA/admin.lang b/htdocs/langs/en_CA/admin.lang index ae0ffe7f7c7..e5e33b73dd6 100644 --- a/htdocs/langs/en_CA/admin.lang +++ b/htdocs/langs/en_CA/admin.lang @@ -1,10 +1,6 @@ # Dolibarr language file - Source file is en_US - admin -Module600Name=Notifications on business event LocalTax1Management=PST Management CompanyZip=Postal code LDAPFieldZip=Postal code -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications FormatZip=Postal code OperationParamDesc=Define values to use for action, or how to extract values. For example:
objproperty1=SET:abc
objproperty1=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:abc
objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\\s]+(.*)
options_myextrafield=EXTRACT:SUBJECT:([^\\s]*)
object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/en_GB/admin.lang b/htdocs/langs/en_GB/admin.lang index 3f23aecf4be..29af3e502f6 100644 --- a/htdocs/langs/en_GB/admin.lang +++ b/htdocs/langs/en_GB/admin.lang @@ -41,14 +41,10 @@ UMaskExplanation=This parameter allows you to define permissions set by default ListOfDirectories=List of OpenDocument template directories ListOfDirectoriesForModelGenODT=List of directories containing template files in OpenDocument format.

Put here full path of directories.
Add a carriage return between each directory.
To add a directory of the GED module, add here DOL_DATA_ROOT/ecm/yourdirectoryname.

Files in those directories must end with .odt or .ods. FollowingSubstitutionKeysCanBeUsed=
To learn how to create your .odt document templates, before storing them in those directories, read wiki documentation: -Module600Name=Notifications on business event Module50200Name=PayPal DictionaryAccountancyJournal=Finance journals CompanyZip=Postcode LDAPFieldZip=Postcode GenbarcodeLocation=Barcode generation command line tool (used by internal engine for some bar code types). Must be compatible with "genbarcode".
For example: /usr/local/bin/genbarcode -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications FormatZip=Postcode OperationParamDesc=Define values to use for action, or how to extract values. For example:
objproperty1=SET:abc
objproperty1=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:abc
objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\\s]+(.*)
options_myextrafield=EXTRACT:SUBJECT:([^\\s]*)
object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/en_GB/withdrawals.lang b/htdocs/langs/en_GB/withdrawals.lang index b34ed7e8f1f..aaf36937580 100644 --- a/htdocs/langs/en_GB/withdrawals.lang +++ b/htdocs/langs/en_GB/withdrawals.lang @@ -15,7 +15,6 @@ NotifyCredit=Payment Credit WithdrawalFileNotCapable=Unable to generate Payment receipt file for your country %s (Your country is not supported) DoStandingOrdersBeforePayments=This tab allows you to request a direct debit payment order. Once done, go into menu Bank->Direct Debit orders to manage the direct debit payment order. When the payment order is closed, payment on the invoice will be automatically recorded, and the invoice closed if the outstanding balance is null. WithdrawalFile=Payment file -RUM=Unique Mandate Reference (UMR) WithdrawRequestAmount=The amount of Direct Debit request: WithdrawRequestErrorNilAmount=Unable to create a Direct Debit request for an empty amount. SEPALegalText=By signing this mandate form, you authorise (A) %s to send instructions to your bank to debit your account and (B) your bank to debit your account in accordance with the instructions from %s. As part of your rights, you are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited. Your rights regarding the above mandate are explained in a statement that you can obtain from your bank. diff --git a/htdocs/langs/en_IN/admin.lang b/htdocs/langs/en_IN/admin.lang index d19942507b6..e3cc80d5cea 100644 --- a/htdocs/langs/en_IN/admin.lang +++ b/htdocs/langs/en_IN/admin.lang @@ -1,7 +1,6 @@ # Dolibarr language file - Source file is en_US - admin Module20Name=Quotations Module20Desc=Management of quotations -Module600Name=Notifications on business event Permission21=Read quotations Permission22=Create/modify quotations Permission24=Validate quotations @@ -14,8 +13,5 @@ ProposalsNumberingModules=Quotation numbering models ProposalsPDFModules=Quotation documents models FreeLegalTextOnProposal=Free text on quotations WatermarkOnDraftProposal=Watermark on draft quotations (none if empty) -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications MailToSendProposal=Customer quotations OperationParamDesc=Define values to use for action, or how to extract values. For example:
objproperty1=SET:abc
objproperty1=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:abc
objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\\s]+(.*)
options_myextrafield=EXTRACT:SUBJECT:([^\\s]*)
object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index f59f4449b8e..494e7d4a8a3 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1695,7 +1695,7 @@ SuppliersSetup=Vendor module setup SuppliersCommandModel=Complete template of purchase order (logo...) SuppliersInvoiceModel=Complete template of vendor invoice (logo...) SuppliersInvoiceNumberingModel=Vendor invoices numbering models -IfSetToYesDontForgetPermission=If set to yes, don't forget to provide permissions to groups or users allowed for the second approval +IfSetToYesDontForgetPermission=If set to a non null value, don't forget to provide permissions to groups or users allowed for the second approval ##### GeoIPMaxmind ##### GeoIPMaxmindSetup=GeoIP Maxmind module setup PathToGeoIPMaxmindCountryDataFile=Path to file containing Maxmind ip to country translation.
Examples:
/usr/local/share/GeoIP/GeoIP.dat
/usr/share/GeoIP/GeoIP.dat
/usr/share/GeoIP/GeoLite2-Country.mmdb @@ -1851,7 +1851,7 @@ SeveralLangugeVariatFound=Several language variants found RemoveSpecialChars=Remove special characters COMPANY_AQUARIUM_CLEAN_REGEX=Regex filter to clean value (COMPANY_AQUARIUM_CLEAN_REGEX) COMPANY_DIGITARIA_CLEAN_REGEX=Regex filter to clean value (COMPANY_DIGITARIA_CLEAN_REGEX) -COMPANY_DIGITARIA_UNIQUE_CODE=Unauthorized double +COMPANY_DIGITARIA_UNIQUE_CODE=Duplicate not allowed GDPRContact=Data Protection Officer (DPO, Data Privacy or GDPR contact) GDPRContactDesc=If you store data about European companies/citizens, you can name the contact who is responsible for the General Data Protection Regulation here HelpOnTooltip=Help text to show on tooltip diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 9a5f9768d24..42d88f3f722 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -63,7 +63,7 @@ LT2SupplierES=IRPF purchases LT2CustomerIN=SGST sales LT2SupplierIN=SGST purchases VATCollected=VAT collected -ToPay=To pay +StatusToPay=To pay SpecialExpensesArea=Area for all special payments SocialContribution=Social or fiscal tax SocialContributions=Social or fiscal taxes diff --git a/htdocs/langs/en_US/hrm.lang b/htdocs/langs/en_US/hrm.lang index 12bb1592cbc..3697c47e30d 100644 --- a/htdocs/langs/en_US/hrm.lang +++ b/htdocs/langs/en_US/hrm.lang @@ -9,6 +9,7 @@ ConfirmDeleteEstablishment=Are you sure you wish to delete this establishment? OpenEtablishment=Open establishment CloseEtablishment=Close establishment # Dictionary +DictionaryPublicHolidays=HRM - Public holidays DictionaryDepartment=HRM - Department list DictionaryFunction=HRM - Function list # Module diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 2b92ed783fe..64ebfc40b32 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -412,6 +412,7 @@ DefaultTaxRate=Default tax rate Average=Average Sum=Sum Delta=Delta +StatusToPay=To pay RemainToPay=Remain to pay Module=Module/Application Modules=Modules/Applications diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index ad895845488..256bd2a7d4d 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -154,5 +154,5 @@ CreateOrders=Create orders ToBillSeveralOrderSelectCustomer=To create an invoice for several orders, click first onto customer, then choose "%s". OptionToSetOrderBilledNotEnabled=Option (from module Workflow) to set order to 'Billed' automatically when invoice is validated is off, so you will have to set status of order to 'Billed' manually. IfValidateInvoiceIsNoOrderStayUnbilled=If invoice validation is 'No', the order will remain to status 'Unbilled' until the invoice is validated. -CloseReceivedSupplierOrdersAutomatically=Close order to "%s" automatically if all products are received. +CloseReceivedSupplierOrdersAutomatically=Close order to status "%s" automatically if all products are received. SetShippingMode=Set shipping mode diff --git a/htdocs/langs/en_US/paybox.lang b/htdocs/langs/en_US/paybox.lang index a4eee3680af..35216661140 100644 --- a/htdocs/langs/en_US/paybox.lang +++ b/htdocs/langs/en_US/paybox.lang @@ -11,7 +11,6 @@ YourEMail=Email to receive payment confirmation Creditor=Creditor PaymentCode=Payment code PayBoxDoPayment=Pay with Paybox -ToPay=Do payment YouWillBeRedirectedOnPayBox=You will be redirected on secured Paybox page to input you credit card information Continue=Next ToOfferALinkForOnlinePayment=URL for %s payment diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index ede7fea87b7..f3f023f8dcf 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -21,6 +21,7 @@ QtyShipped=Qty shipped QtyShippedShort=Qty ship. QtyPreparedOrShipped=Qty prepared or shipped QtyToShip=Qty to ship +QtyToReceive=Qty to receive QtyReceived=Qty received QtyInOtherShipments=Qty in other shipments KeepToShip=Remain to ship @@ -46,6 +47,7 @@ DateDeliveryPlanned=Planned date of delivery RefDeliveryReceipt=Ref delivery receipt StatusReceipt=Status delivery receipt DateReceived=Date delivery received +ClassifyReception=Classify reception SendShippingByEMail=Send shipment by email SendShippingRef=Submission of shipment %s ActionsOnShipping=Events on shipment diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index d42f1a82243..a98d4e18cbf 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -55,7 +55,7 @@ PMPValue=Weighted average price PMPValueShort=WAP EnhancedValueOfWarehouses=Warehouses value UserWarehouseAutoCreate=Create a user warehouse automatically when creating a user -AllowAddLimitStockByWarehouse=Manage also values for minimum and desired stock per pairing (product-warehouse) in addition to values per product +AllowAddLimitStockByWarehouse=Manage also value for minimum and desired stock per pairing (product-warehouse) in addition to the value for minimum and desired stock per product IndependantSubProductStock=Product stock and subproduct stock are independent QtyDispatched=Quantity dispatched QtyDispatchedShort=Qty dispatched @@ -184,7 +184,7 @@ SelectFournisseur=Vendor filter inventoryOnDate=Inventory INVENTORY_DISABLE_VIRTUAL=Virtual product (kit): do not decrement stock of a child product INVENTORY_USE_MIN_PA_IF_NO_LAST_PA=Use the buy price if no last buy price can be found -INVENTORY_USE_INVENTORY_DATE_FROM_DATEMVT=Stock movement has date of inventory +INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT=Stock movements will have the date of inventory (instead of the date of inventory validation) inventoryChangePMPPermission=Allow to change PMP value for a product ColumnNewPMP=New unit PMP OnlyProdsInStock=Do not add product without stock diff --git a/htdocs/langs/es_CL/compta.lang b/htdocs/langs/es_CL/compta.lang index 2aa54a47917..499f8f169ef 100644 --- a/htdocs/langs/es_CL/compta.lang +++ b/htdocs/langs/es_CL/compta.lang @@ -54,7 +54,6 @@ LT2CustomerES=Ventas de IRPF LT2SupplierES=Compras de IRPF LT2CustomerIN=Ventas de SGST VATCollected=IVA recaudado -ToPay=Pagar SpecialExpensesArea=Área para todos los pagos especiales SocialContribution=Impuesto social o fiscal LabelContrib=Contribución de etiqueta diff --git a/htdocs/langs/es_CO/compta.lang b/htdocs/langs/es_CO/compta.lang index c35bb1a59e1..be705a0bacc 100644 --- a/htdocs/langs/es_CO/compta.lang +++ b/htdocs/langs/es_CO/compta.lang @@ -50,7 +50,6 @@ LT2Supplier=Impuestos 3 compras LT2CustomerES=Ventas de IRPF LT2SupplierES=Compras IRPF VATCollected=IVA recaudado -ToPay=Pagar SpecialExpensesArea=Área para todos los pagos especiales. SocialContribution=Impuesto social o fiscal SocialContributions=Impuestos sociales o fiscales. diff --git a/htdocs/langs/fr_BE/admin.lang b/htdocs/langs/fr_BE/admin.lang index 7d99260c310..45352a47b83 100644 --- a/htdocs/langs/fr_BE/admin.lang +++ b/htdocs/langs/fr_BE/admin.lang @@ -16,9 +16,5 @@ FormToTestFileUploadForm=Formulaire pour tester l'upload de fichiers (selon la c IfModuleEnabled=Note: oui ne fonctionne que si le module %s est activé Module20Name=Propales Module30Name=Factures -Module600Name=Notifications on business event Target=Objectif -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications OperationParamDesc=Define values to use for action, or how to extract values. For example:
objproperty1=SET:abc
objproperty1=SET:a value with replacement of __objproperty1__
objproperty3=SETIFEMPTY:abc
objproperty4=EXTRACT:HEADER:X-Myheaderkey.*[^\\s]+(.*)
options_myextrafield=EXTRACT:SUBJECT:([^\\s]*)
object.objproperty5=EXTRACT:BODY:My company name is\\s([^\\s]*)

Use a ; char as separator to extract or set several properties. diff --git a/htdocs/langs/fr_BE/withdrawals.lang b/htdocs/langs/fr_BE/withdrawals.lang index 305bdf13d8e..eb336cadcc0 100644 --- a/htdocs/langs/fr_BE/withdrawals.lang +++ b/htdocs/langs/fr_BE/withdrawals.lang @@ -1,3 +1,2 @@ # Dolibarr language file - Source file is en_US - withdrawals StatusTrans=Envoyé -RUM=Unique Mandate Reference (UMR) diff --git a/htdocs/langs/fr_CA/admin.lang b/htdocs/langs/fr_CA/admin.lang index 69ce614e588..5990a0d3fa8 100644 --- a/htdocs/langs/fr_CA/admin.lang +++ b/htdocs/langs/fr_CA/admin.lang @@ -89,7 +89,6 @@ WatermarkOnDraftExpenseReports=Filigrane sur les projets de rapports de dépense Module0Desc=Gestion des utilisateurs / employés et des groupes Module42Desc=Installations de journalisation (fichier, syslog, ...). Ces journaux sont à des fins techniques / de débogage. Module75Name=Notes de frais et déplacements -Module600Name=Notifications on business event Module2400Name=Evénements / Agenda Module2600Name=services API / Web ( serveur SOAP ) Module2600Desc=Active le serveur de Web Services de Dolibarr @@ -199,9 +198,6 @@ DeleteFiscalYear=Supprimer la période comptable ConfirmDeleteFiscalYear=Êtes-vous sûr de supprimer cette période comptable? ShowFiscalYear=Afficher la période comptable SalariesSetup=Configuration du module salariés -ListOfNotificationsPerUser=List of automatic notifications per user* -ListOfNotificationsPerUserOrContact=List of possible automatic notifications (on business event) available per user* or per contact** -ListOfFixedNotifications=List of automatic fixed notifications ConfFileMustContainCustom=L'installation ou la construction d'un module externe à partir de l'application doit sauvegarder les fichiers du module dans le répertoire %s. Pour que ce répertoire soit traité par Dolibarr, vous devez configurer votre conf / conf.php pour ajouter les 2 lignes de directive:
$ dolibarr_main_url_root_alt = '/ custom';
$ dolibarr_main_document_root_alt = '%s / custom'; HighlightLinesOnMouseHover=Mettez en surbrillance les lignes de table lorsque déplacement de la souris passe au-dessus PressF5AfterChangingThis=Appuyez sur CTRL + F5 sur le clavier ou effacez votre cache de navigateur après avoir changé cette valeur pour l'avoir efficace diff --git a/htdocs/langs/fr_CA/withdrawals.lang b/htdocs/langs/fr_CA/withdrawals.lang index d8dc0f4bd1a..f0875b5400f 100644 --- a/htdocs/langs/fr_CA/withdrawals.lang +++ b/htdocs/langs/fr_CA/withdrawals.lang @@ -53,7 +53,6 @@ DoStandingOrdersBeforePayments=Cet onglet vous permet de demander une commande d WithdrawalFile=Fichier de retrait SetToStatusSent=Définir le statut "Fichier envoyé" StatisticsByLineStatus=Statistiques par état des lignes -RUM=Unique Mandate Reference (UMR) RUMLong=Référence de mandat unique WithdrawMode=Mode de débit direct (FRST ou RECUR) WithdrawRequestAmount=Montant de la demande de débit direct: diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 7407396835b..20cdc9175d6 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -462,7 +462,9 @@ EnableAndSetupModuleCron=Si vous voulez avoir cette facture récurrente génér ModuleCompanyCodeCustomerAquarium=%s suivi d'un code client tiers pour un code comptable client ModuleCompanyCodeSupplierAquarium=%s suivi du code fournisseur tiers pour le code comptable fournisseur ModuleCompanyCodePanicum=Retourne un code comptable vide -ModuleCompanyCodeDigitaria=Renvoie un code comptable composé suivant le code tiers. Le code est composé du caractère 'C' en première position suivi des 5 premiers caractères du code tiers. +ModuleCompanyCodeDigitaria=Renvoie un code de comptabilisation composé en fonction du nom du tiers. Le code consiste en un préfixe pouvant être défini dans la première position, suivi d'un nombre de caractères défini dans le code tiers. +ModuleCompanyCodeCustomerDigitaria=%s suivi du nom de client tronqué du nombre de caractères: %s pour le code comptable client. +ModuleCompanyCodeSupplierDigitaria=%s suivi du nom du fournisseur tronqué du nombre de caractères: %s pour le code comptable fournisseur. Use3StepsApproval=Par défaut, les commandes fournisseurs nécessitent d'être créées et approuvées par 2 utilisateurs différents (une étape/utilisateur pour créer et une étape/utilisateur pour approuver. Notez que si un utilisateur à les deux permissions, ces deux actions sont effectuées en une seule fois). Cette option ajoute la nécessité d'une approbation par une troisième étape/utilisateur, si le montant de la commande est supérieur au montant d'une valeur définie (soit 3 étapes nécessaire: 1 =Validation, 2=Première approbation et 3=seconde approbation si le montant l'exige).
Laissez le champ vide si une seule approbation (2 étapes) est suffisante, placez une valeur très faible (0.1) si une deuxième approbation (3 étapes) est toujours exigée. UseDoubleApproval=Activer l'approbation en trois étapes si le montant HT est supérieur à... WarningPHPMail=Attention : Il est préférable de configurer les emails sortant pour utiliser le serveur email de votre fournisseur plutôt que la configuration par défaut. Certains fournisseurs email (comme Yahoo) ne permettent pas l'envoi d'e-mails depuis un autre serveur que le leur si l'adresse d'envoi utilisée est une adresse autre que la leur. Votre configuration actuelle utilise le serveur de l'application pour l'envoi d'e-mails et non le serveur de votre fournisseur de messagerie, aussi certains destinataires (ceux compatibles avec le protocole restrictif DMARC) demanderont au fournisseur d'email si ils peuvent accepter l'email et certains fournisseurs (comme Yahoo) peuvent répondre "non" car le serveur utilisé pour l'envoi n'est pas un serveur appartenant au fournisseur, aussi certains de vos emails envoyés peuvent ne pas etre accepté (faites attention aussi aux quotas de votre fournisseur d'email).
SI votre fournisseur d'email (comme Yahoo) impose cette restriction, vous devrez modifier votre configuration et opter pour l'autre méthode d'envoi "SMTP server" et saisir les identifiants SMTP de votre compte fournis par votre fournisseur d'e-mail (à demander à votre fournisseur d'e-mail) @@ -1846,8 +1848,10 @@ NothingToSetup=Aucune configuration particulière n'est requise pour ce module. SetToYesIfGroupIsComputationOfOtherGroups=Réglez ceci sur Oui si ce groupe est un calcul d'autres groupes EnterCalculationRuleIfPreviousFieldIsYes=Entrez la règle de calcul si le champ précédent a été défini sur Oui (par exemple, 'CODEGRP1 + CODEGRP2') SeveralLangugeVariatFound=Plusieurs variantes de langue trouvées -COMPANY_AQUARIUM_REMOVE_SPECIAL=Supprimer les caractères spéciaux +RemoveSpecialChars=Supprimer les caractères spéciaux COMPANY_AQUARIUM_CLEAN_REGEX=Filtre Regex pour nettoyer la valeur (COMPANY_AQUARIUM_CLEAN_REGEX) +COMPANY_DIGITARIA_CLEAN_REGEX=Filtre de regex pour nettoyer la valeur (COMPANY_DIGITARIA_CLEAN_REGEX) +COMPANY_DIGITARIA_UNIQUE_CODE=Doublons non autorisés GDPRContact=Responsable de la protection des données (DPO ou contact RGPD) GDPRContactDesc=Si vous stockez des données sur des entreprises / citoyens européens, vous pouvez stocker ici le contact responsable du RGPD. HelpOnTooltip=Texte d'aide à afficher dans l'info-bulle diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index bdf515ca297..edb61e62406 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -496,9 +496,9 @@ CantRemovePaymentWithOneInvoicePaid=Suppression impossible quand il existe au mo ExpectedToPay=Paiement attendu CantRemoveConciliatedPayment=Suppression d'un paiement rapproché impossible PayedByThisPayment=Règlé par ce paiement -ClosePaidInvoicesAutomatically=Classifiez "Payée" toutes les factures standard, d'acompte ou de remplacement entièrement payées. -ClosePaidCreditNotesAutomatically=Classer automatiquement à "Payé" les factures avoirs entièrement remboursées. -ClosePaidContributionsAutomatically=Classer "payé" toutes les contributions sociales ou fiscales payées entièrement. +ClosePaidInvoicesAutomatically=Classer "Payée" toutes les factures standard, d'acompte ou de remplacement quand le paiement est complet. +ClosePaidCreditNotesAutomatically=Classer automatiquement à "Payé" les factures d'avoirs quand le remboursement est complet. +ClosePaidContributionsAutomatically=Classer automatiquement à "Payé" toutes les contributions sociales ou fiscales quand les sont complets. AllCompletelyPayedInvoiceWillBeClosed=Toutes les factures avec un reste à payer nul seront automatiquement fermées au statut "Payé". ToMakePayment=Payer ToMakePaymentBack=Rembourser diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index d557f85e726..7732a9c8dca 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -63,7 +63,7 @@ LT2SupplierES=IRPF achats LT2CustomerIN=TVA sur les ventes LT2SupplierIN=TVA sur les achats VATCollected=TVA récupérée -ToPay=A payer +StatusToPay=A payer SpecialExpensesArea=Espace des paiements particuliers SocialContribution=Charge sociale ou fiscale SocialContributions=Charges fiscales ou sociales diff --git a/htdocs/langs/fr_FR/cron.lang b/htdocs/langs/fr_FR/cron.lang index 4a80dd19ac4..38c6d34650d 100644 --- a/htdocs/langs/fr_FR/cron.lang +++ b/htdocs/langs/fr_FR/cron.lang @@ -76,7 +76,7 @@ CronType_method=Appelle d'une méthode d'une classe Dolibarr CronType_command=Commande terminal CronCannotLoadClass=Impossible de charger le fichier %s (pour charger l'objet %s) CronCannotLoadObject=Le fichier de classe %s a été chargé, mais l'objet %s n'a pas été trouvé dedans -UseMenuModuleToolsToAddCronJobs=Aller à la page "
Accueil - Outils administration - Travaux planifiées" pour voir la listes des travaux programmées et les modifier. +UseMenuModuleToolsToAddCronJobs=Aller à la page "Accueil - Outils administration - Travaux planifiées" pour voir la listes des travaux programmés et les modifier. JobDisabled=Travail désactivé MakeLocalDatabaseDumpShort=Sauvegarde locale de base MakeLocalDatabaseDump=Créez un fichier dump de base local. Les paramètres sont: compression ('gz' ou 'bz' ou 'none'), type de sauvegarde ('mysql', 'pgsql', 'auto'), 1, 'auto' ou nom du fichier à générer, nombre de fichiers de sauvegarde à garder diff --git a/htdocs/langs/fr_FR/dict.lang b/htdocs/langs/fr_FR/dict.lang index ac8d667c6e3..8da0543e2c2 100644 --- a/htdocs/langs/fr_FR/dict.lang +++ b/htdocs/langs/fr_FR/dict.lang @@ -332,27 +332,27 @@ PaperFormatCAP6=Format P6 Canadien ExpAutoCat=Voiture ExpCycloCat=2 roues ExpMotoCat=Moto -ExpAuto3CV=3 cv +ExpAuto3CV=3 CV ExpAuto4CV=4 CV -ExpAuto5CV=5 cv +ExpAuto5CV=5 CV ExpAuto6CV=6 CV -ExpAuto7CV=7 cv -ExpAuto8CV=8 cv +ExpAuto7CV=7 CV +ExpAuto8CV=8 CV ExpAuto9CV=9 CV -ExpAuto10CV=10 cv -ExpAuto11CV=11 cv -ExpAuto12CV=12 cv -ExpAuto3PCV=3 cv et plus +ExpAuto10CV=10 CV +ExpAuto11CV=11 CV +ExpAuto12CV=12 CV +ExpAuto3PCV=3 CV et plus ExpAuto4PCV=4 CV et plus -ExpAuto5PCV=5 cv et plus -ExpAuto6PCV=6 cv et plus -ExpAuto7PCV=7 cv et plus -ExpAuto8PCV=8 cv et plus -ExpAuto9PCV=9 cv et plus -ExpAuto10PCV=10 cv et plus -ExpAuto11PCV=11 cv et plus -ExpAuto12PCV=12 cv et plus -ExpAuto13PCV=13 cv et plus +ExpAuto5PCV=5 CV et plus +ExpAuto6PCV=6 CV et plus +ExpAuto7PCV=7 CV et plus +ExpAuto8PCV=8 CV et plus +ExpAuto9PCV=9 CV et plus +ExpAuto10PCV=10 CV et plus +ExpAuto11PCV=11 CV et plus +ExpAuto12PCV=12 CV et plus +ExpAuto13PCV=13 CV et plus ExpCyclo=Capacité inférieure à 50 cm3 ExpMoto12CV=2 roues 1 ou 2 cv ExpMoto345CV=2 roues 3, 4 ou 5 cv diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index 1dd59973aea..dfc6e33299a 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -18,6 +18,7 @@ ValidatorCP=Approbateur ListeCP=Liste des demandes de congés LeaveId=ID demande de congès ReviewedByCP=Sera approuvé par +UserID=ID Utilisateur UserForApprovalID=ID de l'utilisateur d'approbation UserForApprovalFirstname=Prénom de l'utilisateur d'approbation UserForApprovalLastname=Nom de l'utilisateur d'approbation diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index ec5d8a471df..b375a3e16e0 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -348,8 +348,6 @@ PriceUTTC=P.U TTC Amount=Montant AmountInvoice=Montant facture AmountInvoiced=Montant facturé -AmountInvoicedHT=Montant HT facturé -AmountInvoicedTTC=Montant TTC facturé AmountPayment=Montant paiement AmountHTShort=Montant HT AmountTTCShort=Montant TTC @@ -414,6 +412,7 @@ DefaultTaxRate=Taux de taxe par défaut Average=Moyenne Sum=Somme Delta=Écart +StatusToPay=A payer RemainToPay=Reste à payer Module=Module/Application Modules=Modules/Applications diff --git a/htdocs/langs/fr_FR/modulebuilder.lang b/htdocs/langs/fr_FR/modulebuilder.lang index 8aad310a172..5efb048a4a2 100644 --- a/htdocs/langs/fr_FR/modulebuilder.lang +++ b/htdocs/langs/fr_FR/modulebuilder.lang @@ -105,6 +105,7 @@ InitStructureFromExistingTable=Construire la chaîne du tableau de structure d'u UseAboutPage=Désactiver la page "à propos de" UseDocFolder=Désactiver le dossier de la documentation UseSpecificReadme=Utiliser un fichier ReadMe spécifique +ContentOfREADMECustomized=Remarque: le contenu du fichier README.md a été remplacé par la valeur spécifique définie dans la configuration de ModuleBuilder. RealPathOfModule=Chemin réel du dossier du module ContentCantBeEmpty=Le contenu du fichier ne peut pas être vide WidgetDesc=Vous pouvez générer et éditer ici les widgets qui seront intégrés à votre module. diff --git a/htdocs/langs/fr_FR/orders.lang b/htdocs/langs/fr_FR/orders.lang index a4a8827ca05..bbbeb2638e8 100644 --- a/htdocs/langs/fr_FR/orders.lang +++ b/htdocs/langs/fr_FR/orders.lang @@ -154,5 +154,5 @@ CreateOrders=Créer commandes ToBillSeveralOrderSelectCustomer=Pour créer une facture pour plusieurs commandes, cliquez d'abord sur le client, puis choisir "%s". OptionToSetOrderBilledNotEnabled=L'option (issue du module Workflow) pour définir automatiquement les commandes à 'Facturé' que une facture est validée, est désactivée, aussi vous devrez donc définir le statut de la commande sur 'Facturé' manuellement. IfValidateInvoiceIsNoOrderStayUnbilled=Si la validation de facture est à "Non", la commande restera au statut "Non facturé" jusqu'à ce que la facture soit validée. -CloseReceivedSupplierOrdersAutomatically=Fermer la commande "%s" automatiquement si tous les produits ont été reçus. +CloseReceivedSupplierOrdersAutomatically=Fermer la commande au statut "%s" automatiquement si tous les produits ont été reçus. SetShippingMode=Définir la méthode d'expédition diff --git a/htdocs/langs/fr_FR/paybox.lang b/htdocs/langs/fr_FR/paybox.lang index 2f0891171a5..6a79a2196a6 100644 --- a/htdocs/langs/fr_FR/paybox.lang +++ b/htdocs/langs/fr_FR/paybox.lang @@ -11,7 +11,6 @@ YourEMail=Email de confirmation du paiement Creditor=Bénéficiaire PaymentCode=Code de paiement PayBoxDoPayment=Payer avec PayBox -ToPay=Saisir règlement YouWillBeRedirectedOnPayBox=Vous serez redirigé vers la page sécurisée Paybox de saisie de votre carte bancaire Continue=Continuer ToOfferALinkForOnlinePayment=URL de paiement %s diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang index a1dc8e412a6..a0473ad8c76 100644 --- a/htdocs/langs/fr_FR/products.lang +++ b/htdocs/langs/fr_FR/products.lang @@ -29,10 +29,14 @@ ProductOrService=Produit ou Service ProductsAndServices=Produits et Services ProductsOrServices=Produits ou Services ProductsPipeServices=Produits | Services +ProductsOnSale=Produits en vente +ProductsOnPurchase=Produits en achat ProductsOnSaleOnly=Produits en vente uniquement ProductsOnPurchaseOnly=Produits seulement en achat ProductsNotOnSell=Produits hors vente et hors achat ProductsOnSellAndOnBuy=Produits en vente et en achat +ServicesOnSale=Services en vente +ServicesOnPurchase=Services en achat ServicesOnSaleOnly=Services en vente uniquement ServicesOnPurchaseOnly=Services en achat uniquement ServicesNotOnSell=Services hors vente et hors achat @@ -340,4 +344,4 @@ ErrorCopyProductCombinations=Une erreur s'est produite lors de la copie des vari ErrorDestinationProductNotFound=Produit destination non trouvé ErrorProductCombinationNotFound=Variante du produit non trouvé ActionAvailableOnVariantProductOnly=Action disponible uniquement sur la variante du produit -ProductsPricePerCustomer=Prix produit par clients \ No newline at end of file +ProductsPricePerCustomer=Prix produit par clients diff --git a/htdocs/langs/fr_FR/website.lang b/htdocs/langs/fr_FR/website.lang index 0858738f1fb..608da399e3a 100644 --- a/htdocs/langs/fr_FR/website.lang +++ b/htdocs/langs/fr_FR/website.lang @@ -114,3 +114,7 @@ CSSContentTooltipHelp=Entrez ici le contenu CSS. Pour éviter tout conflit avec LinkAndScriptsHereAreNotLoadedInEditor=Avertissement: Ce contenu est affiché uniquement lorsque le site est accessible depuis un serveur. Il n'est pas utilisé en mode édition. Par conséquent, si vous devez charger des fichiers javascript également en mode édition, ajoutez simplement la balise 'script src=...' dans la page. Dynamiccontent=Exemple de page à contenu dynamique ImportSite=Importer modèle de site web +EditInLineOnOff=Mode 'Modifier en ligne' est %s +ShowSubContainersOnOff=Mode 'exécution dynamique' est %s +GlobalCSSorJS=Fichier CSS/JS/Header global du site Web +BackToHomePage=Retour à la page d'accueil... diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 2e91298f570..5ce7dfcebf1 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1766,7 +1766,7 @@ function top_menu_user(User $user, Translate $langs) $dropdownBody.= '
'; $dropdownBody.= '
'.$langs->trans("Session").''; - $dropdownBody.= '
'.$langs->trans("IPAddress").': '.$_SERVER["REMOTE_ADDR"]; + $dropdownBody.= '
'.$langs->trans("IPAddress").': '.dol_escape_htmltag($_SERVER["REMOTE_ADDR"]); if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY)) $dropdownBody.= '
'.$langs->trans("ConnectedOnMultiCompany").': '.$conf->entity.' (user entity '.$user->entity.')'; $dropdownBody.= '
'.$langs->trans("AuthenticationMode").': '.$_SESSION["dol_authmode"].(empty($dolibarr_main_demo)?'':' (demo)'); $dropdownBody.= '
'.$langs->trans("ConnectedSince").': '.dol_print_date($user->datelastlogin, "dayhour", 'tzuser'); @@ -1775,7 +1775,7 @@ function top_menu_user(User $user, Translate $langs) $dropdownBody.= '
'.$langs->trans("CurrentMenuManager").': '.$menumanager->name; $langFlag=picto_from_langcode($langs->getDefaultLang()); $dropdownBody.= '
'.$langs->trans("CurrentUserLanguage").': '.($langFlag?$langFlag.' ':'').$langs->getDefaultLang(); - $dropdownBody.= '
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')'; + $dropdownBody.= '
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.dol_escape_htmltag($_SERVER['HTTP_USER_AGENT']).')'; $dropdownBody.= '
'.$langs->trans("Layout").': '.$conf->browser->layout; $dropdownBody.= '
'.$langs->trans("Screen").': '.$_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; if ($conf->browser->layout == 'phone') $dropdownBody.= '
'.$langs->trans("Phone").': '.$langs->trans("Yes"); diff --git a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php index e1af0259062..d9ea2f110cd 100644 --- a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php @@ -79,5 +79,7 @@ function myobjectPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'myobject@mymodule'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'myobject@mymodule', 'remove'); + return $head; } diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index 4b1e5232abb..22077747b95 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -223,7 +223,7 @@ class Productbatch extends CommonObject $sql.= " batch=".(isset($this->batch)?"'".$this->db->escape($this->batch)."'":"null").","; $sql.= " qty=".(isset($this->qty)?$this->qty:"null").","; $sql.= " import_key=".(isset($this->import_key)?"'".$this->db->escape($this->import_key)."'":"null").""; - $sql.= " WHERE rowid=".$this->id." AND tms='".$this->db->idate($this->tms)."'"; + $sql.= " WHERE rowid=".$this->id; $this->db->begin(); diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 62cfc476ba8..85b174ea725 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -59,7 +59,7 @@ class Inventory extends CommonObject * 'type' if the field format. * 'label' the translation key. * 'enabled' is a condition when the field must be managed. - * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only. Using a negative value means field is not shown by default on list but can be selected for viewing) + * 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). Using a negative value means field is not shown by default on list but can be selected for viewing) * 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0). * 'index' if we want an index in database. * 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommanded to name the field fk_...). @@ -96,7 +96,7 @@ class Inventory extends CommonObject //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'default'=>0, 'arrayofkeyval'=>array(0=>'Todo', 1=>'Done', -1=>'Cancel')), + 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>4, 'enabled'=>1, 'position'=>1000, 'default'=>0, 'arrayofkeyval'=>array(0=>'ToDo', 1=>'Done', -1=>'Cancel')), ); /** diff --git a/htdocs/product/inventory/lib/inventory.lib.php b/htdocs/product/inventory/lib/inventory.lib.php index 175c772cb61..ad2e8193449 100644 --- a/htdocs/product/inventory/lib/inventory.lib.php +++ b/htdocs/product/inventory/lib/inventory.lib.php @@ -50,7 +50,7 @@ function inventoryAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@inventory:/inventory/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'inventory'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'inventory'); return $head; } diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index 54726aefc83..11bb1520ff0 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -95,20 +95,32 @@ if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) exit; } -// Check exportkey -if (empty($_GET["exportkey"]) || $conf->global->MAIN_AGENDA_XCAL_EXPORTKEY != $_GET["exportkey"]) -{ - $user->getrights(); - - llxHeaderVierge(); - print '
Bad value for key.
'; - llxFooterVierge(); - exit; -} - // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks $hookmanager->initHooks(array('agendaexport')); +$reshook = $hookmanager->executeHooks('doActions', $filters); // Note that $action and $object may have been modified by some +if ($reshook < 0){ + llxHeaderVierge(); + if(!empty($hookmanager->errors) && is_array($hookmanager->errors)){ + print '
'.implode('
', $hookmanager->errors).'
'; + }else{ + print '
'.$hookmanager->error.'
'; + } + llxFooterVierge(); +} +elseif(empty($reshook)) { + // Check exportkey + if (empty($_GET["exportkey"]) || $conf->global->MAIN_AGENDA_XCAL_EXPORTKEY != $_GET["exportkey"]) { + $user->getrights(); + + llxHeaderVierge(); + print '
Bad value for key.
'; + llxFooterVierge(); + exit; + } +} + + // Define filename with prefix on filters predica (each predica set must have on cache file) $shortfilename='dolibarrcalendar'; $filename=$shortfilename; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 2153d8a53c7..1dbac0117fa 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -11,7 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2016 Yasser Carreón - * Copyright (C) 2018 Quentin Vial-Gouteyron + * Copyright (C) 2018 Quentin Vial-Gouteyron * * 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 @@ -56,7 +56,7 @@ if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -$langs->loadLangs(array("receptions","companies","bills",'deliveries','orders','stocks','other','propal')); +$langs->loadLangs(array("receptions","companies","bills",'deliveries','orders','stocks','other','propal','sendings')); if (!empty($conf->incoterm->enabled)) $langs->load('incoterm'); if (! empty($conf->productbatch->enabled)) $langs->load('productbatch'); @@ -780,9 +780,10 @@ if ($action == 'create') } print ''; print "\n"; + // Ref client print ''; - if ($origin == 'supplier_order') print $langs->trans('RefSupplierOrder'); + if ($origin == 'supplier_order') print $langs->trans('SupplierOrder'); else print $langs->trans('RefSupplier'); print ''; print ''; @@ -815,7 +816,7 @@ if ($action == 'create') print ''; //print dol_print_date($object->date_livraison,"day"); // date_livraison come from order and will be stored into date_delivery planed. $date_delivery = ($date_delivery?$date_delivery:$object->date_livraison); // $date_delivery comes from GETPOST - print $form->select_date($date_delivery?$date_delivery:-1, 'date_delivery', 1, 1, 1); + print $form->selectDate($date_delivery?$date_delivery:-1, 'date_delivery', 1, 1, 1); print "\n"; print ''; @@ -1163,10 +1164,10 @@ if ($action == 'create') { print ''; print ''; - print $form->select_date($dispatchLines[$indiceAsked]['DLC'], 'dlc' . $indiceAsked, '', '', 1, ""); + print $form->selectDate($dispatchLines[$indiceAsked]['DLC'], 'dlc' . $indiceAsked, '', '', 1, ""); print ''; print ''; - print $form->select_date($dispatchLines[$indiceAsked]['DLUO'], 'dluo' . $indiceAsked, '', '', 1, ""); + print $form->selectDate($dispatchLines[$indiceAsked]['DLUO'], 'dluo' . $indiceAsked, '', '', 1, ""); print ''; } else { @@ -1398,7 +1399,7 @@ elseif ($id || $ref) if ($typeobject == 'CommandeFournisseur' && $object->$typeobject->id && ! empty($conf->propal->enabled)) { print ''; - print $langs->trans("RefSupplierOrder").''; + print $langs->trans("SupplierOrder").''; print ''; print $objectsrc->getNomUrl(1, 'reception'); print "\n"; @@ -1424,7 +1425,7 @@ elseif ($id || $ref) print '
'; print ''; print ''; - print $form->select_date($object->date_delivery?$object->date_delivery:-1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0, 1); + print $form->selectDate($object->date_delivery?$object->date_delivery:-1, 'liv_', 1, 1, '', "setdate_livraison", 1, 0); print ''; print '
'; } @@ -1887,9 +1888,9 @@ elseif ($id || $ref) { print '
'; print $langs->trans('EatByDate').' : '; - print $form->select_date($lines[$i]->eatby, 'dlc' .$line_id, '', '', 1, ""). '
'; + print $form->selectDate($lines[$i]->eatby, 'dlc' .$line_id, '', '', 1, ""). '
'; print $langs->trans('SellByDate').' : '; - print $form->select_date($lines[$i]->sellby, 'dluo' .$line_id, '', '', 1, ""); + print $form->selectDate($lines[$i]->sellby, 'dluo' .$line_id, '', '', 1, ""); print ''; } print ''; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 17518df8ab6..8b37df8c779 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -566,7 +566,7 @@ if ($resql) print $langs->trans('DateInvoice'); print ''; print ''; - print $form->select_date('', '', '', '', '', '', 1, 1); + print $form->selectDate('', '', '', '', '', '', 1, 1); print ''; print ''; print ''; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 2e9029a45ab..c7083efc455 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.form.class.php'; -$langs->loadLangs(array("companies", "commercial", "bills", "cashdesk")); +$langs->loadLangs(array("companies", "commercial", "bills", "cashdesk", "stocks")); $id = GETPOST('id', 'int'); $action = GETPOST('action', 'alpha'); diff --git a/htdocs/takepos/lib/takepos.lib.php b/htdocs/takepos/lib/takepos.lib.php index 691f118d2cb..024e1fb9ae5 100644 --- a/htdocs/takepos/lib/takepos.lib.php +++ b/htdocs/takepos/lib/takepos.lib.php @@ -52,7 +52,9 @@ function takeposAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@takepos:/takepos/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'takepos'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos'); + + complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos', 'remove'); return $head; } diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 46cbdd595d9..97355d7c0e2 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -47,6 +47,8 @@ if ($setterminal>0) $_SESSION["takeposterminal"]=$setterminal; } +$_SESSION["urlfrom"]='/takepos/takepos.php'; + $langs->loadLangs(array("bills","orders","commercial","cashdesk","receiptprinter")); $categorie = new Categorie($db); @@ -156,7 +158,7 @@ if(localStorage.hasKeyboard) { function ClearSearch() { console.log("ClearSearch"); $("#search").val(''); - browser->layer == 'classic') { ?> + browser->layout == 'classic') { ?> setFocusOnSearchField(); } @@ -356,6 +358,7 @@ function deleteline() { $("#poslines").load("invoice.php?action=deleteline&place="+place+"&idline="+selectedline, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); + ClearSearch(); } function Customer() { @@ -405,6 +408,7 @@ function New() { $("#poslines").load("invoice.php?action=delete&place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); + ClearSearch(); } } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 6817039e7a1..86b4fa82c12 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2242,6 +2242,9 @@ img.toolbarbutton { height: 30px; } +li.expanded > a.fmdirlia.jqft.ecmjqft { + font-weight: bold !important; +} diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d46fe752cb7..205ed21bdcf 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2361,6 +2361,9 @@ img.toolbarbutton { height: 30px; } +li.expanded > a.fmdirlia.jqft.ecmjqft { + font-weight: bold !important; +} /* ============================================================================== */ diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 2a4195cb07b..26b9756006c 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2018 Jean-François FERRY * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2018 Regis Houssin + * Copyright (C) 2019 Juanjo Menent * * 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 @@ -210,6 +211,11 @@ $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)"; $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; +if ($socid > 0) +{ + $sql.= " AND t.fk_soc = ".$socid; +} + foreach($search as $key => $val) { if ($key == 'fk_statut') diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php index ae3fbfcbf8f..7c1a81b594c 100644 --- a/htdocs/user/logout.php +++ b/htdocs/user/logout.php @@ -80,6 +80,7 @@ if (session_status() === PHP_SESSION_ACTIVE) // Not sure this is required unset($_SESSION['dol_login']); unset($_SESSION['dol_entity']); +unset($_SESSION['urlfrom']); if (GETPOST('noredirect')) return; header("Location: ".$url); // Default behaviour is redirect to index.php page diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 1fd5939b4ac..38af5be87e4 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3080,7 +3080,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') print ''; print $langs->trans('DateCreation'); print ''; - print $form->select_date($pagedatecreation, 'datecreation', 1, 1, 0, '', 1, 1); + print $form->selectDate($pagedatecreation, 'datecreation', 1, 1, 0, '', 1, 1); //print dol_print_date($pagedatecreation, 'dayhour'); print ''; diff --git a/htdocs/website/lib/websiteaccount.lib.php b/htdocs/website/lib/websiteaccount.lib.php index 0b63be45188..8ade5eee288 100644 --- a/htdocs/website/lib/websiteaccount.lib.php +++ b/htdocs/website/lib/websiteaccount.lib.php @@ -79,5 +79,7 @@ function websiteaccountPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website', 'remove'); + return $head; } diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index cbe6ad948d8..f52b7d21304 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -409,13 +409,15 @@ class FilesLibTest extends PHPUnit\Framework\TestCase $count=0; dol_delete_dir_recursive($dirout, $count, 1); - $result=dol_compress_file($filein, $fileout, $format); + $errorstring = ''; + + $result=dol_compress_file($filein, $fileout, $format, $errorstring); print __METHOD__." result=".$result."\n"; - $this->assertGreaterThanOrEqual(1, $result); + $this->assertGreaterThanOrEqual(1, $result, "Pb with dol_compress_file ".$errorstring); $result=dol_uncompress($fileout, $dirout); print __METHOD__." result=".join(',', $result)."\n"; - $this->assertEquals(0, count($result)); + $this->assertEquals(0, count($result), "Pb with dol_uncompress_file"); } /**