diff --git a/ChangeLog b/ChangeLog index 0f13e4651b1..5b73c4b2212 100644 --- a/ChangeLog +++ b/ChangeLog @@ -72,6 +72,9 @@ FIX: User creation of expense report not visible FIX: warning when adding a line if $remise_percent is an empty string FIX: status late on purchase orders FIX: ODT generation very slow +FIX: amount in summary of report +FIX: vat value when code contains number +FIX: payment term label on PDF ***** ChangeLog for 13.0.0 compared to 12.0.0 ***** diff --git a/doc/images/dolibarr_screenshot12_1920x1080.jpg b/doc/images/dolibarr_screenshot12_1920x1080.jpg new file mode 100644 index 00000000000..72ae74cb00f Binary files /dev/null and b/doc/images/dolibarr_screenshot12_1920x1080.jpg differ diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 382b7ee6f62..341e99a8659 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -359,9 +359,9 @@ class AccountancyExport print length_accountg($line->numero_compte).$separator; print length_accounta($line->subledger_account).$separator; print $line->sens.$separator; - print price($line->montant).$separator; - print $line->label_operation.$separator; - print $line->doc_ref; + print price2fec(abs($line->montant)).$separator; + print dol_string_unaccent($line->label_operation).$separator; + print dol_string_unaccent($line->doc_ref); print $end_line; } } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index b33eb3564bf..8f2ea3f0706 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -796,7 +796,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $adht = new AdherentType($db); - print load_fiche_titre($langs->trans("NewMember"), '', 'members'); + print load_fiche_titre($langs->trans("NewMember"), '', $object->picto); if ($conf->use_javascript_ajax) { print "\n".''."\n"; } @@ -1921,7 +1988,6 @@ function sort_events_by_date($a, $b) { return -1; } - if ($b->type_code === 'HOLIDAY') { return 1; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 03dc3b4881c..68925c57bfa 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -269,11 +269,11 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid); if ($search_status != '' && $search_status > -1) $param .= "&search_status=".urlencode($search_status); if ($filter) $param .= "&search_filter=".urlencode($filter); if ($filtert) $param .= "&search_filtert=".urlencode($filtert); -if ($socid) $param .= "&search_socid=".urlencode($socid); +if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup); +if ($socid > 0) $param .= "&search_socid=".urlencode($socid); if ($showbirthday) $param .= "&search_showbirthday=1"; if ($pid) $param .= "&search_projectid=".urlencode($pid); if ($type) $param .= "&search_type=".urlencode($type); -if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup); if ($search_id != '') $param .= '&search_title='.urlencode($search_id); if ($search_title != '') $param .= '&search_title='.urlencode($search_title); if ($search_note != '') $param .= '&search_note='.$search_note; @@ -287,6 +287,8 @@ if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; +$paramnoactionodate = $param; + // List of mass actions available $arrayofmassactions = array( 'set_all_events_to_todo' => $langs->trans("SetAllEventsToTodo"), @@ -308,7 +310,7 @@ $sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulld $sql .= ' a.fk_user_author,a.fk_user_action,'; $sql .= " a.fk_contact, a.note, a.percent as percent,"; $sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,"; -$sql .= " c.code as type_code, c.libelle as type_label,"; +$sql .= " c.code as type_code, c.libelle as type_label, c.color as type_color, c.type as type_type, c.picto as type_picto,"; $sql .= " sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id"; // Add fields from extrafields @@ -481,31 +483,31 @@ if ($resql) } $viewmode = ''; - $viewmode .= ''; + $viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; - $viewmode .= ''; + $viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; - $viewmode .= ''; + $viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewWeek").''; - $viewmode .= ''; + $viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewDay").''; - $viewmode .= ''; + $viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); //$viewmode .= ''; @@ -657,6 +659,7 @@ if ($resql) $actionstatic->type_code = $obj->type_code; $actionstatic->type_label = $obj->type_label; $actionstatic->type_picto = $obj->type_picto; + $actionstatic->type_color = $obj->type_color; $actionstatic->label = $obj->label; $actionstatic->location = $obj->location; $actionstatic->note_private = dol_htmlentitiesbr($obj->note); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index a399ee3d580..613ffee7be7 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -236,8 +236,8 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid); if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status); if ($filter) $param .= "&search_filter=".urlencode($filter); if ($filtert) $param .= "&search_filtert=".urlencode($filtert); -if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup); -if ($socid) $param .= "&search_socid=".urlencode($socid); +if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup); +if ($socid > 0) $param .= "&search_socid=".urlencode($socid); if ($showbirthday) $param .= "&search_showbirthday=1"; if ($pid) $param .= "&search_projectid=".urlencode($pid); if ($type) $param .= "&search_type=".urlencode($type); @@ -248,6 +248,8 @@ if ($begin_d != '') $param .= '&begin_d='.urlencode($begin_d); if ($end_d != '') $param .= '&end_d='.urlencode($end_d); $param .= "&maxprint=".urlencode($maxprint); +$paramnoactionodate = $param; + $prev = dol_get_first_day($year, 1); $prev_year = $year - 1; $prev_month = $month; @@ -352,31 +354,31 @@ if ($conf->use_javascript_ajax) $massactionbutton = ''; $viewmode = ''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewWeek").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewDay").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); //$viewmode .= ''; @@ -430,6 +432,8 @@ print ''; // Get event in an array $eventarray = array(); + +// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR $sql = 'SELECT'; if ($usergroup > 0) $sql .= " DISTINCT"; $sql .= ' a.id, a.label,'; @@ -439,7 +443,7 @@ $sql .= ' a.percent,'; $sql .= ' a.fk_user_author,a.fk_user_action,'; $sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,'; -$sql .= ' ca.code, ca.color'; +$sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto'; $sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; // We must filter on resource table diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 6b54a327705..34a4cc232b6 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -236,8 +236,8 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid); if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status); if ($filter) $param .= "&search_filter=".urlencode($filter); if ($filtert) $param .= "&search_filtert=".urlencode($filtert); -if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup); -if ($socid) $param .= "&search_socid=".urlencode($socid); +if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup); +if ($socid > 0) $param .= "&search_socid=".urlencode($socid); if ($showbirthday) $param .= "&search_showbirthday=1"; if ($pid) $param .= "&search_projectid=".urlencode($pid); if ($type) $param .= "&search_type=".urlencode($type); @@ -248,6 +248,7 @@ if ($begin_d != '') $param .= '&begin_d='.urlencode($begin_d); if ($end_d != '') $param .= '&end_d='.urlencode($end_d); $param .= "&maxprint=".urlencode($maxprint); +$paramnoactionodate = $param; $prev = dol_get_first_day_week($day, $month, $year); //print "day=".$day." month=".$month." year=".$year; @@ -357,31 +358,31 @@ if ($conf->use_javascript_ajax) $massactionbutton = ''; $viewmode = ''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewList").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewCal").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewWeek").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"'); //$viewmode .= ''; $viewmode .= ''.$langs->trans("ViewDay").''; -$viewmode .= ''; +$viewmode .= ''; //$viewmode .= ''; $viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"'); //$viewmode .= ''; @@ -435,10 +436,11 @@ print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $show print ''; - // Get event in an array $eventarray = array(); + +// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR $sql = 'SELECT'; if ($usergroup > 0) $sql .= " DISTINCT"; $sql .= ' a.id, a.label,'; @@ -448,7 +450,7 @@ $sql .= ' a.percent,'; $sql .= ' a.fk_user_author,a.fk_user_action,'; $sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,'; -$sql .= ' ca.code, ca.color'; +$sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto'; $sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc"; // We must filter on resource table diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index cc296e4472a..5eca82f022c 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -116,6 +116,11 @@ $pagenext = $page + 1; if (!$sortfield) $sortfield = 'p.ref'; if (!$sortorder) $sortorder = 'DESC'; +$permissiontoread = $user->rights->propal->lire; +$permissiontoadd = $user->rights->propal->write; +$permissiontodelete = $user->rights->propal->supprimer; +$permissiontoclose = $user->rights->propal->cloturer; + // Security check $module = 'propal'; $dbtable = ''; @@ -260,13 +265,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' } if ($object_statut != '') $search_status = $object_statut; + if (empty($reshook)) { $objectclass = 'Propal'; $objectlabel = 'Proposals'; - $permissiontoread = $user->rights->propal->lire; - $permissiontodelete = $user->rights->propal->supprimer; - $permissiontoclose = $user->rights->propal->cloturer; $uploaddir = $conf->propal->multidir_output[$conf->entity]; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -1492,7 +1495,7 @@ if ($resql) print $formfile->showdocuments('massfilesarea_proposals', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } else { - dol_print_error($db); + dol_print_error($db); } // End of page diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 06be1179fb1..8937e562227 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -61,7 +61,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, * View */ -llxHeader('', $langs->trans('Proposal'), 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'); +$help_url = 'EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos'; + +llxHeader('', $langs->trans('Proposal'), $help_url); $form = new Form($db); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f7cc3e7af47..f0c05ec7986 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -238,7 +238,7 @@ if (empty($reshook)) elseif ($action == 'add' && $usercancreate) { $datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - $datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); + $date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $selectedLines = GETPOST('toselect', 'array'); if ($datecommande == '') { @@ -271,8 +271,8 @@ if (empty($reshook)) $object->fk_account = GETPOST('fk_account', 'int'); $object->availability_id = GETPOST('availability_id'); $object->demand_reason_id = GETPOST('demand_reason_id'); - $object->date_livraison = $datelivraison; // deprecated - $object->delivery_date = $datelivraison; + $object->date_livraison = $date_delivery; // deprecated + $object->delivery_date = $date_delivery; $object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->warehouse_id = GETPOST('warehouse_id', 'int'); $object->fk_delivery_address = GETPOST('fk_address'); @@ -1628,7 +1628,7 @@ if ($action == 'create' && $usercancreate) print ''.$langs->trans("DateDeliveryPlanned").''; print ''; $date_delivery = ($date_delivery ? $date_delivery : $object->date_delivery); - print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); + print $form->selectDate($date_delivery ? $date_delivery : -1, 'liv_', 1, 1, 1); print "\n"; print ''; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4c2f643df1c..6b75d57d082 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3283,6 +3283,7 @@ class Commande extends CommonOrder if (isset($this->note_public)) $this->note_public = trim($this->note_public); if (isset($this->model_pdf)) $this->model_pdf = trim($this->model_pdf); if (isset($this->import_key)) $this->import_key = trim($this->import_key); + $delivery_date = empty($this->delivery_date) ? $this->date_livraison : $this->delivery_date; // Check parameters // Put here code to add control on parameters values @@ -3307,6 +3308,8 @@ class Commande extends CommonOrder $sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").","; $sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").","; + $sql .= " date_livraison=".(strval($this->delivery_date) != '' ? "'".$this->db->idate($this->delivery_date)."'" : 'null').","; + $sql .= " fk_shipping_method=".(isset($this->shipping_method_id) ? $this->shipping_method_id : "null").","; $sql .= " fk_account=".($this->fk_account > 0 ? $this->fk_account : "null").","; $sql .= " fk_input_reason=".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null").","; $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 7df7dbea130..add4244d7dc 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2011-2015 Philippe Grand + * Copyright (C) 2021 Frédéric France * * 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 @@ -128,23 +129,17 @@ $userstatic = new User($db); /* */ /* *************************************************************************** */ -if ($id > 0 || !empty($ref)) -{ - $langs->trans("OrderCard"); - - if ($object->fetch($id, $ref) > 0) - { +if ($id > 0 || !empty($ref)) { + if ($object->fetch($id, $ref) > 0) { $object->fetch_thirdparty(); $head = commande_prepare_head($object); print dol_get_fiche_head($head, 'contact', $langs->trans("CustomerOrder"), -1, 'order'); - // Order card $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref = '
'; // Ref customer $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 85b9bbbbf26..5bfbb2ed266 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1398,7 +1398,7 @@ if ($resql) if ($links[$key]['type'] == 'payment_salary') $type_link = 'payment_salary'; } - $sqlu = "SELECT url_id FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".$objp->rowid." AND type='user'"; + $sqlu = "SELECT url_id FROM ".MAIN_DB_PREFIX."bank_url WHERE fk_bank=".$objp->rowid." AND (type='user' OR type='salary')"; $resqlu = $db->query($sqlu); if ($resqlu) { diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 1184da6d7ac..45d8c535f2d 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -585,7 +585,7 @@ foreach ($accounts as $key=>$type) if (!empty($arrayfields['balance']['checked'])) { print ''; - print ''.price($solde, 0, $langs, 0, -1, -1, $objecttmp->currency_code).''; + print ''.price($solde, 0, $langs, 1, -1, -1, $objecttmp->currency_code).''; print ''; if (!$i) $totalarray['nbfield']++; if (!$i) $totalarray['pos'][$totalarray['nbfield']] = 'balance'; diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 0d91eb38e7d..0790f149da4 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -58,6 +58,10 @@ $search_accountancy_account = GETPOST("search_accountancy_account"); if ($search_accountancy_account == - 1) $search_accountancy_account = ''; $search_accountancy_subledger = GETPOST("search_accountancy_subledger"); if ($search_accountancy_subledger == - 1) $search_accountancy_subledger = ''; +if (empty($search_datep_start)) $search_datep_start = GETPOST("search_datep_start", 'int'); +if (empty($search_datep_end)) $search_datep_end = GETPOST("search_datep_end", 'int'); +if (empty($search_datev_start)) $search_datev_start = GETPOST("search_datev_start", 'int'); +if (empty($search_datev_end)) $search_datev_end = GETPOST("search_datev_end", 'int'); $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 04cdea52f7f..3dcbfc6519f 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -73,9 +73,10 @@ $terminalid = $cashcontrol->posnumber; * View */ +$title = $langs->trans("CashControl"); $param = ''; -llxHeader('', $langs->trans("CashControl"), '', '', 0, 0, array(), array(), $param); +llxHeader('', $title, '', '', 0, 0, array(), array(), $param); /*$sql = "SELECT b.rowid, b.dateo as do, b.datev as dv, b.amount, b.label, b.rappro as conciliated, b.num_releve, b.num_chq,"; $sql.= " b.fk_account, b.fk_type,"; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index a1471f48482..b17cb5b6049 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -289,11 +289,11 @@ if (empty($reshook)) elseif ($action == 'setref' && $user->rights->facture->creer) { //var_dump(GETPOST('ref', 'alpha'));exit; - $result = $object->setValueFrom('title', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY'); + $result = $object->setValueFrom('titre', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY'); if ($result > 0) { - $object->titre = GETPOST('ref', 'alpha'); // deprecated - $object->title = GETPOST('ref', 'alpha'); + $object->titre = $ref; // deprecated + $object->title = $ref; $object->ref = $object->title; } else { $error++; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index cdb729991da..ece75be8b3a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4120,7 +4120,7 @@ if ($action == 'create') if ($objectidnext > 0) { $facthatreplace = new Facture($db); $facthatreplace->fetch($objectidnext); - print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')'; + print ' ('.str_replace('{s1}', $facthatreplace->getNomUrl(1), $langs->transnoentities("ReplacedByInvoice", '{s1}')).')'; } if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) { @@ -4128,7 +4128,10 @@ if ($action == 'create') $result = $discount->fetch(0, $object->id); if ($result > 0) { print ' '; - print $langs->transnoentities("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')); + $s = $langs->trans("CreditNoteConvertedIntoDiscount", '{s1}', '{s2}'); + $s = str_replace('{s1}', $object->getLibType(1), $s); + $s = str_replace('{s2}', $discount->getNomUrl(1, 'discount'), $s); + print $s; print '
'; } } @@ -4139,7 +4142,9 @@ if ($action == 'create') $result = $tmptemplate->fetch($object->fk_fac_rec_source); if ($result > 0) { print ' '; - print $langs->transnoentities("GeneratedFromTemplate", ''.dol_escape_htmltag($tmptemplate->ref).''); + $s = $langs->transnoentities("GeneratedFromTemplate", '{s1}'); + $s = str_replace('{s1}', ''.dol_escape_htmltag($tmptemplate->ref).'', $s); + print $s; print ''; } } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 6beb5caa1e2..6f3f8088a63 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -268,7 +268,7 @@ if ($search_status != '' && $search_status >= -1) if ($search_status == -1) $sql .= ' AND suspended = 1'; } $sql .= dolSqlDateFilter('f.date_last_gen', $search_day, $search_month, $search_year); -$sql .= dolSqlDateFilter('f.date_last_gen', $search_day_date_when, $search_month_date_when, $search_year_date_when); +$sql .= dolSqlDateFilter('f.date_when', $search_day_date_when, $search_month_date_when, $search_year_date_when); $sql .= $db->order($sortfield, $sortorder); diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index fc37c3f309c..76b1dab5d83 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -1312,7 +1312,7 @@ class Paiement extends CommonObject $invoice = new Facture($this->db); if ($invoice->fetch($billsarray[0]) > 0) { - $force_thirdparty_id = $invoice->fk_soc; + $force_thirdparty_id = $invoice->socid; } } } diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 3072dcdee2b..4f1a3043c76 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -252,7 +252,7 @@ if ($modecompta == 'BOOKKEEPING') $sql .= " AND f.entity = ".$conf->entity; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.doc_date >= '".$db->idate($date_start)."' AND f.doc_date <= '".$db->idate($date_end)."'"; - $sql .= " GROUP BY pcg_type, name, socid"; + $sql .= " GROUP BY pcg_type DESC, name, socid"; $sql .= $db->order($sortfield, $sortorder); $oldpcgtype = ''; @@ -284,6 +284,15 @@ if ($modecompta == 'BOOKKEEPING') $total_ht += (isset($objp->amount) ? $objp->amount : 0); $total_ttc += (isset($objp->amount) ? $objp->amount : 0); + if ($objp->pcg_type == 'INCOME') { + $total_ht_income += (isset($objp->amount) ? $objp->amount : 0); + $total_ttc_income += (isset($objp->amount) ? $objp->amount : 0); + } + if ($objp->pcg_type == 'EXPENSE') { + $total_ht_outcome -= (isset($objp->amount) ? $objp->amount : 0); + $total_ttc_outcome -= (isset($objp->amount) ? $objp->amount : 0); + } + // Loop on detail of all accounts // This make 14 calls for each detail of account (NP, N and month m) if ($showaccountdetail != 'no') @@ -446,6 +455,7 @@ if ($modecompta == 'BOOKKEEPING') $total_ht_income += $total_ht; $total_ttc_income += $total_ttc; + print ''; if ($modecompta == 'CREANCES-DETTES') print ''.price($total_ht).''; @@ -525,11 +535,12 @@ if ($modecompta == 'BOOKKEEPING') $total_ht_income += $subtotal_ht; $total_ttc_income += $subtotal_ttc; + print ''; if ($modecompta == 'CREANCES-DETTES') print ''.price($subtotal_ht).''; - print ''.price($subtotal_ttc).''; - print ''; + print ''.price($subtotal_ttc).''; + print ''; } /* @@ -609,6 +620,7 @@ if ($modecompta == 'BOOKKEEPING') $total_ht_outcome += $subtotal_ht; $total_ttc_outcome += $subtotal_ttc; + print ''; if ($modecompta == 'CREANCES-DETTES') print ''.price(-$subtotal_ht).''; @@ -686,6 +698,7 @@ if ($modecompta == 'BOOKKEEPING') $total_ht_outcome += $subtotal_ht; $total_ttc_outcome += $subtotal_ttc; + print ''; if ($modecompta == 'CREANCES-DETTES') print ''.price(-$subtotal_ht).''; @@ -764,6 +777,7 @@ if ($modecompta == 'BOOKKEEPING') $total_ht_outcome += $subtotal_ht; $total_ttc_outcome += $subtotal_ttc; + print ''; if ($modecompta == 'CREANCES-DETTES') print ''.price(-$subtotal_ht).''; @@ -841,6 +855,7 @@ if ($modecompta == 'BOOKKEEPING') $total_ht_outcome += $subtotal_ht; $total_ttc_outcome += $subtotal_ttc; + print ''; if ($modecompta == 'CREANCES-DETTES') print ''.price(-$subtotal_ht).''; @@ -926,6 +941,7 @@ if ($modecompta == 'BOOKKEEPING') $total_ht_outcome += $subtotal_ht; $total_ttc_outcome += $subtotal_ttc; + print ''; if ($modecompta == 'CREANCES-DETTES') print ''.price(-$subtotal_ht).''; print ''.price(-$subtotal_ttc).''; @@ -963,6 +979,7 @@ if ($modecompta == 'BOOKKEEPING') { $subtotal_ht += -$obj->amount; $subtotal_ttc += -$obj->amount; + $total_ht_outcome += $obj->amount; $total_ttc_outcome += $obj->amount; } @@ -978,6 +995,7 @@ if ($modecompta == 'BOOKKEEPING') { $subtotal_ht += $obj->amount; $subtotal_ttc += $obj->amount; + $total_ht_income += $obj->amount; $total_ttc_income += $obj->amount; } @@ -1038,8 +1056,10 @@ if ($modecompta == 'BOOKKEEPING') } $total_ht += $subtotal_ht; $total_ttc += $subtotal_ttc; + $total_ht_income += $subtotal_ht; $total_ttc_income += $subtotal_ttc; + print ''; if ($modecompta == 'CREANCES-DETTES') print ''.price($subtotal_ht).''; @@ -1101,8 +1121,10 @@ if ($modecompta == 'BOOKKEEPING') } else { dol_print_error($db); } + $total_ht_outcome -= 0; $total_ttc_outcome -= $amount; + print ' '; print "".$langs->trans("VATToPay")."\n"; print ' '."\n"; @@ -1151,6 +1173,7 @@ if ($modecompta == 'BOOKKEEPING') } else { dol_print_error($db); } + $total_ht_income += 0; $total_ttc_income += $amount; @@ -1197,8 +1220,10 @@ if ($modecompta == 'BOOKKEEPING') } else { dol_print_error($db); } + $total_ht_outcome -= 0; $total_ttc_outcome -= $amount; + print ' '; print "".$langs->trans("VATPaid")."\n"; if ($modecompta == 'CREANCES-DETTES') @@ -1243,8 +1268,10 @@ if ($modecompta == 'BOOKKEEPING') } else { dol_print_error($db); } + $total_ht_income += 0; $total_ttc_income += $amount; + print ' '; print "".$langs->trans("VATCollected")."\n"; if ($modecompta == 'CREANCES-DETTES') @@ -1279,19 +1306,22 @@ print ''; print ' '; print ''; -print ''.$langs->trans("Outcome").''; -if ($modecompta == 'CREANCES-DETTES') - print ''.price(price2num(-$total_ht_outcome, 'MT')).''; -print ''.price(price2num(-$total_ttc_outcome, 'MT')).''; -print ''; print ''.$langs->trans("Income").''; -if ($modecompta == 'CREANCES-DETTES') +if ($modecompta == 'CREANCES-DETTES') { print ''.price(price2num($total_ht_income, 'MT')).''; +} print ''.price(price2num($total_ttc_income, 'MT')).''; print ''; +print ''.$langs->trans("Outcome").''; +if ($modecompta == 'CREANCES-DETTES') { + print ''.price(price2num(-$total_ht_outcome, 'MT')).''; +} +print ''.price(price2num(-$total_ttc_outcome, 'MT')).''; +print ''; print ''.$langs->trans("Profit").''; -if ($modecompta == 'CREANCES-DETTES') +if ($modecompta == 'CREANCES-DETTES') { print ''.price(price2num($total_ht, 'MT')).''; +} print ''.price(price2num($total_ttc, 'MT')).''; print ''; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index ec2a8bb2623..38d0f4ec3f9 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -866,9 +866,9 @@ if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) if ($obj->pcg_type == 'INCOME') { if (!isset($encaiss[$obj->dm])) $encaiss[$obj->dm] = 0; // To avoid warning of var not defined $encaiss[$obj->dm] += $obj->credit; - $encaiss[$obj->dm] -= $obj->credit; + $encaiss[$obj->dm] -= $obj->debit; } - if ($obj->pcg_type == 'INCOME') { + if ($obj->pcg_type == 'EXPENSE') { if (!isset($decaiss[$obj->dm])) $decaiss[$obj->dm] = 0; // To avoid warning of var not defined $decaiss[$obj->dm] += $obj->debit; $decaiss[$obj->dm] -= $obj->credit; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 07f3424ba60..a6ced6f2757 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -359,7 +359,7 @@ if ($action == 'create') print ''; print $langs->trans('Employee'); print ''; - print ''.$form->select_dolusers($fk_user, 'userid', 1).''; + print ''.img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($fk_user, 'userid', 1).''; // Project if (!empty($conf->projet->enabled)) @@ -371,7 +371,7 @@ if ($action == 'create') print ''.$langs->trans("Project").''; - $numproject = $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1); + print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); print ''; } @@ -385,7 +385,7 @@ if ($action == 'create') if (!empty($conf->banque->enabled)) { print ''.$langs->trans('BankAccount').''; - $form->select_comptes($fk_account, 'fk_account', 0, '', 2); + print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 2, '', 0, '', 1); print ''; } diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index a961d4f1994..360340d84f6 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -43,7 +43,11 @@ $id = GETPOST("id", 'int'); $action = GETPOST("action", "alpha"); $confirm = GETPOST('confirm'); $refund = GETPOST("refund", "int"); -$auto_create_payment = GETPOST("auto_create_paiement", "int"); +if (GETPOSTISSET('auto_create_paiement') || $action === 'add') { + $auto_create_payment = GETPOST("auto_create_paiement", "int"); +} else { + $auto_create_payment = empty($conf->global->CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT); +} if (empty($refund)) $refund = 0; @@ -377,17 +381,10 @@ if ($action == 'create') if (!empty($conf->use_javascript_ajax)) { print "\n".''."\n"; } @@ -475,7 +472,7 @@ if ($action == 'create') // Auto create payment print ''.$langs->trans('AutomaticCreationPayment').''; - print ''."\n"; + print ''."\n"; // Number print ''.$langs->trans('Numero'); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 8d78b410329..0c4a683ae33 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -889,8 +889,8 @@ if (empty($reshook)) $action = 'editref'; } else { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $old_filedir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($old_ref); - $new_filedir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($object->ref); + $old_filedir = $conf->contrat->multidir_output[$object->entity].'/'.dol_sanitizeFileName($old_ref); + $new_filedir = $conf->contrat->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); $files = dol_dir_list($old_filedir); if (!empty($files)) @@ -935,7 +935,7 @@ if (empty($reshook)) // Actions to build doc - $upload_dir = $conf->contrat->dir_output; + $upload_dir = $conf->contrat->multidir_output[$object->entity]; $permissiontoadd = $user->rights->contrat->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; @@ -2137,13 +2137,13 @@ if ($action == 'create') * Documents generes */ $filename = dol_sanitizeFileName($object->ref); - $filedir = $conf->contrat->dir_output."/".dol_sanitizeFileName($object->ref); + $filedir = $conf->contrat->multidir_output[$object->entity]."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = $user->rights->contrat->lire; $delallowed = $user->rights->contrat->creer; - print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); + print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, ($object->model_pdf ? $object->model_pdf : $conf->global->CONTRACT_ADDON_PDF), 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang, '', $object); // Show links to link elements @@ -2168,7 +2168,7 @@ if ($action == 'create') // Presend form $modelmail = 'contract'; $defaulttopic = 'SendContractRef'; - $diroutput = $conf->contrat->dir_output; + $diroutput = $conf->contrat->multidir_output[$object->entity]; $trackid = 'con'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 36edee80669..7c99a9483b9 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1296,7 +1296,7 @@ class Contrat extends CommonObject $ref = dol_sanitizeFileName($this->ref); if ($conf->contrat->dir_output) { - $dir = $conf->contrat->dir_output."/".$ref; + $dir = $conf->contrat->multidir_output[$this->entity]."/".$ref; if (file_exists($dir)) { $res = @dol_delete_dir_recursive($dir); diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index b68da3170ed..ba15af0de19 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -74,7 +74,7 @@ if ($object->id > 0) $object->fetch_thirdparty(); } -$upload_dir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($object->ref); +$upload_dir = $conf->contrat->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); $modulepart = 'contract'; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 1226d578f2f..a890b1f3ce2 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -204,7 +204,7 @@ $formcompany = new FormCompany($db); $contracttmp = new Contrat($db); $sql = 'SELECT'; -$sql .= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,"; +$sql .= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,"; $sql .= ' s.rowid as socid, s.nom as name, s.name_alias, s.email, s.town, s.zip, s.fk_pays as country_id, s.client, s.code_client, s.status as company_status, s.logo as company_logo,'; $sql .= " typent.code as typent_code,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; @@ -260,7 +260,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql .= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,"; +$sql .= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,"; $sql .= ' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.status, s.logo,'; $sql .= " typent.code,"; $sql .= " state.code_departement, state.nom"; @@ -644,7 +644,7 @@ while ($i < min($num, $limit)) } $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($obj->ref); + $filedir = $conf->contrat->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref); $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($contracttmp->element, $filename, $filedir); print ''; diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 95c5037c5fb..4fa506a23f4 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1097,6 +1097,7 @@ if ($action == 'remove_file') $action = ''; } + // Validate records if (!$error && $massaction == 'validate' && $permissiontoadd) { diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 53be2725680..f09a80f0227 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -135,7 +135,7 @@ class box_comptes extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right nowraponall"', - 'text' => price($solde, 0, $langs, 0, -1, -1, $objp->currency_code) + 'text' => price($solde, 0, $langs, 1, -1, -1, $objp->currency_code) ); $line++; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 045ab92f08e..db436574086 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -839,7 +839,7 @@ class ExtraFields $array_name_label = array(); // We should not have several time this request. If we have, there is some optimization to do by calling a simple $extrafields->fetch_optionals() in top of code and not into subcode - $sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,printable,totalizable,fielddefault,fieldcomputed,entity,enabled,help"; + $sql = "SELECT rowid, name, label, type, size, elementtype, fieldunique, fieldrequired, param, pos, alwayseditable, perms, langs, list, printable, totalizable, fielddefault, fieldcomputed, entity, enabled, help"; $sql .= " FROM ".MAIN_DB_PREFIX."extrafields"; //$sql.= " WHERE entity IN (0,".$conf->entity.")"; // Filter is done later if ($elementtype) $sql .= " WHERE elementtype = '".$this->db->escape($elementtype)."'"; // Filed with object->table_element diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 9ecd6a659a1..f1577496f8b 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -248,7 +248,7 @@ class HookManager $actionclassinstance->error = 0; $actionclassinstance->errors = array(); - dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", action=".$action." context=".$context, LOG_DEBUG); + dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".get_class($actionclassinstance).'->'.$method.", context=".$context.", module=".$module.", action=".$action.((is_object($object) && property_exists($object, 'id')) ? ', objectid='.$object->id : ''), LOG_DEBUG); // Add current context to avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; $parameters['currentcontext'] = $context; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a4a905d256d..b442345199f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -253,9 +253,9 @@ class Form if (empty($notabletag)) $ret .= ''; //else $ret.='
'; - $ret .= ''; + $ret .= ''; if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) $ret .= '
'."\n"; - $ret .= ''; + $ret .= ''; if (empty($notabletag)) $ret .= ''; if (empty($notabletag)) $ret .= ''."\n"; @@ -672,7 +672,7 @@ class Form // Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button $ret .= ''; // Hidden button BEFORE so it is the one used when we submit with ENTER. - $ret .= ''; + $ret .= 'use_javascript_ajax) ? '' : ' style="display: none"').' class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">'; $ret .= '
'; if (!empty($conf->use_javascript_ajax)) @@ -984,6 +984,7 @@ class Form print '>'.$langs->trans("Service"); print ''; + print ajax_combobox('select_'.$htmlname); //if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } if ((empty($forceall) && empty($conf->product->enabled) && !empty($conf->service->enabled)) || $forceall == 3) @@ -2753,9 +2754,10 @@ class Form * @param int $hidelabel Hide label (0=no, 1=yes) * @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices * @param string $morecss More CSS + * @param string $placeholder Placeholder * @return void */ - public function select_produits_fournisseurs($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $ajaxoptions = array(), $hidelabel = 0, $alsoproductwithnosupplierprice = 0, $morecss = '') + public function select_produits_fournisseurs($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $ajaxoptions = array(), $hidelabel = 0, $alsoproductwithnosupplierprice = 0, $morecss = '', $placeholder = '') { // phpcs:enable global $langs, $conf; @@ -2776,9 +2778,9 @@ class Form // mode=2 means suppliers products $urloption = ($socid > 0 ? 'socid='.$socid.'&' : '').'htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=2&status='.$status.'&finished='.$finished.'&alsoproductwithnosupplierprice='.$alsoproductwithnosupplierprice; print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/product/ajax/products.php', $urloption, $conf->global->PRODUIT_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); - print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').''; + print ($hidelabel ? '' : $langs->trans("RefOrLabel").' : ').''; } else { - print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', -1, 0, 0, $alsoproductwithnosupplierprice, $morecss); + print $this->select_produits_fournisseurs_list($socid, $selected, $htmlname, $filtertype, $filtre, '', -1, 0, 0, $alsoproductwithnosupplierprice, $morecss, 0, $placeholder); } } @@ -2798,9 +2800,10 @@ class Form * @param int $alsoproductwithnosupplierprice 1=Add also product without supplier prices * @param string $morecss Add more CSS * @param int $showstockinlist Show stock information (slower). + * @param string $placeholder Placeholder * @return array Array of keys for json */ - public function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '', $showstockinlist = 0) + public function select_produits_fournisseurs_list($socid, $selected = '', $htmlname = 'productid', $filtertype = '', $filtre = '', $filterkey = '', $statut = -1, $outputmode = 0, $limit = 100, $alsoproductwithnosupplierprice = 0, $morecss = '', $showstockinlist = 0, $placeholder = '') { // phpcs:enable global $langs, $conf, $db, $user; @@ -2884,9 +2887,9 @@ class Form $num = $this->db->num_rows($result); //$out.=''; - if (!$selected) $out .= ''; - else $out .= ''; + $out .= ''; print ''; + print img_picto('', 'bank_account', 'class="pictofixedwidth"'); $nbaccountfound = $this->select_comptes($selected, $htmlname, 0, '', $addempty); if ($nbaccountfound > 0) print ''; print ''; @@ -4362,14 +4366,11 @@ class Form $moreattr = (!empty($input['moreattr']) ? ' '.$input['moreattr'] : ''); $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); - if ($input['type'] == 'text') - { + if ($input['type'] == 'text') { $more .= '
'.$input['label'].'
'."\n"; - } elseif ($input['type'] == 'password') - { + } elseif ($input['type'] == 'password') { $more .= '
'.$input['label'].'
'."\n"; - } elseif ($input['type'] == 'select') - { + } elseif ($input['type'] == 'select') { if (empty($morecss)) { $morecss = 'minwidth100'; } @@ -4377,8 +4378,7 @@ class Form if (!empty($input['label'])) $more .= $input['label'].'
'; $more .= $this->selectarray($input['name'], $input['values'], $input['default'], 1, 0, 0, $moreattr, 0, 0, 0, '', $morecss); $more .= '
'."\n"; - } elseif ($input['type'] == 'checkbox') - { + } elseif ($input['type'] == 'checkbox') { $more .= '
'; $more .= '
'.$input['label'].'
'; $more .= ' $selval) { @@ -4403,8 +4402,7 @@ class Form $more .= '
'."\n"; $i++; } - } elseif ($input['type'] == 'date') - { + } elseif ($input['type'] == 'date') { $more .= '
'.$input['label'].'
'; $more .= '
'; $more .= $this->selectDate($input['value'], $input['name'], 0, 0, 0, '', 1, 0); @@ -4414,17 +4412,17 @@ class Form $formquestion[] = array('name'=>$input['name'].'year'); $formquestion[] = array('name'=>$input['name'].'hour'); $formquestion[] = array('name'=>$input['name'].'min'); - } elseif ($input['type'] == 'other') - { + } elseif ($input['type'] == 'other') { $more .= '
'; if (!empty($input['label'])) $more .= $input['label'].'
'; $more .= $input['value']; $more .= '
'."\n"; - } elseif ($input['type'] == 'onecolumn') - { + } elseif ($input['type'] == 'onecolumn') { $moreonecolumn .= '
'; $moreonecolumn .= $input['value']; $moreonecolumn .= '
'."\n"; + } elseif ($input['type'] == 'hidden') { + // Do nothing more, already added by a previous loop } else { $more .= 'Error type '.$input['type'].' for the confirm box is not a supported type'; } @@ -6303,7 +6301,7 @@ class Form */ public function selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled = 0) { - global $conf, $langs, $user; + global $conf, $langs, $user, $hookmanager; //print "$objecttmp->filter, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $outputmode = 0, $disabled"; @@ -6349,27 +6347,34 @@ class Form } if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql .= " WHERE 1=1"; - if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; - if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) { - $sql .= ' AND parenttable.entity = t.'.$tmparray[0]; - } - if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { - if ($objecttmp->element == 'societe') $sql .= " AND t.rowid = ".$user->socid; - else $sql .= " AND t.fk_soc = ".$user->socid; - } - if ($searchkey != '') $sql .= natural_search(explode(',', $fieldstoshow), $searchkey); - if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { - if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; - } - if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" - /*if (! DolibarrApi::_checkFilters($objecttmp->filter)) - { - throw new RestException(503, 'Error when validating parameter sqlfilters '.$objecttmp->filter); - }*/ - $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; - $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'Form::forgeCriteriaCallback', $objecttmp->filter).")"; - } + + // Add where from hooks + $parameters = array(); + $reshook = $hookmanager->executeHooks('selectForFormsListWhere', $parameters); // Note that $action and $object may have been modified by hook + if (!empty($hookmanager->resPrint)) $sql .= $hookmanager->resPrint; + else { + $sql .= " WHERE 1=1"; + if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) $sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")"; + if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) { + $sql .= ' AND parenttable.entity = t.'.$tmparray[0]; + } + if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) { + if ($objecttmp->element == 'societe') $sql .= " AND t.rowid = ".$user->socid; + else $sql .= " AND t.fk_soc = ".$user->socid; + } + if ($searchkey != '') $sql .= natural_search(explode(',', $fieldstoshow), $searchkey); + if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') { + if (!$user->rights->societe->client->voir && !$user->socid) $sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; + } + if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')" + /*if (! DolibarrApi::_checkFilters($objecttmp->filter)) + { + throw new RestException(503, 'Error when validating parameter sqlfilters '.$objecttmp->filter); + }*/ + $regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)'; + $sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'Form::forgeCriteriaCallback', $objecttmp->filter).")"; + } + } $sql .= $this->db->order($fieldstoshow, "ASC"); //$sql.=$this->db->plimit($limit, 0); //print $sql; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index bfd5a6f64f7..f12b16211ae 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -355,7 +355,7 @@ class FormActions if (!is_array($selected) && !empty($selected)) $selected = explode(',', $selected); $out .= $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0); } else { - $out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200'.($morecss ? ' '.$morecss : ''), 1); + $out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth300'.($morecss ? ' '.$morecss : ''), 1); } if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0) diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index 3e8eb04c430..36af8bfa875 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -77,7 +77,7 @@ class FormAdmin if ($showempty && !$multiselect) { $out .= ''; } @@ -115,7 +115,7 @@ class FormAdmin } $valuetoshow .= ' '.picto_from_langcode($key, 'class="saturatemedium"'); - if ($selected == $keytouse) { + if ((string) $selected == (string) $keytouse) { $out .= ''; } else { $out .= ''; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index c9c895148bf..c53bc1a0750 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -450,7 +450,7 @@ class FormFile if ($modulepart == 'company') { - $showempty = 1; + $showempty = 1; // can have no template active if (is_array($genallowed)) $modellist = $genallowed; else { include_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php'; @@ -514,6 +514,7 @@ class FormFile } } elseif ($modulepart == 'contract') { + $showempty = 1; // can have no template active if (is_array($genallowed)) $modellist = $genallowed; else { include_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; @@ -577,6 +578,7 @@ class FormFile } } elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') { + $showempty = 1; // can have no template active if (is_array($genallowed)) $modellist = $genallowed; else { include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index ac9285363d7..a706d9a880e 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -113,7 +113,12 @@ class Translate } else $srclang = strtolower($langpart[0])."_".strtoupper($langpart[0]); } else { // If it's for a codetouse that is a short code xx // Array to convert short lang code into long code. - $longforshort = array('ar'=>'ar_SA', 'el'=>'el_GR', 'ca'=>'ca_ES', 'en'=>'en_US', 'ja'=>'ja_JP', 'nb'=>'nb_NO', 'no'=>'nb_NO'); + $longforshort = array( + 'am'=>'am_ET', 'ar'=>'ar_SA', 'bn'=>'bn_DB', 'el'=>'el_GR', 'ca'=>'ca_ES', 'cs'=>'cs_CZ', 'en'=>'en_US', 'fa'=>'fa_IR', + 'gl'=>'gl_ES', 'he'=>'he_IL', 'hi'=>'hi_IN', 'ja'=>'ja_JP', + 'ka'=>'ka_GE', 'km'=>'km_KH', 'kn'=>'kn_IN', 'ko'=>'ko_KR', 'lo'=>'lo_LA', 'nb'=>'nb_NO', 'no'=>'nb_NO', 'ne'=>'ne_NP', + 'sl'=>'sl_SI', 'sq'=>'sq_AL', 'sr'=>'sr_RS', 'sv'=>'sv_SE', 'uk'=>'uk_UA', 'vi'=>'vi_VN', 'zh'=>'zh_CN' + ); if (isset($longforshort[strtolower($langpart[0])])) $srclang = $longforshort[strtolower($langpart[0])]; elseif (!empty($langpart[0])) $srclang = strtolower($langpart[0])."_".strtoupper($langpart[0]); else $srclang = 'en_US'; diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index e35fefdad6f..9cf8439483a 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -62,13 +62,16 @@ class Utils require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - if (empty($choices)) $choices = 'tempfilesold,logfiles'; + if (empty($choices)) { + $choices = 'tempfilesold+logfiles'; + } dol_syslog("Utils::purgeFiles choice=".$choices, LOG_DEBUG); $count = 0; $countdeleted = 0; $counterror = 0; + $filelog = ''; $choicesarray = preg_split('/[\+,]/', $choices); foreach ($choicesarray as $choice) { @@ -109,7 +112,6 @@ class Utils $filesarray = dol_dir_list($dolibarr_main_data_root, "files", 0, '.*\.log[\.0-9]*(\.gz)?$', 'install\.lock$', 'name', SORT_ASC, 0, 0, '', 1); } - $filelog = ''; if (!empty($conf->syslog->enabled)) { $filelog = $conf->global->SYSLOG_FILE; @@ -143,8 +145,7 @@ class Utils if ($filesarray[$key]['fullname'] != $filelog || $choice == 'logfile' || $choice == 'logfiles') { $result = dol_delete_file($filesarray[$key]['fullname'], 1, 1); - if ($result) - { + if ($result) { $count++; $countdeleted++; } else { @@ -166,7 +167,9 @@ class Utils if ($count > 0) { $this->output = $langs->trans("PurgeNDirectoriesDeleted", $countdeleted); - if ($count > $countdeleted) $this->output .= '
'.$langs->trans("PurgeNDirectoriesFailed", ($count - $countdeleted)); + if ($count > $countdeleted) { + $this->output .= '
'.$langs->trans("PurgeNDirectoriesFailed", ($count - $countdeleted)); + } } else { $this->output = $langs->trans("PurgeNothingToDelete").(in_array('tempfilesold', $choicesarray) ? ' (older than 24h for temp files)' : ''); } diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 739035f71a5..8e71f8255e8 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -137,9 +137,10 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen update: update, textarea: textarea, pbq: item.pbq, type: item.type, qty: item.qty, discount: item.discount, - pricebasetype: item.pricebasetype, price_ht: item.price_ht, + pricebasetype: item.pricebasetype, + price_ht: item.price_ht, price_ttc: item.price_ttc, - up: item.up, description : item.description, + description : item.description, ref_customer: item.ref_customer } })); } @@ -152,32 +153,24 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen console.log("We will trigger change on input '.$htmlname.' because of the select definition of autocomplete code for input#search_'.$htmlname.'"); console.log("Selected id = "+ui.item.id+" - If this value is null, it means you select a record with key that is null so selection is not effective"); - console.log("Propagate before some properties"); + console.log("Propagate before some properties retrieved by ajax into data-xxx properties"); - //console.log(ui.item); - //For supplier price - $("#'.$htmlname.'").attr("data-up", ui.item.up); - $("#'.$htmlname.'").attr("data-discount", ui.item.discount); + // For supplier price and customer when price by quantity is off + $("#'.$htmlname.'").attr("data-up", ui.item.price_ht); + $("#'.$htmlname.'").attr("data-base", ui.item.pricebasetype); $("#'.$htmlname.'").attr("data-qty", ui.item.qty); + $("#'.$htmlname.'").attr("data-discount", ui.item.discount); $("#'.$htmlname.'").attr("data-description", ui.item.description); $("#'.$htmlname.'").attr("data-ref-customer", ui.item.ref_customer); - - //For customer price - '; + '; if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) { $script .= ' - $("#' . $htmlname . '").attr("data-pbq", ui.item.pbq); - $("#' . $htmlname . '").attr("data-pbqup", ui.item.price_ht); - $("#' . $htmlname . '").attr("data-pbqbase", ui.item.pricebasetype); - $("#' . $htmlname . '").attr("data-pbqqty", ui.item.qty); - $("#' . $htmlname . '").attr("data-pbqpercent", ui.item.discount); - '; - } else { - $script .= ' - $("#' . $htmlname . '").attr("data-up", ui.item.price_ht); - $("#' . $htmlname . '").attr("data-base", ui.item.pricebasetype); - $("#' . $htmlname . '").attr("data-qty", ui.item.qty); - $("#' . $htmlname . '").attr("data-discount", ui.item.discount); + // For customer price when PRODUIT_CUSTOMER_PRICES_BY_QTY is on + $("#'.$htmlname.'").attr("data-pbq", ui.item.pbq); + $("#'.$htmlname.'").attr("data-pbqup", ui.item.price_ht); + $("#'.$htmlname.'").attr("data-pbqbase", ui.item.pricebasetype); + $("#'.$htmlname.'").attr("data-pbqqty", ui.item.qty); + $("#'.$htmlname.'").attr("data-pbqpercent", ui.item.discount); '; } $script .= ' @@ -217,6 +210,7 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption = '', $minLen console.log("Make action update on each ui.item.update") // loop on each "update" fields $.each(ui.item.update, function(key, value) { + console.log("Set value "+value+" into #"+key); $("#" + key).val(value).trigger("change"); }); } diff --git a/htdocs/core/lib/contract.lib.php b/htdocs/core/lib/contract.lib.php index c72c46c8916..10f8d37a3c8 100644 --- a/htdocs/core/lib/contract.lib.php +++ b/htdocs/core/lib/contract.lib.php @@ -70,7 +70,7 @@ function contract_prepare_head(Contrat $object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->contrat->dir_output."/".dol_sanitizeFileName($object->ref); + $upload_dir = $conf->contrat->multidir_output[$object->entity]."/".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.'/contrat/document.php?id='.$object->id; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 1bdaeef13ef..14701d57256 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1192,6 +1192,16 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, { if ($nophperrors) $ok = @unlink($filename); else $ok = unlink($filename); + + // If it fails and it is because of the missing write permission on parent dir + if (!$ok && file_exists(dirname($filename)) && !(fileperms(dirname($filename)) & 0200)) { + dol_syslog("Error in deletion, but parent directory exists with no permission to write, we try to change permission on parent directory and retry...", LOG_DEBUG); + @chmod(dirname($filename), fileperms(dirname($filename)) | 0200); + // Now we retry deletion + if ($nophperrors) $ok = @unlink($filename); + else $ok = unlink($filename); + } + if ($ok) { dol_syslog("Removed file ".$filename, LOG_DEBUG); @@ -2316,10 +2326,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->rights->ficheinter->{$lire}) $accessallowed = 1; $original_file = $conf->ficheinter->dir_output.'/'.$original_file; } // Wrapping pour les apercu conat - elseif (($modulepart == 'apercucontract') && !empty($conf->contrat->dir_output)) + elseif (($modulepart == 'apercucontract') && !empty($conf->contrat->multidir_output[$entity])) { if ($fuser->rights->contrat->{$lire}) $accessallowed = 1; - $original_file = $conf->contrat->dir_output.'/'.$original_file; + $original_file = $conf->contrat->multidir_output[$entity].'/'.$original_file; } // Wrapping pour les apercu supplier proposal elseif (($modulepart == 'apercusupplier_proposal' || $modulepart == 'apercusupplier_proposal') && !empty($conf->supplier_proposal->dir_output)) { @@ -2709,13 +2719,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } if (!empty($conf->stock->enabled)) $original_file = $conf->stock->multidir_output[$entity].'/movement/'.$original_file; } // Wrapping pour les contrats - elseif ($modulepart == 'contract' && !empty($conf->contrat->dir_output)) + elseif ($modulepart == 'contract' && !empty($conf->contrat->multidir_output[$entity])) { if ($fuser->rights->contrat->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->contrat->dir_output.'/'.$original_file; + $original_file = $conf->contrat->multidir_output[$entity].'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."contrat WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('contract').")"; } // Wrapping pour les dons elseif ($modulepart == 'donation' && !empty($conf->don->dir_output)) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d328d4ae693..b22caec4633 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3232,7 +3232,7 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) - * @param string $moreatt Add more attribute on img tag (For example 'style="float: right"') + * @param string $moreatt Add more attribute on img tag (For example 'class="pictofixedwidth"') * @param boolean|int $pictoisfullpath If true or 1, image path is a full path * @param int $srconly Return only content of the src attribute of img. * @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip. @@ -3265,7 +3265,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto); if (empty($srconly) && in_array($pictowithouttext, array( '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', - 'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building', + 'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building', 'cash-register', 'category', 'check', 'clock', 'close_title', 'cog', 'company', 'contact', 'contract', 'cron', 'cubes', 'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'external-link-alt', 'external-link-square-alt', 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group', @@ -3273,11 +3273,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'intervention', 'label', 'language', 'link', 'list', 'listlight', 'loan', 'lot', 'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'mrp', 'note', 'next', 'object_accounting', 'object_account', 'object_accountline', 'object_action', 'object_barcode', 'object_bill', 'object_billa', 'object_billd', 'object_bom', - 'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', + 'object_category', 'object_conversation', 'object_bookmark', 'object_bug', 'object_clock', 'object_dolly', 'object_dollyrevert', + 'object_folder', 'object_folder-open','object_generic', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', 'object_cash-register', 'object_company', 'object_contact', 'object_contract', 'object_donation', 'object_dynamicprice', 'object_globe', 'object_holiday', 'object_hrm', 'object_invoice', 'object_intervention', 'object_label', - 'object_margin', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment', + 'object_margin', 'object_members', 'object_money-bill-alt', 'object_multicurrency', 'object_order', 'object_payment', 'object_lot', 'object_mrp', 'object_other', 'object_payment', 'object_pdf', 'object_product', 'object_propal', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask', @@ -3291,7 +3292,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies', 'generic', 'home', 'hrm', 'members', 'products', 'invoicing', - 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'refresh', 'salary', 'supplier_invoice', 'ticket', + 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket', 'error', 'warning', 'recruitmentcandidature', 'recruitmentjobposition', 'resource', 'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'user-cog', @@ -3318,11 +3319,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'company'=>'building', 'contact'=>'address-book', 'contract'=>'suitcase', 'conversation'=>'comments', 'donation'=>'file-alt', 'dynamicprice'=>'hand-holding-usd', 'setup'=>'cog', 'companies'=>'building', 'products'=>'cube', 'commercial'=>'suitcase', 'invoicing'=>'coins', 'accounting'=>'chart-line', 'category'=>'tag', 'dollyrevert'=>'dolly', - 'hrm'=>'user-tie', 'margin'=>'calculator', 'members'=>'users', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', + 'hrm'=>'user-tie', 'margin'=>'calculator', 'members'=>'user-friends', 'ticket'=>'ticket-alt', 'globe'=>'external-link-alt', 'lot'=>'barcode', 'email'=>'at', 'edit'=>'pencil-alt', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle', 'generic'=>'file', 'holiday'=>'umbrella-beach', 'label'=>'layer-group', 'loan'=>'money-bill-alt', - 'member'=>'users', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right', + 'member'=>'user-alt', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right', 'trip'=>'wallet', 'group'=>'users', 'movement'=>'people-carry', 'sign-out'=>'sign-out-alt', 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star', @@ -3370,11 +3371,14 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $fakey = 'fa-'.$pictowithouttext; } - if (in_array($pictowithouttext, array('member', 'contract'))) { - $fasize = '0.92em'; + if (in_array($pictowithouttext, array('holiday', 'dollyrevert', 'member', 'members', 'contract', 'group', 'resource', 'shipment'))) { + $morecss = 'em092'; } - if (in_array($pictowithouttext, array('intervention', 'payment', 'loan'))) { - $fasize = '0.80em'; + if (in_array($pictowithouttext, array('holiday'))) { + $morecss = 'em088'; + } + if (in_array($pictowithouttext, array('intervention', 'payment', 'loan', 'stock', 'technic'))) { + $morecss = 'em080'; } // Define $marginleftonlyshort @@ -3423,7 +3427,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'movement'=>'#a69944', 'other'=>'#ddd', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba', - 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'user-cog'=>'#999', 'globe-americas'=>'#aaa', + 'shipment'=>'#a69944', 'stats'=>'#444', 'switch_off'=>'#999', 'technic'=>'#999', 'uparrow'=>'#555', 'user-cog'=>'#999', 'globe-americas'=>'#aaa', 'website'=>'#304' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { @@ -7873,7 +7877,10 @@ function printCommonFooter($zone = 'private') // Add property 'required' on input print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; print 'jQuery("textarea[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; - print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr + print '// required on a select works only if key is "", so we add the required attributes but also we reset the key -1 or 0 to an empty string'."\n"; + print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; + print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'-1\']").prop(\'value\', \'\');'."\n"; + print 'jQuery("select[name=\''.$paramkey.'\'] option[value=\'0\']").prop(\'value\', \'\');'."\n"; } } } @@ -8202,7 +8209,7 @@ function showDirectDownloadLink($object) if ($url) { - $out .= img_picto('', 'globe').' '.$langs->trans("DirectDownloadLink").'
'; + $out .= img_picto($langs->trans("PublicDownloadLinkdesc"), 'globe').' '.$langs->trans("DirectDownloadLink").'
'; $out .= ''; $out .= ajax_autoselect("directdownloadlink", 0); } diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 453bc34be8a..eda1a901986 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -189,7 +189,7 @@ function invoice_rec_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/compta/facture/card-rec.php?id='.$object->id; - $head[$h][1] = $langs->trans("CardBill"); + $head[$h][1] = $langs->trans("RepeatableInvoice"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 2f1e3d5596b..4602e877bd1 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -590,9 +590,9 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " WHERE dbt.rowid IN (".$objectid.")"; $sql .= " AND dbt.".$dbt_keyfield." = ".$user->socid; - } elseif (!empty($conf->societe->enabled)) { + } elseif (!empty($conf->societe->enabled) && !$user->rights->societe->client->voir) { // If internal user: Check permission for internal users that are restricted on their objects - if ($feature != 'ticket' && !$user->rights->societe->client->voir) { + if ($feature != 'ticket') { if (empty($dbt_keyfield)) dol_print_error('', 'Param dbt_keyfield is required but not defined'); $sql = "SELECT COUNT(sc.fk_soc) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; @@ -601,9 +601,8 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand $sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")"; $sql .= " AND sc.fk_soc = dbt.".$dbt_keyfield; $sql .= " AND sc.fk_user = ".$user->id; - } - // On ticket, the thirdparty is not mandatory, so we need a special test to accept record with no thirdparties. - if ($feature == 'ticket' && !$user->rights->societe->client->voir) { + } else { + // On ticket, the thirdparty is not mandatory, so we need a special test to accept record with no thirdparties. $sql = "SELECT COUNT(dbt.".$dbt_select.") as nb"; $sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON sc.fk_soc = dbt.".$dbt_keyfield." AND sc.fk_user = ".$user->id; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index eb1b965f555..4135c26c7c0 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -696,6 +696,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $substitarray = getCommonSubstitutionArray($langs, 0, null, null); + $listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL); + /** * We update newmenu with entries found into database * -------------------------------------------------- @@ -1534,7 +1536,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if ($mainmenu == 'products') { // Products if (!empty($conf->product->enabled)) { - $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product'); + $newmenu->add("/product/index.php?leftmenu=product&type=0", $langs->trans("Products"), 0, $user->rights->produit->lire, '', $mainmenu, 'product', 0, '', '', '', img_picto('', 'product', 'class="pictofixedwidth"')); $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer); $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire); if (!empty($conf->stock->enabled)) { @@ -1562,7 +1564,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Services if (!empty($conf->service->enabled)) { - $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service'); + $newmenu->add("/product/index.php?leftmenu=service&type=1", $langs->trans("Services"), 0, $user->rights->service->lire, '', $mainmenu, 'service', 0, '', '', '', img_picto('', 'service', 'class="pictofixedwidth"')); $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); if (!empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->facture->enabled) || !empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) { @@ -1579,7 +1581,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Warehouse if (!empty($conf->stock->enabled)) { $langs->load("stocks"); - $newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); + $newmenu->add("/product/stock/index.php?leftmenu=stock", $langs->trans("Warehouses"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'stock', 'class="pictofixedwidth"')); $newmenu->add("/product/stock/card.php?action=create", $langs->trans("MenuNewWarehouse"), 1, $user->rights->stock->creer); $newmenu->add("/product/stock/list.php", $langs->trans("List"), 1, $user->rights->stock->lire); $newmenu->add("/product/stock/movement_list.php", $langs->trans("Movements"), 1, $user->rights->stock->mouvement->lire); @@ -1601,7 +1603,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->stock->enabled)) { $langs->load("stocks"); if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { - $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock'); + $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("Inventories"), 0, $user->rights->stock->lire, '', $mainmenu, 'stock', 0, '', '', '', img_picto('', 'inventory', 'class="pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || $leftmenu == "stock_inventories") { $newmenu->add("/product/inventory/card.php?action=create&leftmenu=stock_inventories", $langs->trans("NewInventory"), 1, $user->rights->stock->creer); $newmenu->add("/product/inventory/list.php?leftmenu=stock_inventories", $langs->trans("List"), 1, $user->rights->stock->lire); @@ -1619,7 +1621,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Shipments if (!empty($conf->expedition->enabled)) { $langs->load("sendings"); - $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings'); + $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->rights->expedition->lire, '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="pictofixedwidth"')); $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->rights->expedition->creer); $newmenu->add("/expedition/list.php?leftmenu=sendings", $langs->trans("List"), 1, $user->rights->expedition->lire); if ($usemenuhider || empty($leftmenu) || $leftmenu == "sendings") { @@ -1633,7 +1635,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Receptions if (!empty($conf->reception->enabled)) { $langs->load("receptions"); - $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions'); + $newmenu->add("/reception/index.php?leftmenu=receptions", $langs->trans("Receptions"), 0, $user->rights->reception->lire, '', $mainmenu, 'receptions', 0, '', '', '', img_picto('', 'dollyrevert', 'class="pictofixedwidth"')); $newmenu->add("/reception/card.php?action=create2&leftmenu=receptions", $langs->trans("NewReception"), 1, $user->rights->reception->creer); $newmenu->add("/reception/list.php?leftmenu=receptions", $langs->trans("List"), 1, $user->rights->reception->lire); if ($usemenuhider || empty($leftmenu) || $leftmenu == "receptions") { @@ -1699,7 +1701,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM } // Project assigned to user - $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects'); + $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="pictofixedwidth"')); $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer); if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) { @@ -1722,7 +1724,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (empty($conf->global->PROJECT_HIDE_TASKS)) { // Project affected to user - $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire, '', 'project', 'tasks'); + $newmenu->add("/projet/activity/index.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("Activities"), 0, $user->rights->projet->lire, '', 'project', 'tasks', 0, '', '', '', img_picto('', 'task', 'class="pictofixedwidth"')); $newmenu->add("/projet/tasks.php?leftmenu=tasks&action=create", $langs->trans("NewTask"), 1, $user->rights->projet->creer); $newmenu->add("/projet/tasks/list.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire); $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); @@ -1740,7 +1742,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->hrm->enabled)) { $langs->load("hrm"); - $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm'); + $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee", $langs->trans("Employees"), 0, $user->rights->hrm->employee->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'user', 'class="pictofixedwidth"')); $newmenu->add("/user/card.php?mainmenu=hrm&leftmenu=hrm&action=create&employee=1", $langs->trans("NewEmployee"), 1, $user->rights->hrm->employee->write); $newmenu->add("/user/list.php?mainmenu=hrm&leftmenu=hrm&mode=employee&contextpage=employeelist", $langs->trans("List"), 1, $user->rights->hrm->employee->read); } @@ -1750,7 +1752,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM // Load translation files required by the page $langs->loadLangs(array("holiday", "trips")); - $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm'); + $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'holiday', 'class="pictofixedwidth"')); $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->rights->holiday->write); $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read); if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm") { @@ -1820,14 +1822,14 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM if (!empty($conf->export->enabled)) { $langs->load("exports"); - $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export'); + $newmenu->add("/exports/index.php?leftmenu=export", $langs->trans("FormatedExport"), 0, $user->rights->export->lire, '', $mainmenu, 'export', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); $newmenu->add("/exports/export.php?leftmenu=export", $langs->trans("NewExport"), 1, $user->rights->export->creer); //$newmenu->add("/exports/export.php?leftmenu=export",$langs->trans("List"),1, $user->rights->export->lire); } if (!empty($conf->import->enabled)) { $langs->load("exports"); - $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import'); + $newmenu->add("/imports/index.php?leftmenu=import", $langs->trans("FormatedImport"), 0, $user->rights->import->run, '', $mainmenu, 'import', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"')); $newmenu->add("/imports/import.php?leftmenu=import", $langs->trans("NewImport"), 1, $user->rights->import->run); } } @@ -1861,7 +1863,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM $newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); } - $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Subscriptions"), 0, $user->rights->adherent->cotisation->lire); + $newmenu->add("/adherents/index.php?leftmenu=members&mainmenu=members", $langs->trans("Subscriptions"), 0, $user->rights->adherent->cotisation->lire, '', $mainmenu, 'members', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); $newmenu->add("/adherents/list.php?leftmenu=members&statut=-1,1&mainmenu=members", $langs->trans("NewSubscription"), 1, $user->rights->adherent->cotisation->creer); $newmenu->add("/adherents/subscription/list.php?leftmenu=members", $langs->trans("List"), 1, $user->rights->adherent->cotisation->lire); $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->rights->adherent->lire); @@ -1870,7 +1872,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM //if (! empty($conf->export->enabled) && ($usemenuhider || empty($leftmenu) || $leftmenu=="export")) $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); // Type - $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("MembersTypes"), 0, $user->rights->adherent->configurer, '', $mainmenu, 'setup'); + $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("MembersTypes"), 0, $user->rights->adherent->configurer, '', $mainmenu, 'setup', 0, '', '', '', img_picto('', 'members', 'class="paddingright pictofixedwidth"')); $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members&action=create", $langs->trans("New"), 1, $user->rights->adherent->configurer); $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members", $langs->trans("List"), 1, $user->rights->adherent->configurer); } diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 485b079d1cd..f3078516080 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -357,8 +357,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it * * @param array $array_sql SQL requests to be executed when enabling module * @param string $options String with options when disabling module: - * - 'noboxes' = Do not insert boxes - * - 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation + * - 'noboxes' = Do all actions but do not insert boxes + * - 'newboxdefonly' = Do all actions but for boxes, insert def of boxes only and not boxes activation * @return int 1 if OK, 0 if KO */ protected function _init($array_sql, $options = '') @@ -389,7 +389,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $err += $this->insert_const(); // Test on newboxdefonly to avoid to erase value during upgrade } - // Insert boxes def into llx_boxes_def and boxes setup (into llx_boxes) + // Insert boxes def (into llx_boxes_def) and boxes setup (into llx_boxes) if (!$err && !preg_match('/noboxes/', $options)) { $err += $this->insert_boxes($options); } @@ -1815,7 +1815,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it // phpcs:enable global $user; - if (!is_array($this->menu) || empty($this->menu)) { return 0; + if (!is_array($this->menu) || empty($this->menu)) { + return 0; } include_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php'; @@ -2172,9 +2173,8 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it * The init function adds tabs, constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * It also creates data directories * - * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes') - * 'noboxes' = Do not insert boxes 'newboxdefonly' = For boxes, - * insert def of boxes only and not boxes activation + * @param string $options Options when enabling module ('', 'newboxdefonly', 'noboxes', 'menuonly') + * 'noboxes' = Do not insert boxes 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation * @return int 1 if OK, 0 if KO */ public function init($options = '') diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index f02f04728cd..8d17f9759fb 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -712,7 +712,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L'); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 3daa5288d7e..c7d83ebbaf7 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -930,7 +930,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L'); diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index edad675857f..bc6274482c4 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -219,7 +219,7 @@ class doc_generic_contract_odt extends ModelePDFContract // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "bills")); - if ($conf->contrat->dir_output) + if ($conf->contrat->multidir_output[$object->entity]) { // If $object is id instead of object if (!is_object($object)) @@ -236,7 +236,7 @@ class doc_generic_contract_odt extends ModelePDFContract $object->fetch_thirdparty(); - $dir = $conf->contrat->dir_output; + $dir = $conf->contrat->multidir_output[$object->entity]; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) $dir .= "/".$objectref; $file = $dir."/".$objectref.".odt"; diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 619dcdf84d3..877bf19f3a9 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -201,7 +201,7 @@ class pdf_strato extends ModelePDFContract $file = $dir."/SPECIMEN.pdf"; } else { $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->contrat->dir_output."/".$objectref; + $dir = $conf->contrat->multidir_output[$object->entity]."/".$objectref; $file = $dir."/".$objectref.".pdf"; } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index ce44aac0319..9e336863467 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1004,7 +1004,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L'); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 0edcdec536b..aafbb192bce 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1108,7 +1108,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L'); diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index 847200adc4f..b97dce7157b 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -58,7 +58,7 @@ class modECM extends DolibarrModules // Key used in llx_const table to save module status enabled/disabled (XXX is id value) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); // Name of png file (without png) used for this module - $this->picto = 'folder'; + $this->picto = 'folder-open'; // Data directories to create when module is enabled $this->dirs = array("/ecm/temp"); diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 7a72d3967e0..5887fac8577 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -188,7 +188,7 @@ class modResource extends DolibarrModules 'fk_menu'=>'fk_mainmenu=tools', 'type'=>'left', 'titre'=> 'MenuResourceIndex', - 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em92"'), 'mainmenu'=>'tools', 'leftmenu'=> 'resource', 'url'=> '/resource/list.php', diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 2d7a6c7c4e6..2c3679c0374 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -208,7 +208,7 @@ class modTicket extends DolibarrModules $this->menu[$r] = array('fk_menu' => 'fk_mainmenu=ticket', 'type' => 'left', 'titre' => 'Ticket', - 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), + 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth em092"'), 'mainmenu' => 'ticket', 'leftmenu' => 'ticket', 'url' => '/ticket/index.php', diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index ec1c458ce00..f7655db824a 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -51,7 +51,7 @@ class modWorkflow extends DolibarrModules // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) $this->name = preg_replace('/^mod/i', '', get_class($this)); // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) - $this->description = "Workflow management"; + $this->description = "Inter-modules workflow management"; // Possible values for version are: 'development', 'experimental', 'dolibarr' or version $this->version = 'dolibarr'; // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index be3f53847bf..be0d044ac25 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -908,7 +908,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L'); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index bc71116081e..4e1b448d9db 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1048,7 +1048,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(67, 4, $lib_condition_paiement, 0, 'L'); diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 275b4672109..74abd0fc715 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -865,7 +865,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 2094eab8c3a..99e76b20337 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -747,7 +747,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_id); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 3d3990c06b4..36f589531e6 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -807,7 +807,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($posxval, $posy); - $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc); + $lib_condition_paiement = $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) != ('PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label); $lib_condition_paiement = str_replace('\n', "\n", $lib_condition_paiement); $pdf->MultiCell(80, 4, $lib_condition_paiement, 0, 'L'); diff --git a/htdocs/core/photos_resize.php b/htdocs/core/photos_resize.php index f1b5a109230..67c524d67f6 100644 --- a/htdocs/core/photos_resize.php +++ b/htdocs/core/photos_resize.php @@ -451,8 +451,10 @@ if ($action == 'confirm_crop') */ $title= $langs->trans("ImageEditor"); +$morejs = array('/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js', '/core/js/lib_photosresize.js'); +$morecss = array('/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css'); -llxHeader($head, $title, '', '', 0, 0, array('/includes/jquery/plugins/jcrop/js/jquery.Jcrop.min.js', '/core/js/lib_photosresize.js'), array('/includes/jquery/plugins/jcrop/css/jquery.Jcrop.css')); +llxHeader($head, $title, '', '', 0, 0, $morejs, $morecss); print load_fiche_titre($title); diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 9e893bf93e3..5239a93fdf7 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -169,6 +169,7 @@ $totalizable = $extrafields->attributes[$elementtype]['totalizable'][$attrname]; $help = $extrafields->attributes[$elementtype]['help'][$attrname]; $entitycurrentorall = $extrafields->attributes[$elementtype]['entityid'][$attrname]; $printable = $extrafields->attributes[$elementtype]['printable'][$attrname]; +$enabled = $extrafields->attributes[$elementtype]['enabled'][$attrname]; if ((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_array($param)) { @@ -302,6 +303,14 @@ if (in_array($type, array_keys($typewecanchangeinto))) trans("AllEntities"); ?>> + + + + trans("EnabledCondition"); ?> + + + + diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index fb542f9037e..c62a95ec12b 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -76,6 +76,11 @@ if (is_array($extrafields->attributes[$elementtype]['type']) && count($extrafiel { foreach ($extrafields->attributes[$elementtype]['type'] as $key => $value) { + /*if (! dol_eval($extrafields->attributes[$elementtype]['enabled'][$key], 1)) { + // TODO Uncomment this to exclude extrafields of modules not enabled. Add a link to "Show extrafields disabled" + // continue; + }*/ + // Load language if required if (!empty($extrafields->attributes[$elementtype]['langfile'][$key])) { $langs->load($extrafields->attributes[$elementtype]['langfile'][$key]); diff --git a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php index d2d77cf3b5c..bbc5ba3370b 100644 --- a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php @@ -1,6 +1,6 @@ '."\n"; +// This tpl file is included into the init part of pages, so before action. +// So no output must be done. // Protection to avoid direct call of template if (empty($conf) || !is_object($conf)) diff --git a/htdocs/core/tpl/object_discounts.tpl.php b/htdocs/core/tpl/object_discounts.tpl.php index 85afea4ab16..c2c89e28ce0 100644 --- a/htdocs/core/tpl/object_discounts.tpl.php +++ b/htdocs/core/tpl/object_discounts.tpl.php @@ -88,7 +88,7 @@ if ($absolute_creditnote > 0) { } if ($absolute_discount <= 0 || $isNewObject) { - $text .= '('.$addabsolutediscount.')'; + $text .= ' ('.$addabsolutediscount.')'; } if ($isNewObject) { diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index cc74b02a29b..b4950f00e39 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -32,6 +32,7 @@ * $senderissupplier (0 by default, 1 or 2 for supplier invoices/orders) * $inputalsopricewithtax (0 by default, 1 to also show column with unit price including tax) */ + // Protection to avoid direct call of template if (empty($object) || !is_object($object)) { print "Error: this template page cannot be called directly as an URL"; @@ -174,7 +175,7 @@ if ($nolinesbefore) { echo ((GETPOST('prod_entry_mode', 'alpha') == 'free' || !empty($conf->global->MAIN_FREE_PRODUCT_CHECKED_BY_DEFAULT)) ? ' checked' : ''); echo '> '; // Show type selector - echo $langs->trans("FreeLineOfType"); + echo ''.$langs->trans("FreeLineOfType").''; echo ''; echo ' '; } else { @@ -193,20 +194,25 @@ if ($nolinesbefore) { // Predefined product/service if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { - if ($forceall >= 0 && $freelines) echo '
'; - echo ''; + if ($forceall >= 0 && $freelines) echo '
'; + else echo ''; echo ''; echo ' '; $filtertype = ''; @@ -239,22 +245,22 @@ if ($nolinesbefore) { array('qty'=>'qty', 'remise_percent' => 'discount', 'idprod' => 'idprod'), // html id tags that will be edited with each ajax json response key - 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done - 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for example shown we select a disabled option into combo) + 'update' => array('qty'=>'qty', 'remise_percent' => 'discount', 'idprod' => 'idprod'), // html id tags that will be edited with each ajax json response key + 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done + 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for example shown we select a disabled option into combo) ); $alsoproductwithnosupplierprice = 0; } else { $ajaxoptions = array( - 'update' => array('remise_percent' => 'discount') // html id tags that will be edited with each ajax json response key + 'update' => array('remise_percent' => 'discount', 'price_ht' => 'price_ht') // html id tags that will be edited with each ajax json response key ); $alsoproductwithnosupplierprice = 1; } - $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice, 'maxwidth500'); + $form->select_produits_fournisseurs($object->socid, GETPOST('idprodfournprice'), 'idprodfournprice', '', '', $ajaxoptions, 1, $alsoproductwithnosupplierprice, 'minwidth300imp maxwidth500'); if (!empty($conf->global->MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_SUPPLIER_PRODUCTS)) { ?> @@ -331,7 +337,7 @@ if ($nolinesbefore) { { $coldisplay++; ?> - "> + "> '; $coldisplay++; @@ -535,47 +541,47 @@ if (!empty($usemargins) && $user->rights->margins->creer) /* TODO This does not work for number with thousand separator that is , */ function checkFreeLine(e, npRate) { - var buying_price = $("input[name='buying_price']:first"); - var remise = $("input[name='remise_percent']:first"); + var buying_price = $("input[name='buying_price']:first"); + var remise = $("input[name='remise_percent']:first"); + + var rate = $("input[name='"+npRate+"']:first"); + if (rate.val() == '') + return true; + + if (! $.isNumeric(rate.val().replace(',','.'))) + { + alert('trans("rateMustBeNumeric")); ?>'); + e.stopPropagation(); + setTimeout(function () { rate.focus() }, 50); + return false; + } + if (npRate == "np_markRate" && rate.val() >= 100) + { + alert('trans("markRateShouldBeLesserThan100")); ?>'); + e.stopPropagation(); + setTimeout(function () { rate.focus() }, 50); + return false; + } + + var price = 0; + remisejs=price2numjs(remise.val()); + + if (remisejs != 100) // If a discount not 100 or no discount + { + if (remisejs == '') remisejs=0; + + bpjs=price2numjs(buying_price.val()); + ratejs=price2numjs(rate.val()); + + if (npRate == "np_marginRate") + price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100)); + else if (npRate == "np_markRate") + price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100)); + } + + $("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value - var rate = $("input[name='"+npRate+"']:first"); - if (rate.val() == '') return true; - - if (! $.isNumeric(rate.val().replace(',','.'))) - { - alert('trans("rateMustBeNumeric")); ?>'); - e.stopPropagation(); - setTimeout(function () { rate.focus() }, 50); - return false; - } - if (npRate == "np_markRate" && rate.val() >= 100) - { - alert('trans("markRateShouldBeLesserThan100")); ?>'); - e.stopPropagation(); - setTimeout(function () { rate.focus() }, 50); - return false; - } - - var price = 0; - remisejs=price2numjs(remise.val()); - - if (remisejs != 100) // If a discount not 100 or no discount - { - if (remisejs == '') remisejs=0; - - bpjs=price2numjs(buying_price.val()); - ratejs=price2numjs(rate.val()); - - if (npRate == "np_marginRate") - price = ((bpjs * (1 + ratejs / 100)) / (1 - remisejs / 100)); - else if (npRate == "np_markRate") - price = ((bpjs / (1 - ratejs / 100)) / (1 - remisejs / 100)); - } - - $("input[name='price_ht']:first").val(price); // TODO Must use a function like php price to have here a formated value - - return true; } rights->margins->creer) $("#select_type").change(function() { setforfree(); - if (jQuery('#select_type').val() >= 0) - { - /* focus work on a standard textarea but not if field was replaced with CKEDITOR */ - jQuery('#dp_desc').focus(); - /* focus if CKEDITOR */ - if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined") + if (jQuery('#select_type').val() >= 0) { - var editor = CKEDITOR.instances['dp_desc']; - if (editor) { editor.focus(); } + /* focus work on a standard textarea but not if field was replaced with CKEDITOR */ + jQuery('#dp_desc').focus(); + /* focus if CKEDITOR */ + if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined") + { + var editor = CKEDITOR.instances['dp_desc']; + if (editor) { editor.focus(); } + } + } + console.log("Hide/show date according to product type"); + if (jQuery('#select_type').val() == '0') + { + jQuery('#trlinefordates').hide(); + jQuery('.divlinefordates').hide(); + } + else + { + jQuery('#trlinefordates').show(); + jQuery('.divlinefordates').show(); } - } - console.log("Hide/show date according to product type"); - if (jQuery('#select_type').val() == '0') - { - jQuery('#trlinefordates').hide(); - jQuery('.divlinefordates').hide(); - } - else - { - jQuery('#trlinefordates').show(); - jQuery('.divlinefordates').show(); - } }); $("#prod_entry_mode_predef").on( "click", function() { @@ -652,7 +658,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) /* When changing predefined product, we reload list of supplier prices required for margin combo */ $("#idprod, #idprodfournprice").change(function() { - console.log("Call method change() after change on #idprod or #idprodfournprice. this.val = "+$(this).val()); + console.log("Call method change() after change on #idprod or #idprodfournprice (senderissupplier=). this.val = "+$(this).val()); setforpredef(); // TODO Keep vat combo visible and set it to first entry into list that match result of get_default_tva diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php index 8a7c38f8ada..697c46c6fcd 100644 --- a/htdocs/core/tpl/objectline_title.tpl.php +++ b/htdocs/core/tpl/objectline_title.tpl.php @@ -53,9 +53,10 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ''.$langs->trans('Description').''; +// Supplier ref if ($this->element == 'supplier_proposal' || $this->element == 'order_supplier' || $this->element == 'invoice_supplier') { - print ''.$langs->trans("SupplierRef").''; + print ''.$langs->trans("SupplierRef").''; } // VAT @@ -90,6 +91,7 @@ if ($inputalsopricewithtax) print ''.$lang // Qty print ''.$langs->trans('Qty').''; +// Unit if (!empty($conf->global->PRODUCT_USE_UNITS)) { print ''.$langs->trans('Unit').''; @@ -104,6 +106,7 @@ if ($this->situation_cycle_ref) { print ''.$form->textwithpicto($langs->trans('TotalHT100Short'), $langs->trans('UnitPriceXQtyLessDiscount')).''; } +// Purchase price if ($usemargins && !empty($conf->margin->enabled) && empty($user->socid)) { if (!empty($user->rights->margins->creer)) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 3d4c4ed63b7..4034198fff0 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -654,7 +654,10 @@ class InterfaceActionsAuto extends DolibarrTriggers if (empty($object->actionmsg2)) $object->actionmsg2 = $langs->transnoentities("ProjectModifiedInDolibarr", $object->ref); $object->actionmsg = $langs->transnoentities("ProjectModifiedInDolibarr", $object->ref); - $object->actionmsg .= "\n".$langs->transnoentities("Task").': '.$object->ref; + //$object->actionmsg .= "\n".$langs->transnoentities("Task").': ???'; + if (!empty($object->usage_opportunity) && is_object($object->oldcopy) && $object->opp_status != $object->oldcopy->opp_status) { + $object->actionmsg .= "\n".$langs->transnoentitiesnoconv("OpportunityStatus").': '.$object->oldcopy->opp_status.' -> '.$object->opp_status; + } $object->sendtoid = 0; } diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php index ee576992865..a903ab53b23 100644 --- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php +++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php @@ -47,7 +47,7 @@ class InterfaceContactRoles extends DolibarrTriggers $this->description = "Triggers of this module auto link contact to company."; // 'development', 'experimental', 'dolibarr' or version $this->version = self::VERSION_DOLIBARR; - $this->picto = 'action'; + $this->picto = 'company'; } /** diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 4c4a3fc3412..802e3681bd7 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -40,7 +40,7 @@ class EcmDirectory extends CommonObject /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ - public $picto = 'dir'; + public $picto = 'folder-open'; /** * @var int ID diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 6392d6f162e..bd550dbf751 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -47,7 +47,7 @@ class EcmFiles extends CommonObject /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ - public $picto = 'generic'; + public $picto = 'folder-open'; /** * @var string Ref hash of file path diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index b1c7eb0ec28..93885c2843a 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -290,7 +290,7 @@ print '
'; print '
'; print ''; -print ''; /*print ''; // Link for direct external download print ''; diff --git a/htdocs/install/mysql/data/llx_10_c_regions.sql b/htdocs/install/mysql/data/llx_10_c_regions.sql index 43d2652298f..ddda0f7ff32 100644 --- a/htdocs/install/mysql/data/llx_10_c_regions.sql +++ b/htdocs/install/mysql/data/llx_10_c_regions.sql @@ -346,41 +346,44 @@ INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ('2 INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES ('202', '20204', 'SI04', NULL, 'West Slovenia'); -- Regions China (rowid country=9) -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,901, '京',0,'北京市'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,902, '津',0,'天津市'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,903, '沪',0,'上海市'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,904, '渝',0,'重庆市'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,905, '冀',0,'河北省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,906, '晋',0,'山西省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,907, '辽',0,'辽宁省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,908, '吉',0,'吉林省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,909, '黑',0,'黑龙江省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,910, '苏',0,'江苏省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,911, '浙',0,'浙江省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,912, '皖',0,'安徽省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,913, '闽',0,'福建省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,914, '赣',0,'江西省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,915, '鲁',0,'山东省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,916, '豫',0,'河南省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,917, '鄂',0,'湖北省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,918, '湘',0,'湖南省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,919, '粤',0,'广东省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,920, '琼',0,'海南省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,921, '川',0,'四川省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,922, '贵',0,'贵州省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,923, '云',0,'云南省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,924, '陕',0,'陕西省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,925, '甘',0,'甘肃省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,926, '青',0,'青海省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,927, '台',0,'台湾省'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,928, '蒙',0,'内蒙古自治区'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,929, '桂',0,'广西壮族自治区'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,930, '藏',0,'西藏自治区'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,931, '宁',0,'宁夏回族自治区'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,932, '新',0,'新疆维吾尔自治区'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,933, '港',0,'香港特别行政区'); -insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9,934, '澳',0,'澳门特别行政区'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 901, '京',0,'北京市'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 902, '津',0,'天津市'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 903, '沪',0,'上海市'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 904, '渝',0,'重庆市'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 905, '冀',0,'河北省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 906, '晋',0,'山西省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 907, '辽',0,'辽宁省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 908, '吉',0,'吉林省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 909, '黑',0,'黑龙江省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 910, '苏',0,'江苏省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 911, '浙',0,'浙江省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 912, '皖',0,'安徽省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 913, '闽',0,'福建省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 914, '赣',0,'江西省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 915, '鲁',0,'山东省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 916, '豫',0,'河南省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 917, '鄂',0,'湖北省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 918, '湘',0,'湖南省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 919, '粤',0,'广东省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 920, '琼',0,'海南省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 921, '川',0,'四川省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 922, '贵',0,'贵州省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 923, '云',0,'云南省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 924, '陕',0,'陕西省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 925, '甘',0,'甘肃省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 926, '青',0,'青海省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 927, '台',0,'台湾省'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 928, '蒙',0,'内蒙古自治区'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 929, '桂',0,'广西壮族自治区'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 930, '藏',0,'西藏自治区'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 931, '宁',0,'宁夏回族自治区'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 932, '新',0,'新疆维吾尔自治区'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 933, '港',0,'香港特别行政区'); +insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (9, 934, '澳',0,'澳门特别行政区'); -- Regions Angola (rowid country=35) INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (35, 35001, 'AO', NULL, 'Angola'); +-- Regions Taiwan (rowid country=213) +INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom) VALUES (213, 21301, 'TW', NULL, 'Taiwan'); + diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 00f30fab0be..50a1317430b 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -1626,3 +1626,37 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-NAM', NULL, NULL, 'NAMÍBE', 'Namíbe'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-UIG', NULL, NULL, 'UÍGE', 'Uíge'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES ('35001', 'AO-ZAI', NULL, NULL, 'ZAÍRE', 'Zaíre'); + +-- Provinces Taiwan (rowid country=886) +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KLU', 'KLU', NULL, '基隆市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TPE', 'TPE', NULL, '臺北市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TPH', 'TPH', NULL, '新北市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TYC', 'TYC', NULL, '桃園市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HSH', 'HSH', NULL, '新竹縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HSC', 'HSC', NULL, '新竹市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-MAL', 'MAL', NULL, '苗栗縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-MAC', 'MAC', NULL, '苗栗市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TXG', 'TXG', NULL, '臺中市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CWH', 'CWH', NULL, '彰化縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CWS', 'CWS', NULL, '彰化市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-NTC', 'NTC', NULL, '南投市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-NTO', 'NTO', NULL, '南投縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-YLH', 'YLH', NULL, '雲林縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CHY', 'CHY', NULL, '嘉義縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-CYI', 'CYI', NULL, '嘉義市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TNN', 'TNN', NULL, '臺南市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KHH', 'KHH', NULL, '高雄市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-IUH', 'IUH', NULL, '屏東縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-PTS', 'PTS', NULL, '屏東市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-ILN', 'ILN', NULL, '宜蘭縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-ILC', 'ILC', NULL, '宜蘭市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HWA', 'HWA', NULL, '花蓮縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-HWC', 'HWC', NULL, '花蓮市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TTC', 'TTC', NULL, '臺東市'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-TTT', 'TTT', NULL, '臺東縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-PEH', 'PEH', NULL, '澎湖縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-GNI', 'GNI', NULL, '綠島'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KYD', 'KYD', NULL, '蘭嶼'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KMN', 'KMN', NULL, '金門縣'); +INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-LNN', 'LNN', NULL, '連江縣'); + diff --git a/htdocs/install/mysql/data/llx_c_actioncomm.sql b/htdocs/install/mysql/data/llx_c_actioncomm.sql index 9a0d8c223b6..cb22ee70ce3 100644 --- a/htdocs/install/mysql/data/llx_c_actioncomm.sql +++ b/htdocs/install/mysql/data/llx_c_actioncomm.sql @@ -30,7 +30,7 @@ -- Types action comm -- -delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,10,30,31,40,50); +delete from llx_c_actioncomm where id in (1,2,3,4,5,6,8,9,10,11,30,31,40,50); -- Code used from 3.3+ when type of event is used insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 1,'AC_TEL','system','Phone call',NULL, 1, 2); insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 2,'AC_FAX','system','Send Fax',NULL, 1, 3); diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index d05015721c8..478c263af4c 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -73,6 +73,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'XCD' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EGP', '[163]', 1, 'Egypt Pound'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'SVC', '[36]', 1, 'El Salvador Colon'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EEK', '[107,114]', 1, 'Estonia Kroon'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ETB', NULL, 1, 'Ethiopian Birr'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'EUR', '[8364]', 1, 'Euro Member Countries'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FKP', '[163]', 1, 'Falkland Islands (Malvinas) Pound'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'FJD', '[36]', 1, 'Fiji Dollar'); diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql index 7cd039a2c19..ed5449c0bd3 100644 --- a/htdocs/install/mysql/data/llx_const.sql +++ b/htdocs/install/mysql/data/llx_const.sql @@ -56,7 +56,7 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_M -- -- IHM -- -insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','25','chaine','Maximum length of lists',0,0); +insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_LISTE_LIMIT','20','chaine','Maximum length of lists',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_SIZE_SHORTLIST_LIMIT','3','chaine','Maximum length of short lists',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MENU_STANDARD','eldy_menu.php','chaine','Menu manager for internal users',0,0); diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 9658d6c3051..c297d14eb4a 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -580,3 +580,6 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value -- Removed no more used function -- VPGSQL8.2 DROP FUNCTION IF EXISTS update_modified_column_date_m CASCADE; + +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 6,'AC_EMAIL_IN','system','reception Email',NULL, 1, 4); + diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql index ea8f4aa70f6..f2be5893c0a 100644 --- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql +++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql @@ -35,6 +35,8 @@ ALTER TABLE llx_supplier_proposaldet_extrafields ADD INDEX idx_supplier_proposal ALTER TABLE llx_asset_extrafields ADD INDEX idx_asset_extrafields (fk_object); +insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 6,'AC_EMAIL_IN','system','reception Email',NULL, 1, 4); + -- For v14 ALTER TABLE llx_c_availability ADD COLUMN position integer NOT NULL DEFAULT 0; diff --git a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql index ded61d49e8b..5749acd93d8 100644 --- a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql +++ b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql @@ -37,7 +37,7 @@ CREATE TABLE llx_recruitment_recruitmentcandidature( date_birth date, remuneration_requested integer, remuneration_proposed integer, - email_msgid varchar(255), + email_msgid varchar(175), -- Do not use a too large value, it generates trouble with unique index fk_recruitment_origin INTEGER NULL -- END MODULEBUILDER FIELDS ) ENGINE=innodb; diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 14138dc5664..baac0eb2cbd 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -223,7 +223,7 @@ if ($ok && GETPOST('standard', 'alpha')) { $extrafields = new ExtraFields($db); $listofmodulesextra = array('societe'=>'societe', 'adherent'=>'adherent', 'product'=>'product', - 'socpeople'=>'socpeople', 'commande'=>'commande', 'facture'=>'facture', + 'socpeople'=>'socpeople', 'propal'=>'propal', 'commande'=>'commande', 'facture'=>'facture', 'supplier_proposal'=>'supplier_proposal', 'commande_fournisseur'=>'commande_fournisseur', 'facture_fourn'=>'facture_fourn', 'actioncomm'=>'actioncomm', 'bom_bom'=>'bom_bom', 'mrp_mo'=>'mrp_mo', 'adherent_type'=>'adherent_type', 'user'=>'user', 'projet'=>'projet', 'projet_task'=>'projet_task'); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 07c68a498b2..1dc7180bc4b 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -469,6 +469,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ 'MAIN_MODULE_BARCODE'=>'newboxdefonly', 'MAIN_MODULE_CRON'=>'newboxdefonly', 'MAIN_MODULE_COMMANDE'=>'newboxdefonly', + 'MAIN_MODULE_BLOCKEDLOG'=>'noboxes', 'MAIN_MODULE_DEPLACEMENT'=>'newboxdefonly', 'MAIN_MODULE_DON'=>'newboxdefonly', 'MAIN_MODULE_ECM'=>'newboxdefonly', @@ -482,7 +483,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ 'MAIN_MODULE_PAYBOX'=>'newboxdefonly', 'MAIN_MODULE_PRINTING'=>'newboxdefonly', 'MAIN_MODULE_PRODUIT'=>'newboxdefonly', - 'MAIN_MODULE_RESOURCE'=>'newboxdefonly', + 'MAIN_MODULE_RESOURCE'=>'noboxes', 'MAIN_MODULE_SALARIES'=>'newboxdefonly', 'MAIN_MODULE_SYSLOG'=>'newboxdefonly', 'MAIN_MODULE_SOCIETE'=>'newboxdefonly', @@ -4289,7 +4290,7 @@ function migrate_delete_old_dir($db, $langs, $conf) * @param DoliDB $db Database handler * @param Translate $langs Object langs * @param Conf $conf Object conf - * @param array $listofmodule List of modules + * @param array $listofmodule List of modules, like array('MODULE_KEY_NAME'=>', $reloadmode) * @param int $force 1=Reload module even if not already loaded * @return int <0 if KO, >0 if OK */ @@ -4328,6 +4329,15 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); $mod->init($reloadmode); } + } elseif ($moduletoreload == 'MAIN_MODULE_BLOCKEDLOG') { + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate BlockedLog module"); + $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modBlockedLog.class.php'; + if ($res) { + $mod = new modBlockedLog($db); + // For this module we only reload menus. + $mod->delete_menus(); + $mod->insert_menus($reloadmode); + } } elseif ($moduletoreload == 'MAIN_MODULE_CRON') { dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate Cron module"); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/modCron.class.php'; @@ -4472,7 +4482,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo $mod->remove('noboxes'); // We need to remove because menu entries has changed $mod->init($reloadmode); } - } else { + } else { // Other generic cases/modules $reg = array(); $tmp = preg_match('/MAIN_MODULE_([a-zA-Z0-9]+)/', $moduletoreload, $reg); if (!empty($reg[1])) @@ -4484,12 +4494,15 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo { $moduletoreloadshort = $reg[1]; } + dolibarr_install_syslog("upgrade2::migrate_reload_modules Reactivate module ".$moduletoreloadshort." with mode ".$reloadmode); $res = @include_once DOL_DOCUMENT_ROOT.'/core/modules/mod'.$moduletoreloadshort.'.class.php'; if ($res) { $classname = 'mod'.$moduletoreloadshort; $mod = new $classname($db); + //$mod->remove('noboxes'); + $mod->delete_menus(); // We must delete to be sure it is insert with new values $mod->init($reloadmode); } else { dolibarr_install_syslog('Failed to include '.DOL_DOCUMENT_ROOT.'/core/modules/mod'.$moduletoreloadshort.'.class.php'); @@ -4498,7 +4511,6 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo if ($res) { $classname = 'mod'.$moduletoreloadshort; $mod = new $classname($db); - //$mod->remove('noboxes'); $mod->init($reloadmode); } else { dolibarr_install_syslog('Failed to include '.strtolower($moduletoreloadshort).'/core/modules/mod'.$moduletoreloadshort.'.class.php', LOG_ERR); @@ -4530,7 +4542,7 @@ function migrate_reload_modules($db, $langs, $conf, $listofmodule = array(), $fo /** - * Reload menu if dynamic menus, if modified by version + * Reload SQL menu file (if dynamic menus, if modified by version) * * @param DoliDB $db Database handler * @param Translate $langs Object langs diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index dbdbd6873b6..b7948532773 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -232,6 +232,7 @@ BoxesAvailable=Widgets available BoxesActivated=Widgets activated ActivateOn=Activate on ActiveOn=Activated on +ActivatableOn=Activatable on SourceFile=Source file AvailableOnlyIfJavascriptAndAjaxNotDisabled=Available only if JavaScript is not disabled Required=Required @@ -647,8 +648,8 @@ Module4000Name=HRM Module4000Desc=Human resources management (management of department, employee contracts and feelings) Module5000Name=Multi-company Module5000Desc=Allows you to manage multiple companies -Module6000Name=Workflow -Module6000Desc=Workflow management (automatic creation of object and/or automatic status change) +Module6000Name=Inter-modules Workflow +Module6000Desc=Workflow management between different modules (automatic creation of object and/or automatic status change) Module10000Name=Websites Module10000Desc=Create websites (public) with a WYSIWYG editor. This is a webmaster or developer oriented CMS (it is better to know HTML and CSS language). Just setup your web server (Apache, Nginx, ...) to point to the dedicated Dolibarr directory to have it online on the internet with your own domain name. Module20000Name=Leave Request Management @@ -1741,6 +1742,7 @@ YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Se AccountancyCode=Accounting Code AccountancyCodeSell=Sale account. code AccountancyCodeBuy=Purchase account. code +CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT=Keep the checkbox “Automatically create the payment” empty by default when creating a new tax ##### Agenda ##### AgendaSetup=Events and agenda module setup PasswordTogetVCalExport=Key to authorize export link @@ -1987,7 +1989,7 @@ SocialNetworkSetup=Setup of module Social Networks EnableFeatureFor=Enable features for %s VATIsUsedIsOff=Note: The option to use Sales Tax or VAT has been set to Off in the menu %s - %s, so Sales tax or Vat used will always be 0 for sales. SwapSenderAndRecipientOnPDF=Swap sender and recipient address position on PDF documents -FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields only. Also an URL parameter action=create or action=edit must be set OR page name must end with 'new.php' to trigger this feature. +FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields and combo lists only. Also an URL parameter action=create or action=edit must be set OR page name must end with 'new.php' to trigger this feature. EmailCollector=Email collector EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some records automatically (like leads). NewEmailCollector=New Email Collector diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 33e0c01aad6..d16188d40d4 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -4,7 +4,7 @@ Actions=Events Agenda=Agenda TMenuAgenda=Agenda Agendas=Agendas -LocalAgenda=Internal calendar +LocalAgenda=Default calendar ActionsOwnedBy=Event owned by ActionsOwnedByShort=Owner AffectedTo=Assigned to @@ -20,7 +20,7 @@ MenuToDoActions=All incomplete events MenuDoneActions=All terminated events MenuToDoMyActions=My incomplete events MenuDoneMyActions=My terminated events -ListOfEvents=List of events (internal calendar) +ListOfEvents=List of events (default calendar) ActionsAskedBy=Events reported by ActionsToDoBy=Events assigned to ActionsDoneBy=Events done by @@ -131,7 +131,7 @@ AgendaUrlOptions4=logint=%s to restrict output to actions assigned to use AgendaUrlOptionsProject=project=__PROJECT_ID__ to restrict output to actions linked to project __PROJECT_ID__. AgendaUrlOptionsNotAutoEvent=notactiontype=systemauto to exclude automatic events. AgendaUrlOptionsIncludeHolidays=includeholidays=1 to include events of holidays. -AgendaShowBirthdayEvents=Show birthdays of contacts +AgendaShowBirthdayEvents=Birthdays of contacts AgendaHideBirthdayEvents=Hide birthdays of contacts Busy=Busy ExportDataset_event1=List of agenda events diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 88ff8fecdb6..7263b04730a 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -56,7 +56,8 @@ Paymentnumpad=Type of Pad to enter payment Numberspad=Numbers Pad BillsCoinsPad=Coins and banknotes Pad DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr -TakeposNeedsCategories=TakePOS needs product categories to work +TakeposNeedsCategories=TakePOS needs at least one product categorie to work +TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category %s to work OrderNotes=Order Notes CashDeskBankAccountFor=Default account to use for payments in NoPaimementModesDefined=No paiment mode defined in TakePOS configuration diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang index 10c536e0d48..2181b48ecb4 100644 --- a/htdocs/langs/en_US/commercial.lang +++ b/htdocs/langs/en_US/commercial.lang @@ -64,10 +64,10 @@ ActionAC_SHIP=Send shipping by mail ActionAC_SUP_ORD=Send purchase order by mail ActionAC_SUP_INV=Send vendor invoice by mail ActionAC_OTH=Other -ActionAC_OTH_AUTO=Automatically inserted events +ActionAC_OTH_AUTO=Other auto ActionAC_MANUAL=Manually inserted events ActionAC_AUTO=Automatically inserted events -ActionAC_OTH_AUTOShort=Auto +ActionAC_OTH_AUTOShort=Other Stats=Sales statistics StatusProsp=Prospect status DraftPropals=Draft commercial proposals diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 99bed13179f..d4c9f95b0b9 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -203,6 +203,7 @@ ProfId2IT=- ProfId3IT=- ProfId4IT=- ProfId5IT=EORI number +ProfId6IT=- ProfId1LU=Id. prof. 1 (R.C.S. Luxembourg) ProfId2LU=Id. prof. 2 (Business permit) ProfId3LU=- diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index a5cd750e3d6..f7c55df211f 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -899,8 +899,10 @@ ViewAccountList=View ledger ViewSubAccountList=View subaccount ledger RemoveString=Remove string '%s' SomeTranslationAreUncomplete=Some of the languages offered may be only partially translated or may contain errors. Please help to correct your language by registering at https://transifex.com/projects/p/dolibarr/ to add your improvements. -DirectDownloadLink=Direct download link (public/external) -DirectDownloadInternalLink=Direct download link (need to be logged and need permissions) +DirectDownloadLink=Public download link +PublicDownloadLinkDesc=Only the link is required to download the file +DirectDownloadInternalLink=Private download link +PrivateDownloadLinkDesc=You need to be logged and you need permissions to view or download the file Download=Download DownloadDocument=Download document ActualizeCurrency=Update currency rate @@ -1049,7 +1051,7 @@ KeyboardShortcut=Keyboard shortcut AssignedTo=Assigned to Deletedraft=Delete draft ConfirmMassDraftDeletion=Draft mass delete confirmation -FileSharedViaALink=File shared via a link +FileSharedViaALink=File shared with a public link SelectAThirdPartyFirst=Select a third party first... YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode Inventory=Inventory diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 9ecc11ed93d..9ec22ad00cc 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -141,6 +141,7 @@ VATRateForSupplierProduct=VAT Rate (for this vendor/product) DiscountQtyMin=Discount for this qty. NoPriceDefinedForThisSupplier=No price/qty defined for this vendor/product NoSupplierPriceDefinedForThisProduct=No vendor price/qty defined for this product +PredefinedItem=Predefined item PredefinedProductsToSell=Predefined Product PredefinedServicesToSell=Predefined Service PredefinedProductsAndServicesToSell=Predefined products/services to sell diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index b6d9e236c18..33a0fafb5dc 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -270,3 +270,5 @@ RefTaskParent=Ref. Parent Task ProfitIsCalculatedWith=Profit is calculated using AddPersonToTask=Add also to tasks UsageOrganizeEvent=Usage: Event Organization +PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classify project as closed when all its tasks are completed (100%% progress) +PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Note: existing projects with all tasks at 100 %% progress won't be affected: you will have to close them manually. This option only affects open projects. diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 7793fa5dead..b7babd403a1 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -46,12 +46,12 @@ SetHereVirtualHost=Use with Apache/NGinx/...
Create on your web server ExampleToUseInApacheVirtualHostConfig=Example to use in Apache virtual host setup: YouCanAlsoTestWithPHPS=Use with PHP embedded server
On develop environment, you may prefer to test the site with the PHP embedded web server (PHP 5.5 required) by running
php -S 0.0.0.0:8080 -t %s YouCanAlsoDeployToAnotherWHP=Run your web site with another Dolibarr Hosting provider
If you don't have a web server like Apache or NGinx available on internet, you can export and import your web site onto another Dolibarr instance provided by another Dolibarr hosting provider that provide full integration with the Website module. You can find a list of some Dolibarr hosting providers on https://saas.dolibarr.org -CheckVirtualHostPerms=Check also that virtual host has permission %s on files into
%s +CheckVirtualHostPerms=Check also that the virtual host user (for example www-data) has %s permissions on files into
%s ReadPerm=Read WritePerm=Write TestDeployOnWeb=Test/deploy on web PreviewSiteServedByWebServer=Preview %s in a new tab.

