Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/opensurvey/card.php
This commit is contained in:
Laurent Destailleur 2021-09-30 16:32:40 +02:00
commit 673a2982a5
20 changed files with 67 additions and 43 deletions

View File

@ -318,6 +318,19 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
print "</tr>";
$i++;
}
// If no record found
if ($num == 0) {
/*$colspan = 1;
foreach ($arrayfields as $key => $val) {
if (!empty($val['checked'])) {
$colspan++;
}
}*/
$colspan = 8;
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
}
print "</table>";
print '</div>';

View File

@ -1175,6 +1175,8 @@ if ($id) {
$sql .= natural_search("r.code_region", $search_code);
} elseif ($search_code != '' && $id == 7) {
$sql .= natural_search("a.code", $search_code);
} elseif ($search_code != '' && $id == 10) {
$sql .= natural_search("t.code", $search_code);
} elseif ($search_code != '' && $id != 9) {
$sql .= natural_search("code", $search_code);
}

View File

@ -63,7 +63,7 @@ print '<br>';
print '<strong>'.$langs->trans("XDebug").'</strong>: ';
$test = !function_exists('xdebug_is_enabled');
if ($test) {
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotSlowedDownByThis");
print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' <span class="opacitymedium">'.$langs->trans("NotSlowedDownByThis").'</span>';
} else {
print img_picto('', 'warning').' '.$langs->trans("ModuleActivated", $langs->transnoentities("XDebug"));
print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';

View File

@ -110,7 +110,7 @@ if (!empty($conf->syslog->enabled)) {
print '<input type="radio" name="choice" id="choicetempfiles" value="tempfiles"';
print (!$choice || $choice == 'tempfiles' || $choice == 'allfiles') ? ' checked' : '';
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFiles").'</label><br><br>';
print '> <label for="choicetempfiles">'.$langs->trans("PurgeDeleteTemporaryFilesShort").'</label><br><br>';
print '<input type="radio" name="choice" id="choiceallfiles" value="confirm_allfiles"';
print ($choice && $choice == 'confirm_allfiles') ? ' checked' : '';

View File

@ -865,6 +865,7 @@ class ActionComm extends CommonObject
$this->fetchResources();
}
}
$this->db->free($resql);
} else {
$this->error = $this->db->lasterror();

View File

@ -206,6 +206,7 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
print '<td class="nowrap">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowraponall">';
print $tmpinvoice->getNomUrl(1, '');
print '</td>';
@ -222,15 +223,19 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
print '</td></tr></table>';
print '</td>';
print '<td class="left">';
print '<td class="tdoverflowmax150">';
print $thirdpartystatic->getNomUrl(1, 'customer', 44);
print '</td>';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ht).'</span></td>';
}
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).'</span></td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
print '<td>'.$tmpinvoice->getLibStatut(3, $obj->am).'</td>';
print '</tr>';
$total_ttc += $obj->total_ttc;

View File

@ -5324,7 +5324,7 @@ abstract class CommonObject
$ecmfile->gen_or_uploaded = 'generated';
$ecmfile->description = ''; // indexed content
$ecmfile->keywords = ''; // keyword content
$ecmfile->src_object_type = $this->table_element;
$ecmfile->src_object_type = $this->table_element.(empty($this->module) ? '' : '@'.$this->module);
$ecmfile->src_object_id = $this->id;
$result = $ecmfile->create($user);
@ -9405,6 +9405,11 @@ abstract class CommonObject
*/
public function setCategoriesCommon($categories, $type_categ = '', $remove_existing = true)
{
// Handle single category
if (!is_array($categories)) {
$categories = array($categories);
}
dol_syslog(get_class($this)."::setCategoriesCommon Oject Id:".$this->id.' type_categ:'.$type_categ.' nb tag add:'.count($categories), LOG_DEBUG);
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@ -9414,11 +9419,6 @@ abstract class CommonObject
return -1;
}
// Handle single category
if (!is_array($categories)) {
$categories = array($categories);
}
// Get current categories
$c = new Categorie($this->db);
$existing = $c->containing($this->id, $type_categ, 'id');

View File

@ -1674,7 +1674,8 @@ class FormFile
dol_include_once($hookmanager->resArray['classpath']);
if (array_key_exists('classname', $hookmanager->resArray) && !empty($hookmanager->resArray['classname'])) {
if (class_exists($hookmanager->resArray['classname'])) {
$object_instance = new ${$hookmanager->resArray['classname']}($this->db);
$tmpclassname = $hookmanager->resArray['classname'];
$object_instance = new $tmpclassname($this->db);
}
}
}
@ -1813,9 +1814,11 @@ class FormFile
print '</td>';
// File
// Check if document source has external module part, if it the case use it for module part on document.php
preg_match('/^[^@]*@([^@]*)$/', $modulepart.'@expertisemedical', $modulesuffix);
print '<td>';
//print "XX".$file['name']; //$file['name'] must be utf8
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart;
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.(empty($modulesuffix) ? $modulepart : $modulesuffix[1]);
if ($forcedownload) {
print '&attachment=1';
}
@ -1826,7 +1829,7 @@ class FormFile
//print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$');
print $this->showPreview($file, $modulepart, $file['relativename']);
print $this->showPreview($file, (empty($modulesuffix) ? $modulepart : $modulesuffix[1]), $file['relativename']);
print "</td>\n";

