diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index ed3ee851709..9bb31534dca 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -90,8 +90,8 @@ $arrayfields = array( 'aa.pcg_type'=>array('label'=>"Pcgtype", 'checked'=>1, 'help'=>'PcgtypeDesc'), 'categories'=>array('label'=>"AccountingCategories", 'checked'=>-1, 'help'=>'AccountingCategoriesDesc'), 'aa.reconcilable'=>array('label'=>"Reconcilable", 'checked'=>1), - 'aa.active'=>array('label'=>"Activated", 'checked'=>1), - 'aa.import_key'=>array('label'=>"ImportId", 'checked'=>-1) + 'aa.import_key'=>array('label'=>"ImportId", 'checked'=>-1), + 'aa.active'=>array('label'=>"Activated", 'checked'=>1) ); if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { @@ -448,7 +448,7 @@ if ($resql) { print '
'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; - $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields + $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); $moreforfilter = ''; @@ -581,8 +581,9 @@ if ($resql) { print_liste_field_titre($arrayfields['aa.active']['label'], $_SERVER["PHP_SELF"], 'aa.active', '', $param, '', $sortfield, $sortorder); $totalarray['nbfield']++; } + // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch '); + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch '); $totalarray['nbfield']++; } print "\n"; @@ -601,15 +602,25 @@ if ($resql) { // Action column if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; + print ''; + if ($user->hasRight('accounting', 'chartofaccount')) { + print ''; + print img_edit(); + print ''; + print ' '; + print ''; + print img_delete(); + print ''; + print ' '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; } - print ''; } - print ''; + print ''."\n"; if (!$i) { $totalarray['nbfield']++; } @@ -627,7 +638,7 @@ if ($resql) { // Account label if (!empty($arrayfields['aa.label']['checked'])) { - print ""; + print ''; print dol_escape_htmltag($obj->label); print "\n"; if (!$i) { @@ -747,15 +758,25 @@ if ($resql) { // Action column if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ''; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; + print ''; + if ($user->hasRight('accounting', 'chartofaccount')) { + print ''; + print img_edit(); + print ''; + print ' '; + print ''; + print img_delete(); + print ''; + print ' '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($obj->rowid, $arrayofselected)) { + $selected = 1; + } + print ''; } - print ''; } - print ''; + print ''."\n"; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 26287a5bbb8..7f2bf439c09 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -381,7 +381,7 @@ if ($action == 'create') { print '
'; print '
'; - print ''; + print '
'; // Label print ''; diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 7b660419daf..4ef7fe78726 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -131,8 +131,12 @@ print '
'.$langs->trans("Label").'
'; // Select the category print ''; print ''; print '
'.$langs->trans("AccountingCategory").''; -print $formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0, 0); -print ''; +$s = $formaccounting->select_accounting_category($cat_id, 'account_category', 1, 0, 0, 0); +if ($formaccounting->nbaccounts_category <= 0) { + print ''.$s.''; +} else { + print ''; +} print '
'; diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 7b7148f89ce..59d9f219ee4 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -58,9 +58,10 @@ $listlimit = GETPOST('listlimit', 'int') > 0 ?GETPOST('listlimit', 'int') : 1000 $sortfield = GETPOST("sortfield", 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; -} // If $page is not defined, or '' or -1 +} $offset = $listlimit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -450,7 +451,7 @@ if (empty($sortfield)) { $sql .= $db->order($sortfield, $sortorder); $sql .= $db->plimit($listlimit + 1, $offset); -//print $sql; + $fieldlist = explode(',', $tabfield[$id]); @@ -468,7 +469,9 @@ if ($sortfield) { if (GETPOST('from', 'alpha')) { $paramwithsearch .= '&from='.urlencode(GETPOST('from', 'alpha')); } - +if ($listlimit) { + $paramwithsearch .= '&listlimit='.urlencode(GETPOST('listlimit', 'int')); +} print '
'; print ''; print ''; @@ -476,7 +479,7 @@ print ''; -print '
'; +print '
'; print ''; // Form to add a new line @@ -485,6 +488,10 @@ if ($tabname[$id]) { // Line for title print ''; + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } foreach ($fieldlist as $field => $value) { // Determine le nom du champ par rapport aux noms possibles // dans les dictionnaires de donnees @@ -524,6 +531,7 @@ if ($tabname[$id]) { } if ($fieldlist[$field] == 'range_account') { $valuetoshow = $langs->trans("Comment"); + $class = 'width75'; } if ($fieldlist[$field] == 'category_type') { $valuetoshow = $langs->trans("Calculated"); @@ -546,13 +554,20 @@ if ($tabname[$id]) { print ''; print ''; print ''; - print ''; - print ''; + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } print ''; // Line to enter new values print ''; + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } + $obj = new stdClass(); // If data was already input, we define them in obj to populate input fields. if (GETPOST('actionadd', 'alpha')) { @@ -572,19 +587,29 @@ if ($tabname[$id]) { fieldListAccountingCategories($fieldlist, $obj, $tabname[$id], 'add'); } - print ''; + + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } + print ""; $colspan = count($fieldlist) + 3; if ($id == 32) { $colspan++; } - - print ''; // Keep   to have a line with enough height } +print '
'; + print ''; print ''; print '
 
'; +print '
'; + +print '
'; +print ''; + // List of available record in database dol_syslog("htdocs/accountancy/admin/categories_list.php", LOG_DEBUG); @@ -595,13 +620,37 @@ if ($resql) { // There is several pages if ($num > $listlimit) { - print ''; } + $filterfound = 0; + foreach ($fieldlist as $field => $value) { + $showfield = 1; // By defaut + if ($fieldlist[$field] == 'region_id' || $fieldlist[$field] == 'country_id') { + $showfield = 0; + } + if ($showfield) { + if ($value == 'country') { + $filterfound++; + } + } + } + // Title line with search boxes print ''; + + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } + $filterfound = 0; foreach ($fieldlist as $field => $value) { $showfield = 1; // By defaut @@ -623,17 +672,23 @@ if ($resql) { } print ''; print ''; - print ''; - print ''; } - print ''; print ''; // Title of lines print ''; + // Action column + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList(''); + } foreach ($fieldlist as $field => $value) { // Determines the name of the field in relation to the possible names // in data dictionaries @@ -707,16 +762,22 @@ if ($resql) { print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable ? $fieldlist[$field] : ''), ($page ? 'page='.$page.'&' : ''), $param, "", $sortfield, $sortorder, $class.' '); } } + print getTitleFieldOfList($langs->trans("ListOfAccounts"), 0, $_SERVER["PHP_SELF"], "", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, ''); print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page ? 'page='.$page.'&' : ''), $param, '', $sortfield, $sortorder, 'center '); - print getTitleFieldOfList(''); - print getTitleFieldOfList(''); - print getTitleFieldOfList(''); + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print getTitleFieldOfList(''); + } print ''; + if ($num) { + $imaxinloop = ($listlimit ? min($num, $listlimit) : $num); + // Lines with values - while ($i < $num) { + while ($i < $imaxinloop) { $obj = $db->fetch_object($resql); + //print_r($obj); print ''; if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) { @@ -725,12 +786,16 @@ if ($resql) { $reshook = $hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors; + // Actions + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } + // Show fields if (empty($reshook)) { fieldListAccountingCategories($fieldlist, $obj, $tabname[$id], 'edit'); } - print ''; print ''; print ''; - print ''; + // Actions + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } } else { + // Can an entry be erased or disabled ? + $iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default + if (isset($obj->code)) { + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { + $iserasable = 0; $canbedisabled = 0; + } + } + $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); + if ($param) { + $url .= '&'.$param; + } + $url .= '&'; + + $canbemodified = $iserasable; + $tmpaction = 'view'; $parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); $reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error = $hookmanager->error; $errors = $hookmanager->errors; + // Actions + if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + } + if (empty($reshook)) { foreach ($fieldlist as $field => $value) { $showfield = 1; - $class = "left"; + $title = ''; + $class = 'tddict'; + $tmpvar = $fieldlist[$field]; $valuetoshow = $obj->$tmpvar; if ($value == 'category_type') { @@ -764,43 +863,35 @@ if ($resql) { $key = $langs->trans("Country".strtoupper($obj->country_code)); $valuetoshow = ($key != "Country".strtoupper($obj->country_code) ? $obj->country_code." - ".$key : $obj->country); } - } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_country') { - $key = $langs->trans("Country".strtoupper($obj->code)); - $valuetoshow = ($obj->code && $key != "Country".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_availability') { - $langs->loadLangs(array("propal")); - $key = $langs->trans("AvailabilityType".strtoupper($obj->code)); - $valuetoshow = ($obj->code && $key != "AvailabilityType".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); - } elseif ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_actioncomm') { - $key = $langs->trans("Action".strtoupper($obj->code)); - $valuetoshow = ($obj->code && $key != "Action".strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); + } elseif (in_array($fieldlist[$field], array('label', 'range_account', 'formula'))) { + $class = "tdoverflowmax250"; + $title = $valuetoshow; } elseif ($fieldlist[$field] == 'region_id' || $fieldlist[$field] == 'country_id') { $showfield = 0; } - $class = 'tddict'; // Show value for field if ($showfield) { - print ''; + print ''; } } } - // Can an entry be erased or disabled ? - $iserasable = 1; $canbedisabled = 1; $canbemodified = 1; // true by default - if (isset($obj->code)) { - if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { - $iserasable = 0; $canbedisabled = 0; - } - } + // Link to setup the group + print ''; // Active print '"; - // Modify link - if ($canbemodified) { - print ''; - } else { - print ''; - } - - // Delete link - if ($iserasable) { + // Actions + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print ''; - } else { - print ''; } - - // Link to setup the group - print ''; } print "\n"; $i++; } } else { - $colspan = 11; + $colspan = 10; print ''; } } else { @@ -920,20 +987,14 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co print ''; } else { print ''; } } diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 18797312ad8..0b172c4e36e 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -356,7 +356,7 @@ if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''."\n"; print ''."\n"; print ''."\n"; } @@ -386,7 +386,7 @@ if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) { // We use an option here because it adds bugs when used on agenda page "peruser" and "list" $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE)); } -$formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1, $multiselect); +$formactions->select_type_actions(getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE'), "AGENDA_DEFAULT_FILTER_TYPE", '', (getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1), 1, $multiselect); print ''."\n"; // AGENDA_DEFAULT_FILTER_STATUS diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 7dac8f9d440..91b7c3a00d0 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -216,8 +216,8 @@ $tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as $tabsql[9] = "SELECT c.code_iso as code, c.label, c.unicode, c.active FROM ".MAIN_DB_PREFIX."c_currencies AS c"; $tabsql[10] = "SELECT t.rowid, t.entity, t.code, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, c.label as country, c.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays = c.rowid AND t.entity = ".getEntity($tabname[10]); $tabsql[11] = "SELECT t.rowid as rowid, t.element, t.source, t.code, t.libelle, t.position, t.active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; -$tabsql[12] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.deposit_percent, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity = ".getEntity($tabname[12]); -$tabsql[13] = "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity = ".getEntity($tabname[13]); +$tabsql[12] = "SELECT c.rowid as rowid, c.code, c.libelle, c.libelle_facture, c.deposit_percent, c.nbjour, c.type_cdr, c.decalage, c.active, c.sortorder, c.entity FROM ".MAIN_DB_PREFIX."c_payment_term AS c WHERE c.entity IN (".getEntity($tabname[12]).")"; +$tabsql[13] = "SELECT c.id as rowid, c.code, c.libelle, c.type, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_paiement AS c WHERE c.entity IN (".getEntity($tabname[13]).")"; $tabsql[14] = "SELECT e.rowid as rowid, e.code as code, e.label, e.price, e.organization, e.fk_pays as country_id, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1"; $tabsql[15] = "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format"; $tabsql[16] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; @@ -229,7 +229,7 @@ $tabsql[21] = "SELECT c.rowid as rowid, c.code, c.label, c.type_duration, c.qty, $tabsql[22] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason"; $tabsql[23] = "SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid"; $tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource"; -$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity = ".getEntity($tabname[25]); +$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity($tabname[25]).")"; //$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units"; $tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm"; $tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.block_if_negative, h.sortorder, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid"; @@ -242,7 +242,7 @@ $tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PR $tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c"; $tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r"; $tabsql[37] = "SELECT r.rowid, r.code, r.sortorder, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r"; -$tabsql[38] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity = ".getEntity($tabname[38]); +$tabsql[38] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity IN (".getEntity($tabname[38]).")"; $tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel"; $tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact"; $tabsql[41] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_transport_mode"; @@ -310,8 +310,8 @@ $tabfield[8] = "code,libelle,country_id,country".(!empty($conf->global->SOCIETE_ $tabfield[9] = "code,label,unicode"; $tabfield[10] = "country_id,country,code,taux,localtax1_type,localtax1,localtax2_type,localtax2,recuperableonly,accountancy_code_sell,accountancy_code_buy,note"; $tabfield[11] = "element,source,code,libelle,position"; -$tabfield[12] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder,entity"; -$tabfield[13] = "code,libelle,type,entity"; +$tabfield[12] = "code,libelle,libelle_facture,deposit_percent,nbjour,type_cdr,decalage,sortorder"; +$tabfield[13] = "code,libelle,type"; $tabfield[14] = "code,label,price,organization,country"; $tabfield[15] = "code,libelle,width,height,unit"; $tabfield[16] = "code,libelle,sortorder"; @@ -336,7 +336,7 @@ $tabfield[34] = "code,label"; $tabfield[35] = "label"; $tabfield[36] = "range_ik,fk_c_exp_tax_cat"; $tabfield[37] = "code,label,short_label,unit_type,scale,sortorder"; -$tabfield[38] = "code,label,url,icon,entity"; +$tabfield[38] = "code,label,url,icon"; $tabfield[39] = "code,libelle,sortorder"; $tabfield[40] = "code,libelle,picto"; $tabfield[41] = "code,label"; @@ -391,7 +391,7 @@ $tabfieldvalue[42] = "code,label"; $tabfieldvalue[43] = "code,label"; $tabfieldvalue[44] = "code,label"; -// Field names in the table for inserting a record +// Field names in the table for inserting a record (add field "entity" only here when dictionary is ready to personalized by entity) $tabfieldinsert = array(); $tabfieldinsert[1] = "code,libelle,fk_pays"; $tabfieldinsert[2] = "code_departement,nom,fk_region"; @@ -417,7 +417,7 @@ $tabfieldinsert[21] = "code,label,qty,type_duration,position"; $tabfieldinsert[22] = "code,label"; $tabfieldinsert[23] = "fk_pays,taux,revenuestamp_type,accountancy_code_sell,accountancy_code_buy,note"; $tabfieldinsert[24] = "code,label"; -$tabfieldinsert[25] = "code,label"; +$tabfieldinsert[25] = "code,label,entity"; //$tabfieldinsert[26]= "code,label,short_label"; $tabfieldinsert[27] = "code,libelle,picto"; $tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country,block_if_negative,sortorder"; @@ -890,7 +890,7 @@ if (empty($reshook)) { } $i = 0; foreach ($listfieldinsert as $f => $value) { - $keycode = $listfieldvalue[$i]; + $keycode = (isset($listfieldvalue[$i]) ? $listfieldvalue[$i] : ''); if (empty($keycode)) { $keycode = $value; } diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 82d05113b8b..8a276d68e27 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -598,7 +598,7 @@ if ($action == 'edit') { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } } else { - print yn(0).' ('.$langs->trans("NotSupported").')'; + print ''.yn(0).' ('.$langs->trans("NotSupported").')'; } print ''; @@ -611,7 +611,7 @@ if ($action == 'edit') { print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } } else { - print yn(0).' ('.$langs->trans("NotSupported").')'; + print ''.yn(0).' ('.$langs->trans("NotSupported").')'; } print ''; } diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 03a7d5bb02d..0576cd3ccc7 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -1,6 +1,8 @@ - * Copyright (C) 2016 Christophe Battarel +/* Copyright (C) 2013-2018 Jean-François FERRY + * Copyright (C) 2016 Christophe Battarel + * Copyright (C) 2022-2023 Udo Tamm + * Copyright (C) 2023 Alexandre Spangaro * * 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 @@ -17,17 +19,17 @@ */ /** - * \file admin/ticket.php + * \file htdocs/admin/ticket.php * \ingroup ticket * \brief Page to setup module ticket */ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; -require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; -require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php"; require_once DOL_DOCUMENT_ROOT."/core/class/html.formcategory.class.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; +require_once DOL_DOCUMENT_ROOT."/core/lib/ticket.lib.php"; +require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; // Load translation files required by the page $langs->loadLangs(array("admin", "ticket")); @@ -111,14 +113,14 @@ if ($action == 'updateMask') { $conf->global->TICKET_ADDON_PDF = $value; } - // On active le modele + // Activate the model $ret = delDocumentModel($value, $type); if ($ret > 0) { $ret = addDocumentModel($value, $type, $label, $scandir); } } elseif ($action == 'setmod') { - // TODO Verifier si module numerotation choisi peut etre active - // par appel methode canBeActivated + // TODO check if the chosen numbering module can be activated + // by calling the canBeActivated method dolibarr_set_const($db, "TICKET_ADDON", $value, 'chaine', 0, '', $conf->entity); } elseif ($action == 'setvarworkflow') { @@ -235,8 +237,9 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); $formcategory = new FormCategory($db); -$help_url = "FR:Module_Ticket"; -$page_name = "TicketSetup"; +// Page Header +$help_url = 'EN:Module_Ticket|FR:Module_Ticket_FR'; +$page_name = 'TicketSetup'; llxHeader('', $langs->trans($page_name), $help_url); // Subheader @@ -267,7 +270,7 @@ print ''; print ''; print ''; print ''; -print ''; +print ''; print "\n"; clearstatcache(); @@ -391,8 +394,8 @@ print ''; print ''; print '\n"; print '\n"; -print ''; -print ''; +print ''; +print ''; print "\n"; clearstatcache(); @@ -439,7 +442,7 @@ foreach ($dirmodels as $reldir) { } print ''; - // Active + // Active / Status if (in_array($name, $def)) { print '"; } - // Default + // Default Template print ''; + // Preview + print ''; + + print "\n"; + // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip .= '
'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); @@ -480,17 +494,6 @@ foreach ($dirmodels as $reldir) { print ''; - - // Preview - print ''; - - print "\n"; } } } @@ -509,17 +512,21 @@ print ''; print ''; print ''; +/* + * Other Parameters + */ + print load_fiche_titre($langs->trans("Other"), '', ''); print '
'; print '
'; + print '
'; print_fleche_navigation($page, $_SERVER["PHP_SELF"], $paramwithsearch, ($num > $listlimit), ''); print '
'; + if ($filterfound) { + $searchpicto = $form->showFilterAndCheckAddButtons(0); + print $searchpicto; + } + print ''; - if ($filterfound) { - $searchpicto = $form->showFilterAndCheckAddButtons(0); - print $searchpicto; + // Action column + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + if ($filterfound) { + $searchpicto = $form->showFilterAndCheckAddButtons(0); + print $searchpicto; + } + print '
'; print '
'; @@ -739,18 +804,52 @@ if ($resql) { print ''; print ''; print '
'; + if ($canbemodified) { + print ''.img_edit().''; + } + if ($iserasable) { + if ($user->admin) { + print ''.img_delete().''; + } + } + print ''.dol_escape_htmltag($valuetoshow).''.dol_escape_htmltag($valuetoshow).''; + if (empty($obj->formula)) { + // Count number of accounts into group + $nbofaccountintogroup = 0; + $listofaccountintogroup = $accountingcategory->getCptsCat($obj->rowid); + $nbofaccountintogroup = count($listofaccountintogroup); - $canbemodified = $iserasable; - - $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ?urlencode($obj->code) : ''); - if ($param) { - $url .= '&'.$param; + print ''; + print $langs->trans("NAccounts", $nbofaccountintogroup); + print ''; + } else { + print ''.$langs->trans("Formula").''; } - $url .= '&'; + print ''; @@ -811,49 +902,25 @@ if ($resql) { } print "'.img_edit().' '; - if ($user->admin) { - print ''.img_delete().''; + if ($canbemodified) { + print ''.img_edit().''; + } + if ($iserasable) { + if ($user->admin) { + print ''.img_delete().''; + } } - //else print ''.img_delete().''; // Some dictionary can be edited by other profile than admin print ' '; - if (empty($obj->formula)) { - print ''; - print $langs->trans("ListOfAccounts"); - print ''; - - // Count number of accounts into group - $nbofaccountintogroup = 0; - $listofaccountintogroup = $accountingcategory->getCptsCat($obj->rowid); - $nbofaccountintogroup = count($listofaccountintogroup); - //if ($nbofaccountintogroup > 0) { - print ' ('.$langs->trans("NAccounts", $nbofaccountintogroup).')'; - //} else { - // print ' (0)'; - //} - } - print '
'.$langs->trans("None").'
'; - $size = ''; $class = ''; - if ($fieldlist[$field] == 'code') { + $class = ''; + if (in_array($fieldlist[$field], array('code', 'range_account', 'label', 'formula'))) { $class = 'maxwidth100'; } if ($fieldlist[$field] == 'position') { $class = 'maxwidth50'; } - if ($fieldlist[$field] == 'libelle') { - $class = 'quatrevingtpercent'; - } - if ($fieldlist[$field] == 'sortorder' || $fieldlist[$field] == 'category_type') { - $size = 'size="2" '; - } - print ''; + print ''; print ''.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").' '."\n"; - $formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1); + $formactions->select_type_actions(getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT'), "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1); print '
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Example").''.$langs->trans("Activated").''.$langs->trans("ShortInfo").''.$langs->trans("ShortInfo").'
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("Status")."'.$langs->trans("Default")."'.$langs->trans("ShortInfo").''.$langs->trans("Preview").''.$langs->trans("Preview").''.$langs->trans("ShortInfo").'
'."\n"; print ''; @@ -452,7 +455,7 @@ foreach ($dirmodels as $reldir) { print "'; if (getDolGlobalString("TICKET_ADDON_PDF") == $name) { print img_picto($langs->trans("Default"), 'on'); @@ -461,6 +464,17 @@ foreach ($dirmodels as $reldir) { } print ''; + if ($module->type == 'pdf') { + print ''.img_object($langs->trans("Preview"), 'pdf').''; + } else { + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); + } + print '
'; print $formcategory->textwithpicto('', $htmltooltip, 1, 0); print ''; - if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"), 'pdf').''; - } else { - print img_object($langs->trans("PreviewNotAvailable"), 'generic'); - } - print '
'; print ''; print ''; -print ''; -print ''; +print '\n"; +print ''; print "\n"; -// Auto mark ticket read when created from backoffice +// Auto mark ticket as read when created from backoffice print ''; print ''; print ''; -// Auto assign ticket at user who created it +// Auto assign ticket to user who created it print ''; print ''; print ''; print ''; -//Allow classification modification even if the ticket is closed +// Allow classification modification even if the ticket is closed print ''; print ''; -print ''; +print ''; +print ''; print "\n"; if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { print ''; - print ''; + print ''; + print ''; print "\n"; } -// @todo Use module notification instead... +// TODO Use module notification instead... -// Email d'envoi des notifications +// Email to send notifications print ''; print ''; @@ -656,7 +667,7 @@ print ''; // Email for notification of TICKET_CREATE print ''; print ''; +print ''; print ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index b773140ff48..de0b96cc1a8 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -492,9 +492,10 @@ if (empty($reshook)) { if ($origin && $originid) { // Parse element/subelement (ex: project_task) $element = $subelement = $origin; + $regs = array(); if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { - $element = $regs [1]; - $subelement = $regs [2]; + $element = $regs[1]; + $subelement = $regs[2]; } // For compatibility diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index ddc48e264c4..a340d7ef7c3 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -270,7 +270,7 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) { $colspan++; } - print ''; + print ''; } print '
'.$langs->trans("Parameter").''.$langs->trans("Status")."'.$langs->trans("ShortInfo").'
'.$langs->trans("TicketsAutoReadTicket").''; if ($conf->use_javascript_ajax) { @@ -534,7 +541,7 @@ print $formcategory->textwithpicto('', $langs->trans("TicketsAutoReadTicketHelp" print '
'.$langs->trans("TicketsAutoAssignTicket").''; @@ -600,7 +607,7 @@ print $formcategory->textwithpicto('', $langs->trans("TicketsDelayBetweenAnswers print '
'.$langs->trans("TicketsAllowClassificationModificationIfClosed").''; if ($conf->use_javascript_ajax) { @@ -621,7 +628,9 @@ print $formcategory->buttonsSaveCancel("Save", '', array(), 0, 'reposition'); print ''; - +/* + * Notification + */ // Admin var of module print load_fiche_titre($langs->trans("Notification"), '', ''); @@ -633,18 +642,20 @@ print ''; print ''; print '
'.$langs->trans("Email").''.$langs->trans("Email").''.$langs->trans("ShortInfo").'
'.$langs->trans("TicketCkEditorEmailNotActivated").'
'.$langs->trans("TicketCkEditorEmailNotActivated").'
'.$langs->trans("ShortInfo").'
'.$langs->trans("TicketEmailNotificationFrom").''; print '
'.$langs->trans("TicketEmailNotificationTo").''; -print ''; print $formcategory->textwithpicto('', $langs->trans("TicketEmailNotificationToHelp"), 1, 'help'); print '
'.$langs->trans("NoInvoice").'
'.$langs->trans("NoInvoice").'

'; $db->free($resql); @@ -397,7 +397,7 @@ if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMO if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) { $colspan++; } - print ''.$langs->trans("NoInvoice").''; + print ''.$langs->trans("NoInvoice").''; } print '

'; } else { @@ -488,7 +488,7 @@ if (isModEnabled('don') && $user->hasRight('don', 'lire')) { print "\n"; } } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print '

'; } else { @@ -578,7 +578,7 @@ if (isModEnabled('tax') && !empty($user->rights->tax->charges->lire)) { print ' '; print ''; } else { - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "
"; $db->free($resql); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 0e23bbfe7f8..2ae01b2fc3a 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1562,7 +1562,7 @@ class Contrat extends CommonObject // if buy price not defined, define buyprice as configured in margin admin - if ($this->pa_ht == 0) { + if ($pa_ht == 0) { if (($result = $this->defineBuyPrice($pu_ht, $remise_percent, $fk_product)) < 0) { return $result; } else { diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index 10cde722e65..1e76abfbfee 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -261,7 +261,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box $label = $head['text']; //if (!empty($head['graph'])) $label.=' ('.$langs->trans("Graph").')'; if (!empty($head['graph'])) { - $label .= ' '; + $label .= ' '; } $out .= ''; //$out.= ''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index da18035e1ee..28703bdb3f3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -9459,7 +9459,7 @@ abstract class CommonObject // If we have a field ref with a default value of (PROV) if (!$error) { - if (key_exists('ref', $this->fields) && $this->fields['ref']['notnull'] > 0 && key_exists('default', $this->fields['ref']) && $this->fields['ref']['default'] == '(PROV)') { + if (key_exists('ref', $this->fields) && key_exists('notnull', $this->fields['ref']) && $this->fields['ref']['notnull'] > 0 && key_exists('default', $this->fields['ref']) && $this->fields['ref']['default'] == '(PROV)') { $sql = "UPDATE ".$this->db->prefix().$this->table_element." SET ref = '(PROV".((int) $this->id).")' WHERE (ref = '(PROV)' OR ref = '') AND rowid = ".((int) $this->id); $resqlupdate = $this->db->query($sql); diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index 2aaaf2e666f..86f02628ff2 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -56,13 +56,17 @@ class DolGeoIP if ($type == 'country') { // geoip may have been already included with PEAR if ($geoipversion == '2' || ($geoipversion != 'php' && !function_exists('geoip_country_code_by_name'))) { - stream_wrapper_restore('phar'); + if (function_exists('stream_wrapper_restore')) { + stream_wrapper_restore('phar'); + } require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar'; } } elseif ($type == 'city') { // geoip may have been already included with PEAR if ($geoipversion == '2' || ($geoipversion != 'php' && !function_exists('geoip_country_code_by_name'))) { - stream_wrapper_restore('phar'); + if (function_exists('stream_wrapper_restore')) { + stream_wrapper_restore('phar'); + } require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar'; } } else { diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 9c72c98721c..b1917f42ee8 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -48,6 +48,10 @@ class FormAccounting extends Form * @var int Nb of accounts found */ public $nbaccounts; + /** + * @var int Nb of accounts category found + */ + public $nbaccounts_category; /** @@ -235,7 +239,7 @@ class FormAccounting extends Form public function select_accounting_category($selected = '', $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0) { // phpcs:enable - global $db, $langs, $mysoc; + global $langs, $mysoc; if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries)) { dol_print_error('', 'Call to select_accounting_account with mysoc country not yet defined'); @@ -263,11 +267,15 @@ class FormAccounting extends Form $sql .= " ORDER BY c.label ASC"; } + $this->nbaccounts_category = 0; + dol_syslog(get_class($this).'::'.__METHOD__, LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { $num = $this->db->num_rows($resql); if ($num) { + $this->nbaccounts_category = $num; + $out = ''; $params = array('morecss'=>'reposition'); +$urlnew = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl); + $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd, $params); +$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', $urlnew, '', $permissiontoadd, $params); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index cbaa6bbca12..58e61c2d537 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1850,7 +1850,7 @@ if ($action == 'create') { print '
'; print '
'; - print ''; + print '
'; // Linked documents if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { @@ -1877,7 +1877,7 @@ if ($action == 'create') { // Delivery date planned print '
'; - print '
'; + print ''; @@ -2008,7 +2008,7 @@ if ($action == 'create') { // Sending method print '
'; print $langs->trans('DateDeliveryPlanned'); print '
'; - print ''; + print ''; } print '
'; + print ''; diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index cf7c5023bea..b64908d02e3 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -148,6 +148,7 @@ if ($action == 'updatelines' && $usercancreate) { $ent = "entrepot_".$reg[1].'_'.$reg[2]; $fk_commandedet = "fk_commandedet_".$reg[1].'_'.$reg[2]; $idline = GETPOST("idline_".$reg[1].'_'.$reg[2]); + $warehouse_id = GETPOSTINT($ent); $pu = "pu_".$reg[1].'_'.$reg[2]; // This is unit price including discount $lot = ''; $dDLUO = ''; @@ -159,11 +160,12 @@ if ($action == 'updatelines' && $usercancreate) { } $newqty = price2num(GETPOST($qty, 'alpha'), 'MS'); + //var_dump("modebatch=".$modebatch." newqty=".$newqty." ent=".$ent." idline=".$idline); // We ask to move a qty if (($modebatch == "batch" && $newqty >= 0) || ($modebatch == "barcode" && $newqty != 0)) { if ($newqty > 0) { // If we want a qty, we make test on input data - if (!(GETPOST($ent, 'int') > 0)) { + if (!($warehouse_id > 0)) { dol_syslog('No dispatch for line '.$key.' as no warehouse was chosen.'); $text = $langs->transnoentities('Warehouse').', '.$langs->transnoentities('Line').' '.($numline); setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors'); @@ -200,7 +202,7 @@ if ($action == 'updatelines' && $usercancreate) { $qtystart = 0; if ($idline > 0) { - $result = $expeditiondispatch->fetch($idline); + $result = $expeditiondispatch->fetch($idline); // get line from llx_expeditiondet if ($result < 0) { setEventMessages($expeditiondispatch->error, $expeditiondispatch->errors, 'errors'); $error++; @@ -225,13 +227,30 @@ if ($action == 'updatelines' && $usercancreate) { $sellby = dol_mktime(0, 0, 0, GETPOST('dlc'.$suffixkeyfordate.'month'), GETPOST('dlc'.$suffixkeyfordate.'day'), GETPOST('dlc'.$suffixkeyfordate.'year'), ''); $eatby = dol_mktime(0, 0, 0, GETPOST('dluo'.$suffixkeyfordate.'month'), GETPOST('dluo'.$suffixkeyfordate.'day'), GETPOST('dluo'.$suffixkeyfordate.'year')); - $sql = "UPDATE ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element." SET"; - $sql .= " eatby = ".($eatby ? "'".$db->idate($eatby)."'" : "null"); - $sql .= " , sellby = ".($sellby ? "'".$db->idate($sellby)."'" : "null"); - $sql .= " , qty = ".((float) $newqty); - // TODO Add a column fk_warehouse - $sql .= " WHERE fk_expeditiondet = ".((int) $idline); - $sql .= " AND batch = '".$db->escape($lot)."'"; + $sqlsearchdet = "SELECT rowid FROM ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element; + $sqlsearchdet .= " WHERE fk_expeditiondet = ".((int) $idline); + $sqlsearchdet .= " AND batch = '".$db->escape($lot)."'"; + $resqlsearchdet = $db->query($sqlsearchdet); + + if ($resqlsearchdet) { + $objsearchdet = $db->fetch_object($resqlsearchdet); + } else { + dol_print_error($db); + } + + if ($objsearchdet) { + $sql = "UPDATE ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element." SET"; + $sql .= " eatby = ".($eatby ? "'".$db->idate($eatby)."'" : "null"); + $sql .= " , sellby = ".($sellby ? "'".$db->idate($sellby)."'" : "null"); + $sql .= " , qty = ".((float) $newqty); + $sql .= " , fk_warehouse = ".((int) $warehouse_id); + $sql .= " WHERE rowid = ".((int) $objsearchdet->rowid); + } else { + $sql = "INSERT INTO ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element." ("; + $sql .= "fk_expeditiondet, eatby, sellby, batch, qty, fk_origin_stock, fk_warehouse)"; + $sql .= " VALUES (".((int) $idline).", ".($eatby ? "'".$db->idate($eatby)."'" : "null").", ".($sellby ? "'".$db->idate($sellby)."'" : "null").", "; + $sql .= " '".$db->escape($lot)."', ".((float) $newqty).", 0, ".((int) $warehouse_id).")"; + } } else { $sql = " DELETE FROM ".MAIN_DB_PREFIX.$expeditionlinebatch->table_element; $sql .= " WHERE fk_expeditiondet = ".((int) $idline); @@ -239,7 +258,7 @@ if ($action == 'updatelines' && $usercancreate) { } $resql = $db->query($sql); - if (!$db->query($sql)) { + if (!$resql) { dol_print_error($db); $error++; } @@ -317,6 +336,7 @@ if ($action == 'updatelines' && $usercancreate) { } } } + if ($error > 0) { $db->rollback(); setEventMessages($error, $errors, 'errors'); @@ -446,7 +466,7 @@ if ($object->id > 0 || !empty($object->ref)) { print '
'; print '
'; - print '
'; print $langs->trans('SendingMethod'); print '
'; + print '
'; // Linked documents if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { @@ -605,11 +625,11 @@ if ($object->id > 0 || !empty($object->ref)) { } print ''; if ($object->status == Expedition::STATUS_DRAFT) { - print ''; } - print ''; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { @@ -745,7 +765,12 @@ if ($object->id > 0 || !empty($object->ref)) { print ''; // Dispatch column print ''; // Warehouse column - $sql = "SELECT ed.rowid, ed.qty, ed.fk_entrepot, eb.batch, eb.eatby, eb.sellby, cd.fk_product FROM ".MAIN_DB_PREFIX."expeditiondet as ed"; + /*$sql = "SELECT cfd.rowid, cfd.qty, cfd.fk_entrepot, cfd.batch, cfd.eatby, cfd.sellby, cfd.fk_product"; + $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as cfd"; + $sql .= " WHERE cfd.fk_commandefourndet = ".(int) $objp->rowid;*/ + + $sql = "SELECT ed.rowid, ed.qty, ed.fk_entrepot, eb.batch, eb.eatby, eb.sellby, cd.fk_product"; + $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as eb on ed.rowid = eb.fk_expeditiondet"; $sql .= " JOIN ".MAIN_DB_PREFIX."commandedet as cd on ed.fk_origin_line = cd.rowid"; $sql .= " WHERE ed.fk_origin_line =".(int) $objp->rowid; @@ -761,7 +786,7 @@ if ($object->id > 0 || !empty($object->ref)) { $suffix = "_".$j."_".$i; $objd = $db->fetch_object($resultsql); - if (isModEnabled('productbatch') && !empty($objd->batch)) { + if (isModEnabled('productbatch') && (!empty($objd->batch) || (is_null($objd->batch) && $tmpproduct->status_batch > 0))) { $type = 'batch'; // Enable hooks to append additional columns @@ -798,7 +823,7 @@ if ($object->id > 0 || !empty($object->ref)) { print ''; print ''; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index d110660b6f5..cfad9f838b1 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -80,7 +80,7 @@ $result = @include_once $conffile; // Keep @ because with some error reporting t // Disable some not used PHP stream $listofwrappers = stream_get_wrappers(); -// We need '.phar' for geoip2. TODO Replace phar with explode files so we can disable phar. +// We need '.phar' for geoip2. TODO Replace phar in geoip with exploded files so we can disable phar. $arrayofstreamtodisable = array('compress.zlib', 'compress.bzip2', 'ftps', 'glob', 'data', 'expect', 'ftp', 'ogg', 'rar', 'zip', 'zlib'); foreach ($arrayofstreamtodisable as $streamtodisable) { if (!empty($listofwrappers) && in_array($streamtodisable, $listofwrappers)) { diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 09700c58855..a09b8d4fbf6 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -18,8 +18,8 @@ use Luracast\Restler\RestException; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; +require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; +require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php'; /** * API class for supplier invoices @@ -75,7 +75,7 @@ class SupplierInvoices extends DolibarrApi } if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } $this->invoice->fetchObjectLinked(); @@ -123,19 +123,19 @@ class SupplierInvoices extends DolibarrApi if (!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") || $search_sale > 0) { $sql .= ", sc.fk_soc, sc.fk_user"; } - $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn AS t LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields + $sql .= " FROM " . MAIN_DB_PREFIX . "facture_fourn AS t LEFT JOIN " . MAIN_DB_PREFIX . "facture_fourn_extrafields AS ef ON (ef.fk_object = t.rowid)"; // Modification VMR Global Solutions to include extrafields as search parameters in the API GET call, so we will be able to filter on extrafields // We need this table joined to the select in order to filter by sale if (!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") || $search_sale > 0) { - $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc"; } - $sql .= ' WHERE t.entity IN ('.getEntity('supplier_invoice').')'; + $sql .= ' WHERE t.entity IN (' . getEntity('supplier_invoice') . ')'; if (!DolibarrApiAccess::$user->hasRight("societe", "client", "voir") || $search_sale > 0) { $sql .= " AND t.fk_soc = sc.fk_soc"; } if ($socids) { - $sql .= " AND t.fk_soc IN (".$this->db->sanitize($socids).")"; + $sql .= " AND t.fk_soc IN (" . $this->db->sanitize($socids) . ")"; } if ($search_sale > 0) { $sql .= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale @@ -156,14 +156,14 @@ class SupplierInvoices extends DolibarrApi } // Insert sale filter if ($search_sale > 0) { - $sql .= " AND sc.fk_user = ".((int) $search_sale); + $sql .= " AND sc.fk_user = " . ((int) $search_sale); } // Add sql filters if ($sqlfilters) { $errormessage = ''; $sql .= forgeSQLFromUniversalSearchCriteria($sqlfilters, $errormessage); if ($errormessage) { - throw new RestException(400, 'Error when validating parameter sqlfilters -> '.$errormessage); + throw new RestException(400, 'Error when validating parameter sqlfilters -> ' . $errormessage); } } @@ -191,7 +191,7 @@ class SupplierInvoices extends DolibarrApi $i++; } } else { - throw new RestException(503, 'Error when retrieve supplier invoice list : '.$this->db->lasterror()); + throw new RestException(503, 'Error when retrieve supplier invoice list : ' . $this->db->lasterror()); } if (!count($obj_ret)) { throw new RestException(404, 'No supplier invoice found'); @@ -257,7 +257,7 @@ class SupplierInvoices extends DolibarrApi } if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } foreach ($request_data as $field => $value) { @@ -296,7 +296,7 @@ class SupplierInvoices extends DolibarrApi } if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } if ($this->invoice->delete(DolibarrApiAccess::$user) < 0) { @@ -339,7 +339,7 @@ class SupplierInvoices extends DolibarrApi } if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } $result = $this->invoice->validate(DolibarrApiAccess::$user, '', $idwarehouse, $notrigger); @@ -347,13 +347,13 @@ class SupplierInvoices extends DolibarrApi throw new RestException(304, 'Error nothing done. The invoice is already validated'); } if ($result < 0) { - throw new RestException(500, 'Error when validating Invoice: '.$this->invoice->error); + throw new RestException(500, 'Error when validating Invoice: ' . $this->invoice->error); } return array( 'success' => array( 'code' => 200, - 'message' => 'Invoice validated (Ref='.$this->invoice->ref.')' + 'message' => 'Invoice validated (Ref=' . $this->invoice->ref . ')' ) ); } @@ -381,7 +381,7 @@ class SupplierInvoices extends DolibarrApi } if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } $result = $this->invoice->fetch($id); @@ -410,6 +410,7 @@ class SupplierInvoices extends DolibarrApi * @param string $comment {@from body} Note (optional) * @param string $chqemetteur {@from body} Payment issuer (mandatory if payment_mode_id corresponds to 'CHQ'-payment type) * @param string $chqbank {@from body} Issuer bank name (optional) + * @param float $amount {@from body} Amount of payment if we don't want to use the remain to pay * * @url POST {id}/payments * @@ -418,7 +419,7 @@ class SupplierInvoices extends DolibarrApi * @throws RestException 401 * @throws RestException 404 */ - public function addPayment($id, $datepaye, $payment_mode_id, $closepaidinvoices, $accountid, $num_payment = '', $comment = '', $chqemetteur = '', $chqbank = '') + public function addPayment($id, $datepaye, $payment_mode_id, $closepaidinvoices, $accountid, $num_payment = '', $comment = '', $chqemetteur = '', $chqbank = '', $amount = null) { global $conf; @@ -430,7 +431,7 @@ class SupplierInvoices extends DolibarrApi } if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } if (isModEnabled("banque")) { @@ -449,18 +450,24 @@ class SupplierInvoices extends DolibarrApi throw new RestException(404, 'Invoice not found'); } - // Calculate amount to pay - $totalpaid = $this->invoice->getSommePaiement(); - $totaldeposits = $this->invoice->getSumDepositsUsed(); - $resteapayer = price2num($this->invoice->total_ttc - $totalpaid - $totaldeposits, 'MT'); + if (null !== $amount && $amount > 0) { + // We use the amount given in parameter + $paymentamount = $amount; + } else { + // We calculate the remain to pay, and use it as amount + $totalpaid = $this->invoice->getSommePaiement(); + $totaldeposits = $this->invoice->getSumDepositsUsed(); + $paymentamount = price2num($this->invoice->total_ttc - $totalpaid - $totaldeposits, 'MT'); + } $this->db->begin(); $amounts = array(); $multicurrency_amounts = array(); - $resteapayer = price2num($resteapayer, 'MT'); - $amounts[$id] = $resteapayer; + $paymentamount = price2num($paymentamount, 'MT'); + + $amounts[$id] = $paymentamount; // Multicurrency $newvalue = price2num($this->invoice->multicurrency_total_ttc, 'MT'); @@ -479,14 +486,14 @@ class SupplierInvoices extends DolibarrApi $paiement_id = $paiement->create(DolibarrApiAccess::$user, ($closepaidinvoices == 'yes' ? 1 : 0)); // This include closing invoices if ($paiement_id < 0) { $this->db->rollback(); - throw new RestException(400, 'Payment error : '.$paiement->error); + throw new RestException(400, 'Payment error : ' . $paiement->error); } if (isModEnabled("banque")) { $result = $paiement->addPaymentToBank(DolibarrApiAccess::$user, 'payment_supplier', '(SupplierInvoicePayment)', $accountid, $chqemetteur, $chqbank); if ($result < 0) { $this->db->rollback(); - throw new RestException(400, 'Add payment to bank error : '.$paiement->error); + throw new RestException(400, 'Add payment to bank error : ' . $paiement->error); } } @@ -516,7 +523,7 @@ class SupplierInvoices extends DolibarrApi } if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } $this->invoice->fetch_lines(); $result = array(); @@ -552,7 +559,7 @@ class SupplierInvoices extends DolibarrApi } if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } $request_data = (object) $request_data; @@ -586,7 +593,7 @@ class SupplierInvoices extends DolibarrApi ); if ($updateRes < 0) { - throw new RestException(400, 'Unable to insert the new line. Check your inputs. '.$this->invoice->error); + throw new RestException(400, 'Unable to insert the new line. Check your inputs. ' . $this->invoice->error); } return $updateRes; @@ -619,7 +626,7 @@ class SupplierInvoices extends DolibarrApi } if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } $request_data = (object) $request_data; @@ -690,7 +697,7 @@ class SupplierInvoices extends DolibarrApi } if (!DolibarrApi::_checkAccessToResource('fournisseur', $this->invoice->id, 'facture_fourn', 'facture')) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + throw new RestException(401, 'Access not allowed for login ' . DolibarrApiAccess::$user->login); } // TODO Check the lineid $lineid is a line of ojbect diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 93e1ad0c4d4..c06467d1d24 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -279,6 +279,7 @@ if (empty($reshook)) { $object->date_debut = $date_debut; $object->date_fin = $date_fin; $object->halfday = $halfday; + $object->entity = $conf->entity; $result = $object->create($user); if ($result <= 0) { @@ -657,7 +658,7 @@ if (empty($reshook)) { $societeName = $conf->global->MAIN_APPLICATION_TITLE; } - $subject = $societeName." - ".$langs->transnoentitiesnoconv("HolidaysValidated"); + $subject = '['.$societeName."] ".$langs->transnoentitiesnoconv("HolidaysValidated"); // Content $message = "

".$langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",

\n"; diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index a661758dfad..c4bc55bd067 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -260,7 +260,7 @@ if (isModEnabled('holiday') && $user->hasRight('holiday', 'read')) { $i++; } } else { - print ''; + print ''; } print '
'.$langs->trans("QtyOrdered").''.$langs->trans("QtyToDispatchShort"); // Qty to dispatch (sum for all lines of batch detail if there is) + print ''.$langs->trans("QtyToShip"); // Qty to dispatch (sum for all lines of batch detail if there is) } else { print ''.$langs->trans("QtyDispatchedShort").''.$langs->trans("QtyToDispatchShort"); + print ''.$langs->trans("Details"); print ''; - print ''; + print ''; //print ''; print '
'.$langs->trans("None").'
'.$langs->trans("None").'
'; print ''; @@ -332,7 +332,7 @@ if (isModEnabled('expensereport') && $user->hasRight('expensereport', 'read')) { $i++; } } else { - print '
'.$langs->trans("None").'
'.$langs->trans("None").'
'; print ''; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 9ad1dda460f..63a4c43c9b9 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -319,6 +319,8 @@ ErrorTheUrlOfYourDolInstanceDoesNotMatchURLIntoOAuthSetup=Error: The URL of you ErrorMenuExistValue=A Menu already exist with this Title or URL ErrorSVGFilesNotAllowedAsLinksWithout=SVG files are not allowed as external links without the option %s ErrorTypeMenu=Impossible to add another menu for the same module on the navbar, not handle yet +ErrorObjectNotFound = The object %s is not found, please check your url + ErrorTableExist=Table %s already exist ErrorDictionaryNotFound=Dictionary %s not found ErrorFailedToCreateSymLinkToMedias=Failed to create the symbolic link %s to point to %s diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 41ca1f5c7f0..2d25697845a 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -318,10 +318,12 @@ ErrorTheUrlOfYourDolInstanceDoesNotMatchURLIntoOAuthSetup=Erreur : L'URL de vot ErrorMenuExistValue=Un menu existe déjà avec ce titre ou cette URL ErrorSVGFilesNotAllowedAsLinksWithout=Les fichiers SVG ne sont pas autorisés en tant que liens externes sans l'option %s ErrorTypeMenu=Impossible d'ajouter un autre menu pour le même module sur la barre de navigation, pas encore géré +ErrorObjectNotFound=L'objet %s est introuvable verifier votre url ErrorTableExist=La table %s existe déja ErrorDictionaryNotFound=Le dictionnaire %s introuvable ErrorFailedToCreateSymLinkToMedias=Failed to create the symlinks %s to point to %s + # Warnings WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Votre paramètre PHP upload_max_filesize (%s) est supérieur au paramètre PHP post_max_size (%s). Ceci n'est pas une configuration cohérente. WarningPasswordSetWithNoAccount=Un mot de passe a été fixé pour cet adhérent. Cependant, aucun compte d'utilisateur n'a été créé. Donc, ce mot de passe est stocké, mais ne peut être utilisé pour accéder à Dolibarr. Il peut être utilisé par un module/interface externe, mais si vous n'avez pas besoin de définir ni login ni mot de passe pour un adhérent, vous pouvez désactiver l'option «Gérer un login pour chaque adhérent" depuis la configuration du module Adhérents. Si vous avez besoin de gérer un login, mais pas de mot de passe, vous pouvez laisser ce champ vide pour éviter cet avertissement. Remarque: L'email peut également être utilisé comme login si l'adhérent est lié à un utilisateur. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4057397c6e5..2528d402810 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1802,8 +1802,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr if (!defined('DISABLE_FONT_AWSOME')) { print ''."\n"; - print ''."\n"; - print ''."\n"; + $fontawesome_directory = getDolGlobalString('MAIN_FONTAWESOME_DIRECTORY', '/theme/common/fontawesome-5'); + print ''."\n"; } print ''."\n"; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 06dfdb70226..86aa539fa05 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -233,7 +233,6 @@ if ($dirins && $action == 'initmodule' && $modulename) { 'mymodule'=>strtolower($modulename), 'MyModule'=>$modulename ); - $result = dolCopyDir($srcdir, $destdir, 0, 0, $arrayreplacement); //dol_mkdir($destfile); if ($result <= 0) { @@ -379,6 +378,11 @@ if ($dirins && $action == 'initmodule' && $modulename) { dol_delete_file($destdir.'/README.md'); file_put_contents($destdir.'/README.md', $conf->global->MODULEBUILDER_SPECIFIC_README); } + // for create file to add properties + // file_put_contents($destdir.'/'.strtolower($modulename).'propertycard.php',''); + // $srcFileCard = DOL_DOCUMENT_ROOT.'/modulebuilder/card.php'; + // $destFileCard = $dirins.'/'.strtolower($modulename).'/template/card.php'; + // dol_copy($srcFileCard, $destdir.'/'.strtolower($modulename).'propertycard.php', 0,1, $arrayreplacement); } if (!$error) { @@ -1677,10 +1681,10 @@ if ($dirins && ($action == 'droptable' || $action == 'droptableextrafields') && } } -if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && !empty($tabobj)) { +if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && !empty(GETPOST('obj')) && $tabobj == "createproperty") { $error = 0; - $objectname = $tabobj; + $objectname = GETPOST('obj'); $dirins = $dirread = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; $moduletype = $listofmodules[strtolower($module)]['moduletype']; @@ -1689,6 +1693,11 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && $destdir = $dirins.'/'.strtolower($module); dol_mkdir($destdir); + $objects = dolGetListOfObjectClasses($destdir); + if (!in_array($objectname, array_values($objects))) { + $error++; + setEventMessages($langs->trans("ErrorObjectNotFound", $langs->transnoentities($objectname)), null, 'errors'); + } // We click on add property if (!GETPOST('regenerateclasssql') && !GETPOST('regeneratemissing')) { if (!GETPOST('propname', 'aZ09')) { @@ -1708,7 +1717,7 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && $addfieldentry = array( 'name'=>GETPOST('propname', 'aZ09'), 'label'=>GETPOST('proplabel', 'alpha'), - 'type'=>GETPOST('proptype', 'alpha'), + 'type'=>strtolower(GETPOST('proptype', 'alpha')), 'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}' 'visible'=>GETPOST('propvisible', 'int'), 'enabled'=>GETPOST('propenabled', 'int'), @@ -1727,8 +1736,6 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) && 'alwayseditable'=>intval(GETPOST('propalwayseditable', 'int')), 'validate' => GETPOST('propvalidate', 'int') ); - - if (!empty($addfieldentry['arrayofkeyval']) && !is_array($addfieldentry['arrayofkeyval'])) { $addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true); } @@ -3766,6 +3773,7 @@ if ($module == 'initmodule') { print dol_get_fiche_head($head3, $tabobj, '', -1, '', 0, '', '', 0, 'forobjectsuffix'); // Level 3 + if ($tabobj == 'newobject') { // New object tab print '
'; @@ -3821,6 +3829,134 @@ if ($module == 'initmodule') { */ print '
'; + } elseif ($tabobj == 'createproperty') { + $attributesUnique = array ( + 'propname' => $form->textwithpicto($langs->trans("Code"), $langs->trans("PropertyDesc"), 1, 'help', 'extracss', 0, 3, 'propertyhelp'), + 'proplabel' => $form->textwithpicto($langs->trans("Label"), $langs->trans("YouCanUseTranslationKey")), + 'proptype' => $form->textwithpicto($langs->trans("Type"), $langs->trans("TypeOfFieldsHelpIntro").'

'.$langs->trans("TypeOfFieldsHelp"), 1, 'help', 'extracss', 0, 3, 'typehelp'), + 'proparrayofkeyval' => $form->textwithpicto($langs->trans("ArrayOfKeyValues"), $langs->trans("ArrayOfKeyValuesDesc")), + 'propnotnull' => $form->textwithpicto($langs->trans("NotNull"), $langs->trans("NotNullDesc")), + 'propdefault' => $langs->trans("DefaultValue"), + 'propindex' => $langs->trans("DatabaseIndex"), + 'propforeignkey' => $form->textwithpicto($langs->trans("ForeignKey"), $langs->trans("ForeignKeyDesc"), 1, 'help', 'extracss', 0, 3, 'foreignkeyhelp'), + 'propposition' => $langs->trans("Position"), + 'propenabled' => $form->textwithpicto($langs->trans("Enabled"), $langs->trans("EnabledDesc"), 1, 'help', 'extracss', 0, 3, 'enabledhelp'), + 'propvisible' => $form->textwithpicto($langs->trans("Visibility"), $langs->trans("VisibleDesc").'

'.$langs->trans("ItCanBeAnExpression"), 1, 'help', 'extracss', 0, 3, 'visiblehelp'), + 'propnoteditable' => $langs->trans("NotEditable"), + 'propalwayseditable' => $langs->trans("AlwaysEditable"), + 'propsearchall' => $form->textwithpicto($langs->trans("SearchAll"), $langs->trans("SearchAllDesc")), + 'propisameasure' => $form->textwithpicto($langs->trans("IsAMeasure"), $langs->trans("IsAMeasureDesc")), + 'propcss' => $langs->trans("CSSClass"), + 'propcssview' => $langs->trans("CSSViewClass"), + 'propcsslist' => $langs->trans("CSSListClass"), + 'prophelp' => $langs->trans("KeyForTooltip"), + 'propshowoncombobox' => $langs->trans("ShowOnCombobox"), + 'propvalidate' => $form->textwithpicto($langs->trans("Validate"), $langs->trans("ValidateModBuilderDesc")), + 'propcomment' => $langs->trans("Comment"), + ); + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''."\n"; + $counter = 0; + foreach ($attributesUnique as $key => $attribute) { + if ($counter % 2 === 0) { + print ''; + } + if ($key == 'propname' || $key == 'proplabel') { + print ''; + } elseif ($key == 'proptype') { + print ''; + } elseif ($key == 'propvalidate') { + print ''; + } else { + print ''; + } + $counter++; + if ($counter % 2 === 0) { + print ''; + } + } + if ($counter % 2 !== 0) { + while ($counter % 2 !== 0) { + print ''; + $counter++; + } + print ''; + } + print '
'.$attribute.''.$attribute.'
'.$attribute.''.$attribute.'

'."\n"; + print '
'; + print ''; + print ''; + print '
'; + print '
'; + // javascript + print ''; } elseif ($tabobj == 'deleteobject') { // Delete object tab print '
'; @@ -3850,8 +3986,7 @@ if ($module == 'initmodule') { // Print form confirm print $formconfirm; } - - if ($action != 'editfile' || empty($file)) { + if ($action != 'editfile' || empty($file) ) { try { //$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath']; @@ -4123,8 +4258,13 @@ if ($module == 'initmodule') { print ''; print '

'; - print load_fiche_titre($langs->trans("ObjectProperties"), '', ''); + $mod = strtolower($module); + $obj = strtolower($tabobj); + $newproperty = dolGetButtonTitle($langs->trans('NewProperty'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/modulebuilder/index.php?tab=objects&module='.urlencode($module).'&tabobj=createproperty&obj='.urlencode($tabobj)); + print_barre_liste($langs->trans("ObjectProperties"), $page, $_SERVER["PHP_SELF"], '', '', '', '', '', 0, '', 0, $newproperty, '', '', 0, 0, 1); + + //var_dump($reflectorpropdefault);exit; print ''."\n"; print '
'; print ''; @@ -4166,37 +4306,7 @@ if ($module == 'initmodule') { // modified during the constructor and we want value into head of class before constructor is called. //$properties = dol_sort_array($tmpobject->fields, 'position'); $properties = dol_sort_array($reflectorpropdefault['fields'], 'position'); - if (!empty($properties)) { - // Line to add a property - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - //print ''; - print ''; - print ''; - print ''; - // List of existing properties foreach ($properties as $propkey => $propval) { /* If from Reflection diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 093814c3e08..dd8d06de73b 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -493,7 +493,7 @@ if (empty($reshook)) { } if (empty($ref)) { if (empty($conf->global->PRODUCT_GENERATE_REF_AFTER_FORM)) { - setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Ref')), null, 'errors'); + setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('ProductRef')), null, 'errors'); $action = "create"; $error++; } @@ -1369,7 +1369,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!empty($modCodeProduct->code_auto)) { $tmpcode = $modCodeProduct->getNextValue($object, $type); } - print ''; // Lines of title print ''; print_liste_field_titre('', $_SERVER["PHP_SELF"], ''); -print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder); +print_liste_field_titre('ProductRef', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder); print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder); if (isModEnabled("service") && $type == 1) { print_liste_field_titre('Duration', $_SERVER["PHP_SELF"], 'p.duration', $param, '', '', $sortfield, $sortorder, 'center '); diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 0e16bf8d68b..1f57ad3a934 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -487,7 +487,7 @@ if (!empty($search_fk_warehouse)) { // Lines of title print ''; -print_liste_field_titre('Ref', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder); +print_liste_field_titre('ProductRef', $_SERVER["PHP_SELF"], 'p.ref', $param, '', '', $sortfield, $sortorder); print_liste_field_titre('Label', $_SERVER["PHP_SELF"], 'p.label', $param, '', '', $sortfield, $sortorder); if ($mode == 'future') { @@ -502,13 +502,14 @@ if ($mode == 'future') { print_liste_field_titre('', $_SERVER["PHP_SELF"]); print_liste_field_titre('CurrentStock', $_SERVER["PHP_SELF"], $fieldtosortcurrentstock, $param, '', '', $sortfield, $sortorder, 'right '); } -print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right '); // Hook fields $parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; +print_liste_field_titre('', $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'right '); + print "\n"; $totalbuyingprice = 0; @@ -643,14 +644,14 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $totalcurrentstock += $currentstock; } - // Action - print ''; - // Fields from hook $parameters = array('objp'=>$objp); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; + // Action + print ''; + print ''."\n"; } $i++; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 5e6560ec898..9cbbdf33e73 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -2447,6 +2447,12 @@ class Project extends CommonObject } $return .= ''.dol_print_date($this->date_end, 'day').''; }*/ + if (property_exists($this, 'thirdparty') && is_object($this->thirdparty)) { + $return .= '
'.$this->thirdparty->getNomUrl(1); + $return .= '
'; + $return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone'); + $return .='
'; + } if (!empty($arraydata['assignedusers'])) { $return .= '
'; if ($this->public) { @@ -2468,9 +2474,11 @@ class Project extends CommonObject $return .= '
'.$langs->trans("OppStatus".$this->opp_status_code).''; $return .= ' ('.round($this->opp_percent).'%)'; $return .= '
'.price($this->opp_amount).''; + } else { + $return .= '
'; } if (method_exists($this, 'getLibStatut')) { - $return .= '
'.$this->getLibStatut(3).'
'; + $return .= '
'.$this->getLibStatut(3).'
'; } $return .= ''; $return .= ''; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 45c7c12f487..b8e449f0748 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1598,8 +1598,8 @@ class Task extends CommonObjectLine if ($timespent->id > 0) { $this->timespent_id = $timespent->id; $this->id = $timespent->fk_element; - $this->timespent_date = $this->db->jdate($timespent->element_date); - $this->timespent_datehour = $this->db->jdate($timespent->element_datehour); + $this->timespent_date = $timespent->element_date; + $this->timespent_datehour = $timespent->element_datehour; $this->timespent_withhour = $timespent->element_date_withhour; $this->timespent_duration = $timespent->element_duration; $this->timespent_fk_user = $timespent->fk_user; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 3d4904c272c..bad51c53bca 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1451,6 +1451,8 @@ while ($i < $imaxinloop) { $companystatic->town = $obj->town; $companystatic->country_code = $obj->country_code; + $object->thirdparty = $companystatic; + $stringassignedusers = ''; if (!empty($arrayfields['c.assigned']['checked'])) { @@ -1494,7 +1496,7 @@ while ($i < $imaxinloop) { } $selected = in_array($object->id, $arrayofselected); - $arrayofdata = array('assignedusers' => $stringassignedusers, 'selected' => $selected); + $arrayofdata = array('assignedusers' => $stringassignedusers, 'thirdparty'=>$companystatic, 'selected' => $selected); print $object->getKanbanView('', $arrayofdata); diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 4a76ca442c3..14362f0dfab 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -370,7 +370,9 @@ if (empty($reshook) && $action == 'add') { $msg = $arraydefaultmessage->content; } if (empty($labeltosue)) { - $labeltouse = '['.$mysoc->name.'] '.$langs->trans("YourMessage"); + $appli = $mysoc->name; + + $labeltouse = '['.$appli.'] '.$langs->trans("YourMessage"); $msg = $langs->trans("YourMessageHasBeenReceived"); } diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index ae194d7236a..b8f035c6e52 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -386,8 +386,9 @@ if (empty($reshook)) { $mimetype = $attachedfiles['mimes']; // Send email to customer + $appli = $mysoc->name; - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref, $object->track_id); + $subject = '['.$appli.'] '.$langs->transnoentities('TicketNewEmailSubject', $object->ref, $object->track_id); $message = ($conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->transnoentities('TicketNewEmailBody')).'