The %s will be served by an external web server (like Apache, Nginx, IIS). You must install and setup this server before to point to directory:
%s
URL served by external server:
%s -PreviewSiteServedByDolibarr=Preview %s in a new tab.

The %s will be served by Dolibarr server so it does not need any extra web server (like Apache, Nginx, IIS) to be installed.
The inconvenient is that URL of pages are not user friendly and start with path of your Dolibarr.
URL served by Dolibarr:
%s

To use your own external web server to serve this web site, create a virtual host on your web server that point on directory
%s
then enter the name of this virtual server and click on the other preview button. +PreviewSiteServedByDolibarr=Preview %s in a new tab.

The %s will be served by Dolibarr server so it does not need any extra web server (like Apache, Nginx, IIS) to be installed.
The inconvenient is that the URLs of pages are not user friendly and start with the path of your Dolibarr.
URL served by Dolibarr:
%s

To use your own external web server to serve this web site, create a virtual host on your web server that points on directory
%s
then enter the name of this virtual server in the properties of this website and click on the link "Test/Deploy on the web". VirtualHostUrlNotDefined=URL of the virtual host served by external web server not defined NoPageYet=No pages yet YouCanCreatePageOrImportTemplate=You can create a new page or import a full website template diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 072fd057dbf..7ecd5800861 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -130,7 +130,7 @@ AgendaUrlOptions4=logint=%spour limiter l'export aux actions assignées AgendaUrlOptionsProject=project=__PROJECT_ID__ pour restreindre aux événements associés au projet __PROJECT_ID__. AgendaUrlOptionsNotAutoEvent=notactiontype=systemauto pour exclure les événements automatiques. AgendaUrlOptionsIncludeHolidays=includeholidays=1 pour inclure les événements de type congé. -AgendaShowBirthdayEvents=Afficher les anniversaires de contacts +AgendaShowBirthdayEvents=Anniversaires de contacts AgendaHideBirthdayEvents=Masquer les anniversaires de contacts Busy=Occupé ExportDataset_event1=Liste des événements de l'agenda diff --git a/htdocs/langs/fr_FR/commercial.lang b/htdocs/langs/fr_FR/commercial.lang index 9b5721326d1..badec05e8c2 100644 --- a/htdocs/langs/fr_FR/commercial.lang +++ b/htdocs/langs/fr_FR/commercial.lang @@ -64,10 +64,10 @@ ActionAC_SHIP=Envoi bon d'expédition par email ActionAC_SUP_ORD=Envoi commande fournisseur par email ActionAC_SUP_INV=Envoi facture fournisseur par email ActionAC_OTH=Autre -ActionAC_OTH_AUTO=Évènements insérés automatiquement +ActionAC_OTH_AUTO=Autre auto ActionAC_MANUAL=Événements insérés manuellement ActionAC_AUTO=Événements insérés automatiquement -ActionAC_OTH_AUTOShort=Auto +ActionAC_OTH_AUTOShort=Autre Stats=Statistiques de vente StatusProsp=Status prospection DraftPropals=Propositions brouillons diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 1affdad0889..a963bffe13d 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -268,3 +268,5 @@ OneLinePerTask=Une ligne par tâche OneLinePerPeriod=Une ligne par période RefTaskParent=Réf. Tâche parent ProfitIsCalculatedWith=Le bénéfice est calculé sur la base de +PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE=Classer le projet à clôturé lorsque toutes les tâches de ce projet sont à 100 %% de progression +PROJECT_CLASSIFY_CLOSED_WHEN_ALL_TASKS_DONE_help=Non rétroactif : l’activation de cette option ne clôturera pas les projets dont les tâches sont déjà à 100 %%. Cette option ne classe que les projets ouverts. diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 06d7e5690f1..cbd0dc69375 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -1568,13 +1568,16 @@ if (!dol_is_dir($dirins)) } $dirins_ok = (dol_is_dir($dirins)); -llxHeader('', $langs->trans("ModuleBuilder"), '', '', 0, 0, - array( +$help_url = ''; +$morejs = array( '/includes/ace/src/ace.js', '/includes/ace/src/ext-statusbar.js', '/includes/ace/src/ext-language_tools.js', //'/includes/ace/src/ext-chromevox.js' - ), array(), '', 'classforhorizontalscrolloftabs'); +); +$morecss = array(); + +llxHeader('', $langs->trans("ModuleBuilder"), $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); $text = $langs->trans("ModuleBuilder"); diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index e7da913f39c..e07e7757751 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -772,9 +772,17 @@ class MyObject extends CommonObject $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"'; } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); - $linkstart = ''; - $linkend = ''; + if ($option == 'nolink') { + $linkend = ''; + } else { + $linkend = ''; + } $result .= $linkstart; diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index e22de010459..2cbccd1523b 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -231,6 +231,8 @@ $now = dol_now(); //$help_url="EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject"; $help_url = ''; $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("MyObjects")); +$morejs = array(); +$morecss = array(); // Build and execute select @@ -351,7 +353,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs'); // Example : Adding jquery code print '
'.$langs->trans("ECMCreationDate").''; +print '
'.$langs->trans("ECMCreationDate").''; print dol_print_date(dol_filemtime($fullpath), 'dayhour'); print '
'.$langs->trans("ECMDirectoryForFiles").''; @@ -321,7 +321,9 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Link for internal download -print '
'.$langs->trans("DirectDownloadInternalLink").''; +print '
'; +print $form->textwithpicto($langs->trans("DirectDownloadInternalLink"), $langs->trans("PrivateDownloadLinkDesc")); +print ''; $modulepart = 'ecm'; $forcedownload = 1; $rellink = '/document.php?modulepart='.$modulepart; @@ -347,9 +349,9 @@ print '
'; if ($action != 'edit') { - print $langs->trans("DirectDownloadLink"); + print $form->textwithpicto($langs->trans("DirectDownloadLink"), $langs->trans("PublicDownloadLinkDesc")); } else { - print $langs->trans("FileSharedViaALink"); + print $form->textwithpicto($langs->trans("FileSharedViaALink"), $langs->trans("PublicDownloadLinkDesc")); } print ''; if (!empty($object->share)) { diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index a5050889e09..8feff24e4c3 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -327,7 +327,7 @@ $moreheadjs .= ''."\n"; llxHeader($moreheadcss.$moreheadjs, $langs->trans("ECMArea"), '', '', '', '', $morejs, '', 0, 0); $head = ecm_prepare_dasboard_head(''); -print dol_get_fiche_head($head, 'index', $langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"), -1, ''); +print dol_get_fiche_head($head, 'index', '', -1, ''); // Add filemanager component diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index ae7aa840ab9..9d8e1527b9b 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -341,7 +341,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) } $head = ecm_prepare_dasboard_head(''); -print dol_get_fiche_head($head, 'index_auto', $langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager"), -1, ''); +print dol_get_fiche_head($head, 'index_auto', '', -1, ''); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 6ff4c418988..f41f2902e71 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -225,10 +225,12 @@ if (empty($reshook)) if (!($object->fk_user_author > 0)) $object->fk_user_author = $user->id; // Check that expense report is for a user inside the hierarchy or advanced permission for all is set - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->writeall_advance))) { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer) && empty($user->rights->expensereport->writeall_advance))) { $error++; setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors'); - } else { + } + if (!$error) { if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)) { if (!in_array($object->fk_user_author, $childids)) { $error++; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index f245084f8db..bee9ac1c9fe 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -224,7 +224,9 @@ if ($action == 'add') { * View */ -llxHeader('', $langs->trans("RepeatableIntervention"), 'ch-fichinter.html#s-fac-fichinter-rec'); +$help_url = ''; + +llxHeader('', $langs->trans("RepeatableIntervention"), $help_url); $form = new Form($db); $companystatic = new Societe($db); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 58b39cba8d6..1e6e0234cdc 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -139,6 +139,8 @@ class CommandeFournisseur extends CommonOrder public $cond_reglement_id; public $cond_reglement_code; + public $cond_reglement_label; // Label + public $cond_reglement_doc; // Label on documents /** * @var int ID @@ -312,7 +314,7 @@ class CommandeFournisseur extends CommonOrder $sql .= " c.note_private, c.note_public, c.model_pdf, c.extraparams, c.billed,"; $sql .= " c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multicurrency_total_ht, c.multicurrency_total_tva, c.multicurrency_total_ttc,"; $sql .= " cm.libelle as methode_commande,"; - $sql .= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc,"; + $sql .= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_label, cr.libelle_facture as cond_reglement_doc,"; $sql .= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle"; $sql .= ', c.fk_incoterms, c.location_incoterms'; $sql .= ', i.libelle as label_incoterms'; @@ -373,8 +375,9 @@ class CommandeFournisseur extends CommonOrder $this->fk_project = $obj->fk_project; $this->cond_reglement_id = $obj->fk_cond_reglement; $this->cond_reglement_code = $obj->cond_reglement_code; - $this->cond_reglement = $obj->cond_reglement_libelle; - $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc; + $this->cond_reglement = $obj->cond_reglement_label; // deprecated + $this->cond_reglement_label = $obj->cond_reglement_label; + $this->cond_reglement_doc = $obj->cond_reglement_doc; $this->fk_account = $obj->fk_account; $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; @@ -1562,8 +1565,6 @@ class CommandeFournisseur extends CommonOrder { global $langs, $mysoc, $conf; - $error = 0; - dol_syslog(get_class($this)."::addline $desc, $pu_ht, $qty, $txtva, $txlocaltax1, $txlocaltax2, $fk_product, $fk_prod_fourn_price, $ref_supplier, $remise_percent, $price_base_type, $pu_ttc, $type, $info_bits, $notrigger, $date_start, $date_end, $fk_unit, $pu_ht_devise, $origin, $origin_id"); include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 67070b99c57..0157dbd0eec 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -176,8 +176,11 @@ class FactureFournisseur extends CommonInvoice public $note_private; public $note_public; public $propalid; + public $cond_reglement_id; public $cond_reglement_code; + public $cond_reglement_label; + public $cond_reglement_doc; /** * @var int ID @@ -641,8 +644,8 @@ class FactureFournisseur extends CommonInvoice $sql .= " t.model_pdf,"; $sql .= " t.import_key,"; $sql .= " t.extraparams,"; - $sql .= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle,"; - $sql .= " p.code as mode_reglement_code, p.libelle as mode_reglement_libelle,"; + $sql .= " cr.code as cond_reglement_code, cr.libelle as cond_reglement_label, cr.libelle_facture as cond_reglement_doc,"; + $sql .= " p.code as mode_reglement_code, p.libelle as mode_reglement_label,"; $sql .= ' s.nom as socnom, s.rowid as socid,'; $sql .= ' t.fk_incoterms, t.location_incoterms,'; $sql .= " i.libelle as label_incoterms,"; @@ -697,12 +700,13 @@ class FactureFournisseur extends CommonInvoice $this->fk_project = $obj->fk_project; $this->cond_reglement_id = $obj->fk_cond_reglement; $this->cond_reglement_code = $obj->cond_reglement_code; - $this->cond_reglement = $obj->cond_reglement_libelle; - $this->cond_reglement_doc = $obj->cond_reglement_libelle; + $this->cond_reglement = $obj->cond_reglement_label; // deprecated + $this->cond_reglement_label = $obj->cond_reglement_label; + $this->cond_reglement_doc = $obj->cond_reglement_doc; $this->fk_account = $obj->fk_account; $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; - $this->mode_reglement = $obj->mode_reglement_libelle; + $this->mode_reglement = $obj->mode_reglement_label; $this->date_echeance = $this->db->jdate($obj->date_lim_reglement); $this->note = $obj->note_private; // deprecated $this->note_private = $obj->note_private; diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 2ed7ccab8ef..0aea652de68 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -570,7 +570,9 @@ if (empty($reshook)) $fk_unit = GETPOST('units', 'alpha'); - $tva_tx = price2num($tva_tx); // When vat is text input field + if (!preg_match('/\((.*)\)/', $tva_tx)) { + $tva_tx = price2num($tva_tx); // When vat is text input field + } // Local Taxes $localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty); diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index acfa5a54e16..dbe0bd5d7af 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -525,7 +525,9 @@ $warehouse_static = new Entrepot($db); $supplierorderdispatch = new CommandeFournisseurDispatch($db); $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedidos_a_proveedores'; -llxHeader('', $langs->trans("OrderDispatch"), $help_url, '', 0, 0, array('/fourn/js/lib_dispatch.js.php')); +$morejs = array('/fourn/js/lib_dispatch.js.php'); + +llxHeader('', $langs->trans("OrderDispatch"), $help_url, '', 0, 0, $morejs); if ($id > 0 || !empty($ref)) { $soc = new Societe($db); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a8f7fa2cc42..1e88aaf74c4 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2530,7 +2530,12 @@ if ($action == 'create') $discount = new DiscountAbsolute($db); $result = $discount->fetch(0, 0, $object->id); if ($result > 0) { - print ' '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).'
'; + print ' '; + $s = $langs->trans("CreditNoteConvertedIntoDiscount", '{s1}', '{s2}'); + $s = str_replace('{s1}', $object->getLibType(1), $s); + $s = str_replace('{s2}', $discount->getNomUrl(1, 'discount'), $s); + print $s; + print '
'; } } print '