View File

@ -3732,7 +3732,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'action'=>'infobox-action', 'account'=>'infobox-bank_account', 'accountline'=>'infobox-bank_account', 'accountancy'=>'infobox-bank_account', 'asset'=>'infobox-bank_account',
'bank_account'=>'bg-infobox-bank_account',
'bill'=>'infobox-commande', 'billa'=>'infobox-commande', 'billr'=>'infobox-commande', 'billd'=>'infobox-commande',
'conferenceorbooth'=>'infobox-project',
'margin'=>'infobox-bank_account', 'conferenceorbooth'=>'infobox-project',
'cash-register'=>'infobox-bank_account', 'contract'=>'infobox-contrat', 'check'=>'font-status4', 'collab'=>'infobox-action', 'conversation'=>'infobox-contrat',
'donation'=>'infobox-commande', 'dolly'=>'infobox-commande', 'dollyrevert'=>'flip infobox-order_supplier',
'ecm'=>'infobox-action', 'eventorganization'=>'infobox-project',

View File

@ -78,7 +78,11 @@ class InterfaceContactRoles extends DolibarrTriggers
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$contactdefault = new Contact($this->db);
$contactdefault->socid = $socid;
$TContact = $contactdefault->getContactRoles($object->element);
$TContact = array();
if (method_exists($contactdefault, 'getContactRoles')) { // For backward compatibility
$TContact = $contactdefault->getContactRoles($object->element);
}
if (is_array($TContact) && !empty($TContact)) {
$TContactAlreadyLinked = array();

View File

@ -358,7 +358,7 @@ if (count($typeleaves) == 0) {
//var_dump($users['rowid'].' - '.$val['rowid']);
print '<td style="text-align:center">';
if ($canedit) {
print '<input type="text"'.($canedit ? '' : ' disabled="disabled"').' value="'.$nbtoshow.'" name="nb_holiday_'.$val['rowid'].'['.$users['rowid'].']" size="5" style="text-align: center;"/>';
print '<input type="text"'.($canedit ? '' : ' disabled="disabled"').' value="'.$nbtoshow.'" name="nb_holiday_'.$val['rowid'].'['.$users['rowid'].']" class="width75 center" />';
} else {
print $nbtoshow;
}

View File

@ -337,6 +337,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
),
'supplier_proposal' =>
array(
'lang' => 'supplier_proposal',
'groupName' => 'SupplierProposals',
'globalStatsKey' => 'askprice',
'stats' =>
@ -486,6 +487,9 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
}
if (!empty($boards)) {
if (!empty($groupElement['lang'])) {
$langs->load($groupElement['lang']);
}
$groupName = $langs->trans($groupElement['groupName']);
$groupKeyLowerCase = strtolower($groupKey);
$nbTotalForGroup = 0;

View File

@ -161,7 +161,7 @@ Purge=Purge
PurgeAreaDesc=This page allows you to delete all files generated or stored by Dolibarr (temporary files or all files in <b>%s</b> directory). Using this feature is not normally necessary. It is provided as a workaround for users whose Dolibarr is hosted by a provider that does not offer permissions to delete files generated by the web server.
PurgeDeleteLogFile=Delete log files, including <b>%s</b> defined for Syslog module (no risk of losing data)
PurgeDeleteTemporaryFiles=Delete all log and temporary files (no risk of losing data). Parameter can be 'tempfilesold', 'logfiles' or both 'tempfilesold+logfiles'. Note: Deletion of temporary files is done only if the temp directory was created more than 24 hours ago.
PurgeDeleteTemporaryFilesShort=Delete log and temporary files
PurgeDeleteTemporaryFilesShort=Delete log and temporary files (no risk of losing data)
PurgeDeleteAllFilesInDocumentsDir=Delete all files in directory: <b>%s</b>.<br>This will delete all generated documents related to elements (third parties, invoices etc...), files uploaded into the ECM module, database backup dumps and temporary files.
PurgeRunNow=Purge now
PurgeNothingToDelete=No directory or files to delete.

View File

@ -254,18 +254,6 @@ if ($action == 'edit') {
}
print '</td></tr>';
// EMail
//If linked user, then emails are going to be sent to users' email
if (!$object->fk_user_creat) {
print '<tr><td>'.$langs->trans("EMail").'</td><td>';
if ($action == 'edit') {
print '<input type="text" name="nouvelleadresse" class="minwith200" value="'.$object->mail_admin.'">';
} else {
print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1);
}
print '</td></tr>';
}
// Receive an email with each vote
print '<tr><td>'.$langs->trans('ToReceiveEMailForEachVote').'</td><td>';
if ($action == 'edit') {
@ -323,10 +311,14 @@ print '</td></tr>';
// Author
print '<tr><td>';
print $langs->trans("Author").'</td><td>';
if ($object->fk_user_creat) {
if ($object->fk_user_creat > 0) {
print $userstatic->getLoginUrl(1);
} else {
print dol_htmlentities($object->nom_admin);
if ($action == 'edit') {
print '<input type="text" name="nouvelleadresse" class="minwith200" value="'.$object->mail_admin.'">';
} else {
print dol_print_email($object->mail_admin, 0, 0, 1, 0, 1, 1);
}
}
print '</td></tr>';

View File

@ -170,7 +170,7 @@ if ($_SESSION["mailsonde"]) {
$cochemail = "checked";
}
print '<input type="checkbox" name="mailsonde" '.$cochemail.'> '.$langs->trans("ToReceiveEMailForEachVote").'<br>'."\n";
print '<input type="checkbox" id="mailsonde" name="mailsonde" '.$cochemail.'> <label for="mailsonde">'.$langs->trans("ToReceiveEMailForEachVote").'</label><br>'."\n";
if ($_SESSION['allow_comments']) {
$allow_comments = 'checked';
@ -178,7 +178,7 @@ if ($_SESSION['allow_comments']) {
if (GETPOSTISSET('allow_comments')) {
$allow_comments = GETPOST('allow_comments') ? 'checked' : '';
}
print '<input type="checkbox" name="allow_comments" '.$allow_comments.'"> '.$langs->trans('CanComment').'<br>'."\n";
print '<input type="checkbox" id="allow_comments" name="allow_comments" '.$allow_comments.'"> <label for="allow_comments">'.$langs->trans('CanComment').'</label><br>'."\n";
if ($_SESSION['allow_spy']) {
$allow_spy = 'checked';
@ -186,7 +186,7 @@ if ($_SESSION['allow_spy']) {
if (GETPOSTISSET('allow_spy')) {
$allow_spy = GETPOST('allow_spy') ? 'checked' : '';
}
print '<input type="checkbox" name="allow_spy" '.$allow_spy.'> '.$langs->trans('CanSeeOthersVote').'<br>'."\n";
print '<input type="checkbox" id="allow_spy" name="allow_spy" '.$allow_spy.'> <label for="allow_spy">'.$langs->trans('CanSeeOthersVote').'</label><br>'."\n";
if (GETPOST('choix_sondage')) {
if (GETPOST('choix_sondage') == 'date') {

View File

@ -640,7 +640,7 @@ if (empty($reshook)) {
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
if ($ret < 0) {
$error++;
}

View File

@ -2575,13 +2575,13 @@ class Societe extends CommonObject
$label .= ' '.$this->getLibStatut(5);
}
if (!empty($this->name)) {
$label .= '<br><b>'.$langs->trans('Name').':</b> '.dol_escape_htmltag($this->name);
if (!empty($this->name_alias)) {
$label .= ' ('.dol_escape_htmltag($this->name_alias).')';
}
$label .= '<br><b>'.$langs->trans('Name').':</b> '.dol_escape_htmltag($this->name);
if (!empty($this->name_alias)) {
$label .= ' ('.dol_escape_htmltag($this->name_alias).')';
}
if ($this->email) {
$label .= '<br>'.img_picto('', 'email', 'class="pictofixedwidth"').$this->email;
}
$label .= '<br>'.img_picto('', 'email', 'class="pictofixedwidth"').$this->email;
if (!empty($this->phone) || !empty($this->fax)) {
$phonelist = array();
if ($this->phone) {

View File

@ -44,8 +44,8 @@ $langs->loadLangs(array("admin", "cashdesk", "commercial"));
if (GETPOST('action', 'alpha') == 'set') {
$db->begin();
$res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_HEADER", GETPOST('TAKEPOS_HEADER', 'restricthtml'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_FOOTER", GETPOST('TAKEPOS_FOOTER', 'restricthtml'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_RECEIPT_NAME", GETPOST('TAKEPOS_RECEIPT_NAME', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_SHOW_CUSTOMER", GETPOST('TAKEPOS_SHOW_CUSTOMER', 'alpha'), 'chaine', 0, '', $conf->entity);
$res = dolibarr_set_const($db, "TAKEPOS_AUTO_PRINT_TICKETS", GETPOST('TAKEPOS_AUTO_PRINT_TICKETS', 'int'), 'int', 0, '', $conf->entity);

View File

@ -119,7 +119,7 @@ if (!empty($conf->global->TAKEPOS_HEADER) || !empty($conf->global->{$constFreeTe
if (!empty($conf->global->{$constFreeText})) {
$newfreetext .= make_substitutions($conf->global->{$constFreeText}, $substitutionarray);
}
print $newfreetext;
print nl2br($newfreetext);
}
?>
</p>