'; $message .= $langs->transnoentities('TicketNewEmailBodyInfosTicket').'
'; @@ -423,7 +424,9 @@ if (empty($reshook)) { // Send email to TICKET_NOTIFICATION_EMAIL_TO $sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO; if ($sendto) { - $subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id); + $appli = $mysoc->name; + + $subject = '['.$appli.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin', $object->ref, $object->track_id); $message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id).'

'; $message_admin .= '
  • '.$langs->trans('Title').' : '.$object->subject.'
  • '; $message_admin .= '
  • '.$langs->trans('Type').' : '.$object->type_label.'
  • '; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index d1b87656588..676e91857f4 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -5349,7 +5349,7 @@ class Societe extends CommonObject if ($code) { $sql .= " AND tc.code = '".$this->db->escape($code)."'"; } - $sql .= " AND sc.entity = ".getEntity($this->element); + $sql .= " AND sc.entity IN (".getEntity($this->element).")"; $sql .= " AND tc.source = 'external'"; $sql .= " AND tc.active=1"; diff --git a/htdocs/takepos/css/pos.css.php b/htdocs/takepos/css/pos.css.php index fe7a7aa53ac..281b3ec44e3 100644 --- a/htdocs/takepos/css/pos.css.php +++ b/htdocs/takepos/css/pos.css.php @@ -219,7 +219,7 @@ button.item_value.selected { div[aria-describedby="dialog-info"] button:before { content: "\f788"; - font-family: "Font Awesome 5 Free"; + font-family: ""; font-weight: 900; padding-right: 5px; } diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index ac0b25e8f82..d1445a929f0 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -132,7 +132,7 @@ div#topmenu-global-search-dropdown a::after, div#topmenu-quickadd-dropdown a::af .dropdown-toggle::after { - font-family: "Font Awesome 5 Free"; + font-family: ""; font-size: 0.7em; font-weight: 900; font-style: normal; @@ -375,7 +375,7 @@ a.dropdown-item { .dropdown-item::before { /* font part */ - font-family: "Font Awesome 5 Free"; + font-family: ""; font-weight: 900; font-style: normal; font-variant: normal; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 850b145fd08..e7fb8d582d3 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -1198,7 +1198,7 @@ div.divsearchfield { content: "\f080"; } .a-filter:before, .a-mesure:before { - font-family: "Font Awesome 5 Free"; + font-family: ""; font-weight: 600; padding-right: 5px; padding-left: 5px; @@ -3470,7 +3470,7 @@ div.tabsElem { /* div.tabsElem a.tabactive::before, div.tabsElem a.tabunactive::before { content: "\f0da"; - font-family: "Font Awesome 5 Free"; + font-family: ""; padding-right: 2px; font-weight: 900; } @@ -7526,7 +7526,7 @@ a.phpdebugbar-tab.phpdebugbar-active { font-weight: 600 !important; } .phpdebugbar-fa-tags, .phpdebugbar-fa-tasks, .phpdebugbar-indicator .fa { - font-family: "Font Awesome 5 Free"; + font-family: ""; font-weight: 600; } div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-warning:before, @@ -7544,7 +7544,7 @@ div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before, div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before, div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before { - font-family: "Font Awesome 5 Free" !important; + font-family: "" !important; } /* ============================================================================== */ @@ -8058,7 +8058,7 @@ table.jPicker { } } - + @media only screen and (max-width: 320px) { .dropdown dd ul { @@ -8099,7 +8099,5 @@ if (!empty($conf->global->THEME_CUSTOM_CSS)) { /* Must be at end */ div.flot-text .flot-tick-label .tickLabel, .fa-color-unset { color: unset; + } - - - diff --git a/htdocs/theme/eldy/main_menu_fa_icons.inc.php b/htdocs/theme/eldy/main_menu_fa_icons.inc.php index 395ab219056..818233649ea 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.inc.php +++ b/htdocs/theme/eldy/main_menu_fa_icons.inc.php @@ -5,7 +5,7 @@ .mainmenu::before{ /* font part */ - font-family: "Font Awesome 5 Free"; + font-family: ""; font-weight: 900; font-style: normal; font-variant: normal; diff --git a/htdocs/theme/md/dropdown.inc.php b/htdocs/theme/md/dropdown.inc.php index 45551b36842..72337ffcaa9 100644 --- a/htdocs/theme/md/dropdown.inc.php +++ b/htdocs/theme/md/dropdown.inc.php @@ -145,7 +145,7 @@ div#topmenu-global-search-dropdown a::after, div#topmenu-quickadd-dropdown a::af .dropdown-toggle::after { /* font part */ - font-family: "Font Awesome 5 Free"; + font-family: ""; font-size: 0.7em; font-weight: 900; font-style: normal; @@ -386,7 +386,7 @@ a.dropdown-item { .dropdown-item::before { /* font part */ - font-family: "Font Awesome 5 Free"; + font-family: ""; font-weight: 900; font-style: normal; font-variant: normal; diff --git a/htdocs/theme/md/main_menu_fa_icons.inc.php b/htdocs/theme/md/main_menu_fa_icons.inc.php index f2f5e247e78..f171ebdaa50 100644 --- a/htdocs/theme/md/main_menu_fa_icons.inc.php +++ b/htdocs/theme/md/main_menu_fa_icons.inc.php @@ -5,7 +5,7 @@ .mainmenu::before{ /* font part */ - font-family: "Font Awesome 5 Free"; + font-family: ""; font-weight: 900; font-style: normal; font-variant: normal; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 315f3caafbf..6ed7ecdc69b 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1450,7 +1450,7 @@ if ($conf->browser->layout == 'phone') { content: "\f080"; } .a-filter:before, .a-mesure:before { - font-family: "Font Awesome 5 Free"; + font-family: ""; font-weight: 600; padding-right: 5px; padding-left: 5px; @@ -7452,7 +7452,7 @@ a.phpdebugbar-tab.phpdebugbar-active { background-image: unset !important; } .phpdebugbar-indicator .fa { - font-family: "Font Awesome 5 Free"; + font-family: ""; font-weight: 600; } div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-warning:before, @@ -7470,7 +7470,7 @@ div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before, div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before, div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before { - font-family: "Font Awesome 5 Free" !important; + font-family: "" !important; } diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 08334b5efea..8e461338292 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1276,7 +1276,8 @@ class Ticket extends CommonObject $sql = "SELECT rowid, code, label, use_default, pos, description"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_type"; - $sql .= " WHERE active > 0"; + $sql .= " WHERE entity IN (".getEntity('c_ticket_type').")"; + $sql .= " AND active > 0"; $sql .= " ORDER BY pos"; dol_syslog(get_class($this)."::load_cache_type_tickets", LOG_DEBUG); $resql = $this->db->query($sql); @@ -1316,7 +1317,8 @@ class Ticket extends CommonObject $sql = "SELECT rowid, code, label, use_default, pos, description, public, active, force_severity, fk_parent"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category"; - $sql .= " WHERE active > 0 AND entity = ".((int) $conf->entity); + $sql .= " WHERE entity IN (".getEntity('c_ticket_category').")"; + $sql .= " AND active > 0"; if ($publicgroup > -1) { $sql .= " AND public = ".((int) $publicgroup); } @@ -1368,7 +1370,8 @@ class Ticket extends CommonObject $sql = "SELECT rowid, code, label, use_default, pos, description"; $sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_severity"; - $sql .= " WHERE active > 0"; + $sql .= " WHERE entity IN (".getEntity('c_ticket_severity').")"; + $sql .= " AND active > 0"; $sql .= " ORDER BY pos"; dol_syslog(get_class($this)."::loadCacheSeveritiesTickets", LOG_DEBUG); $resql = $this->db->query($sql); @@ -2625,8 +2628,9 @@ class Ticket extends CommonObject } if (!empty($sendto)) { - $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; - $subject = '['.$label_title.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); + $appli = getDolGlobalString('MAIN_APPLICATION_TITLE', $mysoc->name); + + $subject = '['.$appli.'- ticket #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); // Message send $message = $langs->trans('TicketMessageMailIntroText'); @@ -2674,8 +2678,8 @@ class Ticket extends CommonObject $sendto = array(); if (is_array($internal_contacts) && count($internal_contacts) > 0) { // Set default subject - $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; - $appli = $label_title; + $appli = getDolGlobalString('MAIN_APPLICATION_TITLE', $mysoc->name); + $subject = GETPOST('subject', 'alphanohtml') ? GETPOST('subject', 'alphanohtml') : '['.$appli.' - '.$langs->trans("Ticket").' #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); $message_intro = $langs->trans('TicketNotificationEmailBody', "#".$object->id); @@ -2755,8 +2759,8 @@ class Ticket extends CommonObject $sendto = array(); if (is_array($external_contacts) && count($external_contacts) > 0) { // Get default subject for email to external contacts - $label_title = empty($conf->global->MAIN_APPLICATION_TITLE) ? $mysoc->name : $conf->global->MAIN_APPLICATION_TITLE; - $appli = $mysoc->name; + $appli = getDolGlobalString('MAIN_APPLICATION_TITLE', $mysoc->name); + $subject = GETPOST('subject') ? GETPOST('subject') : '['.$appli.' - '.$langs->trans("Ticket").' #'.$object->track_id.'] '.$langs->trans('TicketNewMessage'); $message_intro = GETPOST('mail_intro') ? GETPOST('mail_intro', 'restricthtml') : getDolGlobalString('TICKET_MESSAGE_MAIL_INTRO'); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 26408e3b55a..cee6eb07465 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2428,12 +2428,9 @@ class User extends CommonObject // Load translation files required by the page $outputlangs->loadLangs(array("main", "errors", "users", "other")); - $appli = constant('DOL_APPLICATION_TITLE'); - if (!empty($conf->global->MAIN_APPLICATION_TITLE)) { - $appli = $conf->global->MAIN_APPLICATION_TITLE; - } + $appli = getDolGlobalString('MAIN_APPLICATION_TITLE', constant('DOL_APPLICATION_TITLE')); - $subject = '['.$mysoc->name.'] '.$outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli); + $subject = '['.$appli.'] '.$outputlangs->transnoentitiesnoconv("SubjectNewPassword", $appli); // Define $urlwithroot $urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index c8843d36209..9ffc0b1680d 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -1075,7 +1075,7 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase /** - * testDolFormatAddress + * testDolPrintPhone * * @return void */ @@ -1092,19 +1092,19 @@ class FunctionsLibTest extends PHPUnit\Framework\TestCase $object->country_code='FR'; $phone=dol_print_phone('1234567890', $object->country_code); - $this->assertEquals('12 34 56 78 90', $phone, 'Phone for FR 1'); + $this->assertEquals($phone, '12 34 56 78 90', 'Phone for FR 1'); $object->country_code='FR'; $phone=dol_print_phone('1234567890', $object->country_code, 0, 0, 0, ''); - $this->assertEquals('1234567890', $phone, 'Phone for FR 2'); + $this->assertEquals($phone, '1234567890', 'Phone for FR 2'); $object->country_code='FR'; $phone=dol_print_phone('1234567890', $object->country_code, 0, 0, 0, ' '); - $this->assertEquals('12 34 56 78 90', $phone, 'Phone for FR 3'); + $this->assertEquals($phone, '12 34 56 78 90', 'Phone for FR 3'); $object->country_code='CA'; $phone=dol_print_phone('1234567890', $object->country_code, 0, 0, 0, ' '); - $this->assertEquals('(123) 456-7890', $phone, 'Phone for CA 1'); + $this->assertEquals($phone, '(123) 456-7890', 'Phone for CA 1'); }
'; - print ''; - print '
'.$langs->trans("Ref").''; + print ''.$langs->trans("ProductRef").''; if ($refalreadyexists) { print $langs->trans("RefAlreadyExists"); } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 61e5cc26cb6..f74a1764738 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -6267,7 +6267,8 @@ class Product extends CommonObject 1 => $baseprice ); - for ($i = 1; $i <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $i++) { + $nbofproducts = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); + for ($i = 1; $i <= $nbofproducts; $i++) { $price = $baseprice; $price_min = $baseprice; diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 509c4b93131..c1689d81989 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -309,6 +309,13 @@ class Inventory extends CommonObject $sql .= " AND cp.fk_categorie IN (".$this->db->sanitize($this->categories_product).")"; $sql .= ")"; } + if (getDolGlobalInt('PRODUIT_SOUSPRODUITS')) { + $sql .= " AND NOT EXISTS ("; + $sql .= " SELECT pa.rowid"; + $sql .= " FROM ".$this->db->prefix()."product_association as pa"; + $sql .= " WHERE pa.fk_product_pere = ps.fk_product"; + $sql .= ")"; + } $inventoryline = new InventoryLine($this->db); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 0f99d58720e..b804f786c6a 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -220,7 +220,7 @@ $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? // Definition of array of fields for columns $arrayfields = array( 'p.rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), - 'p.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>10), + 'p.ref'=>array('label'=>'ProductRef', 'checked'=>1, 'position'=>10), //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))), 'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10), 'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10), @@ -852,16 +852,15 @@ if ($type === "") { if ($type === "") { $params['forcenohideoftext'] = 1; } -if ($type === "") { - $newcardbutton .= dolGetButtonTitle($langs->trans('NewProduct'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0', '', $perm, $params); - $type = Product::TYPE_SERVICE; -} - $label = 'NewProduct'; -if ($type == Product::TYPE_SERVICE) { - $label = 'NewService'; -} - $newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type, '', $perm, $params); +if ($type === "" || $type == Product::TYPE_PRODUCT) { + $label = 'NewProduct'; + $newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0', '', $perm, $params); +} +if ($type === "" || $type == Product::TYPE_SERVICE) { + $label = 'NewService'; + $newcardbutton .= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=1', '', $perm, $params); +} print ''; if ($optioncss != '') { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 9447187e16c..275e08373e2 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -773,7 +773,7 @@ print '