diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 81c3168d532..01b379abf0d 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -46,6 +46,8 @@ $langs->load("admin"); $langs->load("companies"); $langs->load("resource"); $langs->load("holiday"); +$langs->load("accountancy"); +$langs->load("hrm"); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); @@ -78,7 +80,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,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,32,0); +$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,32,0); // Name of SQL tables of dictionaries $tabname=array(); @@ -114,6 +116,8 @@ $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_accountancy_category"; +$tabname[33]= MAIN_DB_PREFIX."c_hrm_department"; +$tabname[34]= MAIN_DB_PREFIX."c_hrm_function"; // Dictionary labels $tablib=array(); @@ -149,6 +153,8 @@ $tablib[29]= "DictionaryOpportunityStatus"; $tablib[30]= "DictionaryFormatCards"; $tablib[31]= "DictionaryAccountancysystem"; $tablib[32]= "DictionaryAccountancyCategory"; +$tablib[33]= "DictionaryDepartment"; +$tablib[34]= "DictionaryFunction"; // Requests to extract data $tabsql=array(); @@ -179,11 +185,13 @@ $tabsql[24]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX $tabsql[25]= "SELECT rowid as rowid, label, type_template, private, position, topic, content, active FROM ".MAIN_DB_PREFIX."c_email_templates WHERE entity IN (".getEntity('email_template',1).")"; $tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units"; $tabsql[27]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_stcomm"; -$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; +$tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; $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.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1"; $tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range, a.position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accountancy_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE 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"; // Criteria to sort dictionaries $tabsqlsort=array(); @@ -219,6 +227,8 @@ $tabsqlsort[29]="position ASC"; $tabsqlsort[30]="code ASC"; $tabsqlsort[31]="pcg_version ASC"; $tabsqlsort[32]="code ASC, label ASC"; +$tabsqlsort[33]="code ASC"; +$tabsqlsort[34]="code ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); @@ -249,11 +259,13 @@ $tabfield[24]= "code,label"; $tabfield[25]= "label,type_template,position,topic,content"; $tabfield[26]= "code,label,short_label"; $tabfield[27]= "code,libelle"; -$tabfield[28]= "code,label,affect,delay,newByMonth,country_id,country"; +$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,country_id,country,label"; $tabfield[32]= "code,label,range,position,country_id,country"; +$tabfield[33]= "code,label"; +$tabfield[34]= "code,label"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); @@ -284,11 +296,13 @@ $tabfieldvalue[24]= "code,label"; $tabfieldvalue[25]= "label,type_template,position,topic,content"; $tabfieldvalue[26]= "code,label,short_label"; $tabfieldvalue[27]= "code,libelle"; -$tabfieldvalue[28]= "code,label,affect,delay,newByMonth,country"; +$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,country,label"; $tabfieldvalue[32]= "code,label,range,position,country"; +$tabfieldvalue[33]= "code,label"; +$tabfieldvalue[34]= "code,label"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); @@ -319,11 +333,13 @@ $tabfieldinsert[24]= "code,label"; $tabfieldinsert[25]= "label,type_template,private,position,topic,content,entity"; $tabfieldinsert[26]= "code,label,short_label"; $tabfieldinsert[27]= "code,libelle"; -$tabfieldinsert[28]= "code,label,affect,delay,newByMonth,fk_country"; +$tabfieldinsert[28]= "code,label,affect,delay,newbymonth,fk_country"; $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,fk_pays,label"; $tabfieldinsert[32]= "code,label,range,position,fk_country"; +$tabfieldinsert[33]= "code,label"; +$tabfieldinsert[34]= "code,label"; // Nom du rowid si le champ n'est pas de type autoincrement // Example: "" if id field is "rowid" and has autoincrement on @@ -361,6 +377,8 @@ $tabrowid[29]= ""; $tabrowid[30]= ""; $tabrowid[31]= ""; $tabrowid[32]= ""; +$tabrowid[33]= "rowid"; +$tabrowid[34]= "rowid"; // Condition to show dictionary in setup page $tabcond=array(); @@ -396,6 +414,8 @@ $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[33]= ! empty($conf->hrm->enabled); +$tabcond[34]= ! empty($conf->hrm->enabled); // List of help for fields $tabhelp=array(); @@ -426,11 +446,13 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[25] = array('topic'=>$langs->trans('SeeSubstitutionVars'),'content'=>$langs->trans('SeeSubstitutionVars'),'type_template'=>$langs->trans("TemplateForElement"),'private'=>$langs->trans("TemplateIsVisibleByOwnerOnly"), 'position'=>$langs->trans("PositionIntoComboList")); $tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode")); $tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode")); -$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically")); +$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically")); $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[33] = array('code'=>$langs->trans("EnterAnyCode")); +$tabhelp[34] = array('code'=>$langs->trans("EnterAnyCode")); // List of check for fields (NOT USED YET) $tabfieldcheck=array(); @@ -466,6 +488,8 @@ $tabfieldcheck[29] = array(); $tabfieldcheck[30] = array(); $tabfieldcheck[31] = array(); $tabfieldcheck[32] = array(); +$tabfieldcheck[33] = array(); +$tabfieldcheck[34] = 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); @@ -482,7 +506,6 @@ if ($id == 11) $langs->load("propal"); $langs->load("bills"); $langs->load("interventions"); - $langs->load("accountancy"); $elementList = array( '' => '', 'societe' => $langs->trans('ThirdParty'), diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index b33b0438552..c155531c286 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -286,7 +286,7 @@ if ($action == 'create') // Type print ''.$langs->trans("AccountType").''; print ''; - $formbank->selectTypeOfBankAccount(isset($_POST["type"])?$_POST["type"]:1,"type"); + $formbank->selectTypeOfBankAccount(isset($_POST["type"])?$_POST["type"]: Account::TYPE_CURRENT,"type"); print ''; // Currency @@ -377,7 +377,7 @@ if ($action == 'create') print ''; print '
'; - if ($_POST["type"] == 0 || $_POST["type"] == 1) + if ($_POST["type"] == Account::TYPE_SAVINGS || $_POST["type"] == Account::TYPE_CURRENT) { print ''; @@ -447,9 +447,8 @@ if ($action == 'create') } } } - $ibankey="IBANNumber"; + $ibankey = FormBank::getIBANLabel($account); $bickey="BICNumber"; - if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; // IBAN @@ -711,9 +710,8 @@ else } } - $ibankey="IBANNumber"; + $ibankey = FormBank::getIBANLabel($account); $bickey="BICNumber"; - if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; print ''; @@ -929,7 +927,7 @@ else print '
'.$langs->trans($ibankey).'
'; print '
'; - if ($_POST["type"] == 0 || $_POST["type"] == 1) + if ($_POST["type"] == Account::TYPE_SAVINGS || $_POST["type"] == Account::TYPE_CURRENT) { print ''; @@ -1000,9 +998,8 @@ else } } - $ibankey="IBANNumber"; + $ibankey = FormBank::getIBANLabel($account); $bickey="BICNumber"; - if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; if ($account->getCountryCode() == 'IN') $bickey="SWIFT"; // IBAN @@ -1033,36 +1030,20 @@ else print '
'; // Accountancy code - if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) - { - if (! empty($conf->accounting->enabled)) - { - print ''; - print ''; - } - else - { - print ''; - print ''; - } + $tdextra = ''; + + if (!empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { + $tdextra = ' class="fieldrequired"'; } - else - { - if (! empty($conf->accounting->enabled)) - { - print ''; - print ''; - } - else - { - print ''; - print ''; - } + + print ''.$langs->trans("AccountancyCode").''; + print ''; // Accountancy journal if (! empty($conf->accounting->enabled)) diff --git a/htdocs/core/class/html.formbank.class.php b/htdocs/core/class/html.formbank.class.php index 450441cf54c..4ee00555b85 100644 --- a/htdocs/core/class/html.formbank.class.php +++ b/htdocs/core/class/html.formbank.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2016 Marcos García * * 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,5 +57,19 @@ class FormBank print Form::selectarray($htmlname, $account->type_lib, $selected); } + /** + * Returns the name of the Iban label. India uses 'IFSC' and the rest of the world 'IBAN' name. + * + * @param Account $account Account object + * @return string + */ + public static function getIBANLabel(Account $account) + { + if ($account->getCountryCode() == 'IN') { + return 'IFSC'; + } + + return 'IBANNumber'; + } } diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 7ccb382a4a3..dcfd11a829d 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -483,7 +483,7 @@ class FormProjets if ($linkedtothirdparty) $sql.=", ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE ".$projectkey." is null"; if (! empty($socid) && $linkedtothirdparty) $sql.= " AND t.fk_soc=".$socid; - if (! in_array($table_element, array('expensereport_det'))) $sql.= ' AND t.entity='.getEntity('project'); + if (! in_array($table_element, array('expensereport_det'))) $sql.= ' AND t.entity IN ('.getEntity('project',1).')'; if ($linkedtothirdparty) $sql.=" AND s.rowid = t.fk_soc"; if ($sqlfilter) $sql.= " AND ".$sqlfilter; $sql.= " ORDER BY ref DESC"; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index a952159b874..9c70635a957 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -602,6 +602,8 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) */ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default_font_size=10) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php'; + global $mysoc, $conf; $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE); @@ -749,8 +751,8 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default else if (! $usedetailedbban) $cury+=1; // Use correct name of bank id according to country - $ibankey="IBANNumber"; - if ($account->getCountryCode() == 'IN') $ibankey="IFSC"; + $ibankey = FormBank::getIBANLabel($account); + if (! empty($account->iban)) { //Remove whitespaces to ensure we are dealing with the format we expect diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index 20ae0f7971c..174158ac7e2 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -77,52 +77,14 @@ class modHRM extends DolibarrModules ); // Minimum version of PHP required by module $this->need_dolibarr_version = array ( 3, - 8 + 9 ); // Minimum version of Dolibarr required by module $this->langfiles = array ( "hrm" ); // Dictionnaries - $this->dictionnaries=array( - 'langs'=>'hrm', - 'tabname'=>array( - MAIN_DB_PREFIX."c_hrm_department", - MAIN_DB_PREFIX."c_hrm_function" - ), - 'tablib'=>array( - "DictionaryDepartment", - "DictionaryFunction" - ), - 'tabsql'=>array( - 'SELECT rowid, pos, code, label, active FROM '.MAIN_DB_PREFIX.'c_hrm_department', - 'SELECT rowid, pos, code, label, c_level, active FROM '.MAIN_DB_PREFIX.'c_hrm_function' - ), - 'tabsqlsort'=>array( - 'rowid ASC', - 'rowid ASC' - ), - 'tabfield'=>array( - "code,label", - "code,label" - ), - 'tabfieldvalue'=>array( - "code,label", - "code,label" - ), - 'tabfieldinsert'=>array( - "code,label", - "code,label" - ), - 'tabrowid'=>array( - "rowid", - "rowid" - ), - 'tabcond'=>array( - '$conf->hrm->enabled', - '$conf->hrm->enabled' - ) - ); + $this->dictionnaries=array(); // Constantes $this->const = array (); diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index e93769f1e2a..307c88c3007 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -63,7 +63,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent FOR EACH RO CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent_type FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent_type_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_advtargetemailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_askpricesupplier FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_askpricesupplier_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_askpricesupplierdet_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); @@ -96,7 +95,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_cronjob FOR EACH ROW CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_deplacement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_documents FOR EACH ROW EXECUTE PROCEDURE update_modified_column_date_u(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_element_resources FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_entrepot FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_events FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); @@ -128,7 +126,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_payment_donation FOR CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_payment_expensereport FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_payment_loan FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_payment_salary FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_printer_ipp FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_printing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product_batch FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); @@ -155,8 +152,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_rib FOR EACH CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_socpeople FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_socpeople_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_stock_mouvement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_time_basket FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_timebasket_counter FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_tva FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_user_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); diff --git a/htdocs/langs/fr_CA/admin.lang b/htdocs/langs/fr_CA/admin.lang index 08ac656d477..556347c5f94 100644 --- a/htdocs/langs/fr_CA/admin.lang +++ b/htdocs/langs/fr_CA/admin.lang @@ -37,8 +37,8 @@ Module2660Desc=Activer le client Dolibarr de services Web (peut être utilisé p Module3100Desc=Ajouter un bouton Skype dans la carte des utilisateurs / tiers / contacts / membres Module4000Name=Gestion des ressources humaines Module4000Desc=Ressources humaines -Module20000Name=Gestion des demandes de congès -Module20000Desc=Déclaration et suivi des congès des employés +Module20000Name=Gestion des demandes de congés +Module20000Desc=Déclaration et suivi des congés des employés Module39000Name=Lot/Série du produit Module55000Name=Sondage, enquête ou vote Module55000Desc=Module pour faire des sondages en ligne, des enquêtes ou des votes (comme Doodle , Studs , Rdvz , ... ) diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 85dfab58e2b..382392efe8d 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -836,7 +836,7 @@ DictionaryAccountancysystem=Modèles de plan comptable DictionaryEMailTemplates=Modèles des courriels DictionaryUnits=Unités DictionaryProspectStatus=Statuts de prospection -DictionaryHolidayTypes=Type de congès +DictionaryHolidayTypes=Type de congés DictionaryOpportunityStatus=Statut d'opportunités pour les affaires/projets SetupSaved=Configuration sauvegardée BackToModuleList=Retour liste des modules diff --git a/htdocs/langs/fr_FR/holiday.lang b/htdocs/langs/fr_FR/holiday.lang index d4332d16927..9a9095559b0 100644 --- a/htdocs/langs/fr_FR/holiday.lang +++ b/htdocs/langs/fr_FR/holiday.lang @@ -3,7 +3,7 @@ HRM=GRH Holidays=Congés CPTitreMenu=Congés MenuReportMonth=État mensuel -MenuAddCP=Créer demande de congès +MenuAddCP=Créer demande de congés NotActiveModCP=Vous devez activer le module Congés pour afficher cette page. NotConfigModCP=Vous devez configurer le module Congés pour afficher cette page. Pour effectuer cette opération, cliquer ici. NoCPforUser=Vous n'avez plus de jours disponibles @@ -22,7 +22,7 @@ ReviewedByCP=Sera approuvé par DescCP=Description SendRequestCP=Créer une demande de congés DelayToRequestCP=Les demandes de congés doivent être faites au moins %s jour(s) avant la date de ceux-ci. -MenuConfCP=Solde des congès +MenuConfCP=Solde des congés UpdateAllCP=Mettre à jour les congés SoldeCPUser=Solde de congés: %s jours. ErrorEndDateCP=Vous devez choisir une date de fin supérieur à la date de début. @@ -80,7 +80,7 @@ alreadyCPexist=Une demande de congés a déjà été faite sur cette période. UserName=Nom Prénom FirstDayOfHoliday=Premier jour de congés LastDayOfHoliday=Dernier jours de congés -BoxTitleLastLeaveRequests=Les %s dernières demandes de congès modifiées +BoxTitleLastLeaveRequests=Les %s dernières demandes de congés modifiées HolidaysMonthlyUpdate=Mise à jour mensuelle ManualUpdate=Mise à jour manuelle HolidaysCancelation=Annulation de la demande de congés @@ -92,7 +92,7 @@ ValueOptionCP=Valeur GroupToValidateCP=Groupe ayant la possibilité d'approuver les congés ConfirmConfigCP=Valider la configuration LastUpdateCP=Dernière mise à jour automatique de l'allocation des congés -MonthOfLastMonthlyUpdate=Mois de la dernière mise à jour automatique des attributions de congès +MonthOfLastMonthlyUpdate=Mois de la dernière mise à jour automatique des attributions de congés UpdateConfCPOK=Mise à jour effectuée avec succès. ErrorUpdateConfCP=Une erreur à eu lieu durant la mise à jour, merci de réessayer. AddCPforUsers=Veuillez ajouter le solde des congés des utilisateurs en cliquant ici. diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 51b3477b248..4b929fea438 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -69,7 +69,7 @@ if ($id > 0 || ! empty($ref)) // Security check $socid=GETPOST('socid'); if ($user->societe_id > 0) $socid=$user->societe_id; -$result = restrictedArea($user, 'projet', $object->id); +$result = restrictedArea($user, 'projet', $object->id,'projet&project'); // fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 627bb67ff53..f3905d5af5e 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -223,7 +223,7 @@ if ($search_user > 0) $sql.=", ".MAIN_DB_PREFIX."element_contact as ecp"; } -$sql.= " WHERE p.entity IN (".getEntity('project').')'; +$sql.= " WHERE p.entity IN (".getEntity('project',1).')'; if (! $user->rights->projet->all->lire) $sql.= " AND p.rowid IN (".$projectsListId.")"; // public and assigned to, or restricted to company for external users // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index d258dbb1e38..8caf413c8ee 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -235,7 +235,7 @@ if ($search_task_user > 0) $sql.=", ".MAIN_DB_PREFIX."element_contact as ect"; } $sql.= " WHERE t.fk_projet = p.rowid"; -$sql.= " AND p.entity IN (".getEntity('project').')'; +$sql.= " AND p.entity IN (".getEntity('project',1).')'; if (! $user->rights->projet->all->lire) $sql.=" p.rowid IN (".join(',',$projectsListId).")"; // public and assigned to projects, or restricted to company for external users // No need to check company, as filtering of projects must be done by getProjectsAuthorizedForUser if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index c323ad17e69..bfd4f04c3e5 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -393,7 +393,7 @@ class Resource extends CommonObject } } } - $sql.= " GROUP BY t.rowid"; + $sql.= " GROUP BY t.rowid, ty.label"; $sql.= $this->db->order($sortfield,$sortorder); $this->num_all = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -473,7 +473,7 @@ class Resource extends CommonObject } } } - $sql.= " GROUP BY t.rowid"; + $sql.= " GROUP BY t.rowid, ty.label"; $sql.= $this->db->order($sortfield,$sortorder); if ($limit) $sql.= $this->db->plimit($limit+1,$offset); dol_syslog(get_class($this)."::fetch_all", LOG_DEBUG);
'.$langs->trans("AccountancyCode").''; - print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1); - print '
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("AccountancyCode").''; - print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1); - print '
'.$langs->trans("AccountancyCode").'account_number).'">
'; + if (!empty($conf->accounting->enabled)) { + print $formaccountancy->select_account($account->account_number, 'account_number', 1, '', 1, 1); + } else { + print 'account_number).'">'; } + print '