Merge branch 'develop' into useismodenabled

This commit is contained in:
Frédéric FRANCE 2022-06-10 10:07:41 +02:00 committed by GitHub
commit 38b18a68d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1022 changed files with 11346 additions and 7901 deletions

View File

@ -540,7 +540,7 @@ if ($action == 'create') {
print '</td>';
print '</tr>';
// Date document creation
// Date document export
print '<tr>';
print '<td class="titlefield">'.$langs->trans("DateExport").'</td>';
print '<td>';
@ -548,7 +548,7 @@ if ($action == 'create') {
print '</td>';
print '</tr>';
// Date document creation
// Date document validation
print '<tr>';
print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>';
print '<td>';
@ -607,6 +607,7 @@ if ($action == 'create') {
print '<br>';
$result = $object->fetchAllPerMvt($piece_num, $mode); // This load $object->linesmvt
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
} else {
@ -647,11 +648,14 @@ if ($action == 'create') {
print "</tr>\n";
// Empty line is the first line of $object->linesmvt
// So we must get the first line (the empty one) and put it at the end of the array
// in order to display it correctly to the user
$empty_line = array_shift($object->linesmvt);
$object->linesmvt[]= $empty_line;
// Add an empty line if there is not yet
if (!empty($object->linesmvt[0])) {
$tmpline = $object->linesmvt[0];
if (!empty($tmpline->numero_compte)) {
$line = new BookKeepingLine();
$object->linesmvt[] = $line;
}
}
foreach ($object->linesmvt as $line) {
print '<tr class="oddeven">';

View File

@ -606,9 +606,13 @@ class BookKeeping extends CommonObject
if (empty($this->credit)) {
$this->credit = 0;
}
if (empty($this->montant)) {
$this->montant = 0;
}
$this->debit = price2num($this->debit, 'MT');
$this->credit = price2num($this->credit, 'MT');
$this->montant = price2num($this->montant, 'MT');
$now = dol_now();
@ -1661,11 +1665,10 @@ class BookKeeping extends CommonObject
$this->doc_date = $this->db->jdate($obj->doc_date);
$this->doc_ref = $obj->doc_ref;
$this->doc_type = $obj->doc_type;
$this->date_creation = $obj->date_creation;
$this->date_modification = $obj->date_modification;
$this->date_export = $obj->date_export;
$this->date_validation = $obj->date_validated;
$this->date_validation = $obj->date_validation;
$this->date_creation = $this->db->jdate($obj->date_creation);
$this->date_modification = $this->db->jdate($obj->date_modification);
$this->date_export = $this->db->jdate($obj->date_export);
$this->date_validation = $this->db->jdate($obj->date_validation);
} else {
$this->error = "Error ".$this->db->lasterror();
dol_syslog(__METHOD__.$this->error, LOG_ERR);

View File

@ -84,7 +84,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute").'</a></div>';
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -87,7 +87,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute").'</a></div>';
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -89,7 +89,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -85,7 +85,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -84,7 +84,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -229,6 +229,7 @@ $sql .= " WHERE b.box_id = bd.rowid";
$sql .= " AND b.entity IN (0,".$conf->entity.")";
$sql .= " AND b.fk_user=0";
$sql .= " ORDER by b.position, b.box_order";
//print $sql;
dol_syslog("Search available boxes", LOG_DEBUG);
$resql = $db->query($sql);

View File

@ -94,7 +94,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -91,7 +91,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -92,7 +92,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -846,12 +846,15 @@ if (empty($reshook)) {
$_POST["code"] = preg_replace('/[^a-zA-Z0-9\-\+]/', '', GETPOST("code"));
}
$tablename = $tabname[$id];
$tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename);
// If check ok and action add, add the line
if ($ok && GETPOST('actionadd')) {
if ($tabrowid[$id]) {
// Get free id for insert
$newid = 0;
$sql = "SELECT MAX(".$tabrowid[$id].") as newid FROM ".MAIN_DB_PREFIX.$tabname[$id];
$sql = "SELECT MAX(".$tabrowid[$id].") as newid FROM ".MAIN_DB_PREFIX.$tablename;
$result = $db->query($sql);
if ($result) {
$obj = $db->fetch_object($result);
@ -862,7 +865,7 @@ if (empty($reshook)) {
}
// Add new entry
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$tabname[$id]." (";
$sql = "INSERT INTO ".MAIN_DB_PREFIX.$tablename." (";
// List of fields
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldinsert)) {
$sql .= $tabrowid[$id].",";
@ -887,7 +890,7 @@ if (empty($reshook)) {
} elseif ($value == 'taux' || $value == 'localtax1') {
$_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z
} elseif ($value == 'entity') {
$_POST[$keycode] = getEntity($tabname[$id]);
$_POST[$keycode] = getEntity($tablename);
}
if ($i) {
@ -938,7 +941,7 @@ if (empty($reshook)) {
}
// Modify entry
$sql = "UPDATE ".MAIN_DB_PREFIX.$tabname[$id]." SET ";
$sql = "UPDATE ".MAIN_DB_PREFIX.$tablename." SET ";
// Modifie valeur des champs
if ($tabrowid[$id] && !in_array($tabrowid[$id], $listfieldmodify)) {
$sql .= $tabrowid[$id]."=";
@ -956,7 +959,7 @@ if (empty($reshook)) {
} elseif ($field == 'taux' || $field == 'localtax1') {
$_POST[$keycode] = price2num(GETPOST($keycode), 8); // Note that localtax2 can be a list of rates separated by coma like X:Y:Z
} elseif ($field == 'entity') {
$_POST[$keycode] = getEntity($tabname[$id]);
$_POST[$keycode] = getEntity($tablename);
}
if ($i) {
@ -983,7 +986,7 @@ if (empty($reshook)) {
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
}
if (in_array('entity', $listfieldmodify)) {
$sql .= " AND entity = ".((int) getEntity($tabname[$id], 0));
$sql .= " AND entity = ".((int) getEntity($tablename, 0));
}
dol_syslog("actionmodify", LOG_DEBUG);
@ -1002,7 +1005,10 @@ if (empty($reshook)) {
$rowidcol = "rowid";
}
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tabname[$id]." WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
$tablename = $tabname[$id];
$tablename = preg_replace('/^'.preg_quote(MAIN_DB_PREFIX, '/').'/', '', $tablename);
$sql = "DELETE FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$rowidcol." = '".$db->escape($rowid)."'".($entity != '' ? " AND entity = ".(int) $entity : '');
dol_syslog("delete", LOG_DEBUG);
$result = $db->query($sql);

View File

@ -91,7 +91,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -91,7 +91,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -360,47 +360,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/emailcollector_list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
/*
// Ref bis
$morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->emailcollector->creer, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->emailcollector->creer, 'string', '', null, null, '', 1);
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
if ($user->rights->emailcollector->creer)
{
if ($action != 'classify')
{
$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>';
} else {
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
}
}
} else {
if (! empty($object->fk_project)) {
$proj = new Project($db);
$proj->fetch($object->fk_project);
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
$morehtmlref.=$proj->ref;
$morehtmlref.='</a>';
} else {
$morehtmlref.='';
}
}
}
*/
$morehtmlref .= '</div>';
$morehtml = $langs->trans("NbOfEmailsInInbox").' : ';
@ -562,7 +521,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$rulefilterobj->fetch($rulefilter['id']);
print '<tr class="oddeven">';
print '<td>';
print '<td title="'.dol_escape_htmltag($langs->trans("Filter").': '.$rulefilter['type']).'">';
print $langs->trans($arrayoftypes[$rulefilter['type']]['label']);
print '</td>';
print '<td>'.$rulefilter['rulevalue'].'</td>';
@ -584,9 +543,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<tr class="liste_titre nodrag nodrop">';
print '<td>'.img_picto('', 'technic', 'class="pictofixedwidth"').$form->textwithpicto($langs->trans("EmailcollectorOperations"), $langs->trans("EmailcollectorOperationsDesc")).'</td><td></td><td></td><td></td>';
print '</tr>';
// Add operation
print '<tr class="oddeven nodrag nodrop">';
print '<td>';
$arrayoftypes = array(
'loadthirdparty'=>$langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")),
'loadandcreatethirdparty'=>$langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")),
@ -618,6 +575,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
// Add operation
print '<tr class="oddeven nodrag nodrop">';
print '<td>';
print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300', 1);
print '</td><td>';
print '<input type="text" name="operationparam">';
@ -638,7 +598,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$ruleactionobj->fetch($ruleaction['id']);
print '<tr class="drag drop oddeven" id="row-'.$ruleaction['id'].'">';
print '<td>';
print '<td title="'.dol_escape_htmltag($langs->trans("Operation").': '.$ruleaction['type']).'">';
print '<!-- type of action: '.$ruleaction['type'].' -->';
if (array_key_exists($ruleaction['type'], $arrayoftypes)) {
print $langs->trans($arrayoftypes[$ruleaction['type']]);

View File

@ -205,7 +205,7 @@ $form = new Form($db);
$now = dol_now();
$help_url = "EN:Module_EMail_Collector|FR:Module_Collecteur_de_courrier_électronique|ES:Module_EMail_Collector";
$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("EmailCollector"));
$title = $langs->trans('EmailCollectors');
$morejs = array();
$morecss = array();

View File

@ -81,7 +81,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -85,7 +85,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -91,7 +91,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -92,7 +92,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -85,7 +85,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -85,7 +85,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -88,7 +88,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -84,7 +84,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -88,7 +88,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -89,7 +89,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -4,7 +4,7 @@
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012-2107 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021 Anthony Berton <bertonanthony@gmail.com>
* Copyright (C) 2021-2022 Anthony Berton <bertonanthony@gmail.com>
*
* 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
@ -166,6 +166,10 @@ if ($action == 'update') {
dolibarr_set_const($db, "PDF_SHOW_LINK_TO_ONLINE_PAYMENT", GETPOST('PDF_SHOW_LINK_TO_ONLINE_PAYMENT', 'alpha'), 'chaine', 0, '', $conf->entity);
}
if (GETPOSTISSET('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) {
dolibarr_set_const($db, "PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME", GETPOST('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME', 'alpha'), 'chaine', 0, '', $conf->entity);
}
if (GETPOSTISSET('PDF_USE_A')) {
dolibarr_set_const($db, "PDF_USE_A", GETPOST('PDF_USE_A', 'alpha'), 'chaine', 0, '', $conf->entity);
}
@ -564,6 +568,16 @@ print '<tr class="oddeven"><td>'.$langs->trans("ShowDetailsInPDFPageFoot").'</td
print $form->selectarray('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS : 0));
print '</td></tr>';
// Show alias in thirdparty name
/* Disabled because not yet completely implemented (does not work when we force a contact on object)
print '<tr class="oddeven"><td>'.$langs->trans("PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME").'</td><td>';
if ($conf->use_javascript_ajax) {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("THIRDPARTY_ALIAS"), '2' => $langs->trans("ALIAS_THIRDPARTY"));
print $form->selectarray("PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME", $arrval, getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME'));
}
*/
// Show online payment link on invoices
print '<tr class="oddeven"><td>'.$langs->trans("PDF_SHOW_LINK_TO_ONLINE_PAYMENT").'</td><td>';

View File

@ -94,7 +94,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -87,7 +87,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -174,10 +174,10 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'stock');
// Configuration header
$head = stocktransferAdminPrepareHead();
dol_fiche_head($head, 'settings', '', -1, "stocktransfer@stocktransfer");
print dol_get_fiche_head($head, 'settings', '', -1, "stocktransfer@stocktransfer");
// Setup page goes here
echo '<span class="opacitymedium">'.$langs->trans("StockTransferSetupPage").'</span>';
print '<span class="opacitymedium">'.$langs->trans("StockTransferSetupPage").'</span>';
/*if ($action == 'edit')
@ -478,7 +478,7 @@ if (empty($setupnotempty)) {
}
// Page end
dol_fiche_end();
print dol_get_fiche_end();
llxFooter();
$db->close();

View File

@ -89,7 +89,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -91,7 +91,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -89,7 +89,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -90,7 +90,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -80,7 +80,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?action=create\">".$langs->trans("NewAttribute").'</a></div>';
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -88,7 +88,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -88,7 +88,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -82,7 +82,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -1912,7 +1912,7 @@ if ($id > 0) {
$linkback = '';
// Link to other agenda views
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
$linkback .= img_picto($langs->trans("BackToList"), 'object_list', 'class="pictoactionview pictofixedwidth"');
$linkback .= img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="pictoactionview pictofixedwidth"');
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("BackToList").'</span>';
$linkback .= '</a>';
$linkback .= '</li>';

View File

@ -1145,8 +1145,16 @@ class ActionComm extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm ";
$sql .= " SET percent = '".$this->db->escape($this->percentage)."'";
if ($this->type_id > 0) {
$sql .= ", fk_action = '".$this->db->escape($this->type_id)."'";
$sql .= ", fk_action = ".(int) $this->type_id;
if (empty($this->type_code)) {
$cactioncomm = new CActionComm($this->db);
$result = $cactioncomm->fetch($this->type_id);
if ($result >= 0 && !empty($cactioncomm->code)) {
$this->type_code = $cactioncomm->code;
}
}
}
$sql .= ", code = " . (isset($this->type_code)? "'".$this->db->escape($this->type_code) . "'":"null");
$sql .= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "null");
$sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null');
$sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null');

View File

@ -139,7 +139,7 @@ if ($object->id > 0) {
print dol_get_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action');
$linkback = img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"');
$linkback = img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="hideonsmartphone pictoactionview"');
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list">'.$langs->trans("BackToList").'</a>';
// Link to other agenda views

View File

@ -497,7 +497,7 @@ print '<input type="hidden" name="mode" value="'.$mode.'">';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_calendarlist', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';

View File

@ -66,7 +66,7 @@ $object->info($object->id);
$head = actions_prepare_head($object);
print dol_get_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action');
$linkback = img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"');
$linkback = img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="hideonsmartphone pictoactionview"');
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
// Link to other agenda views

View File

@ -654,7 +654,7 @@ $viewday = is_object($object) ? dol_print_date($object->datep, '%d') : '';
$viewmode = '';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_calendarlist', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';

View File

@ -420,7 +420,7 @@ $massactionbutton = '';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_calendarlist', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';

View File

@ -101,7 +101,7 @@ $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m");
$week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W");
$day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d");
$pid = GETPOSTISSET("search_projectid") ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3);
$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha');
$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo'
$type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha');
$maxprint = ((GETPOST("maxprint", 'int') != '') ?GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW);
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
@ -432,7 +432,7 @@ $massactionbutton = '';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
$viewmode .= img_picto($langs->trans("List"), 'object_calendarlist', 'class="imgforviewmode pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
@ -514,7 +514,6 @@ $s = $newtitle;
print $s;
print '<div class="liste_titre liste_titre_bydiv centpercent">';
print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid);
print '</div>';

View File

@ -82,7 +82,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a></div>';
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -85,7 +85,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -128,7 +128,8 @@ class FormAdvTargetEmailing extends Form
$i++;
}
array_multisort($label, SORT_ASC, $countryArray);
$array1_sort_order = SORT_ASC;
array_multisort($label, $array1_sort_order, $countryArray);
foreach ($countryArray as $row) {
$label = dol_trunc($row['label'], $maxlength, 'middle');

View File

@ -766,7 +766,8 @@ if ($socid > 0) {
$tab_sqlobjOrder[] = $db->jdate($sqlobj->dc);
}
$db->free($resql2);
array_multisort($tab_sqlobjOrder, SORT_DESC, $tab_sqlobj);
$array1_sort_order = SORT_DESC;
array_multisort($tab_sqlobjOrder, $array1_sort_order, $tab_sqlobj);
$num = count($tab_sqlobj);
if ($num > 0) {
@ -926,7 +927,8 @@ if ($socid > 0) {
$tab_sqlobjOrder[] = $db->jdate($sqlobj->dc);
}
$db->free($resql2);
array_multisort($tab_sqlobjOrder, SORT_DESC, $tab_sqlobj);
$array1_sort_order = SORT_DESC;
array_multisort($tab_sqlobjOrder, $array1_sort_order, $tab_sqlobj);
$num = count($tab_sqlobj);
if ($num > 0) {

View File

@ -113,7 +113,7 @@ if ($action != 'edit') {
print '<tr class="oddeven">';
print '<td>&nbsp;</td><td><input name="label" type="text" class="maxwidth100"></td>';
print '<td></td>';
print '<td class="center"><input type="submit" name="add" class="button button-add" value="'.$langs->trans("Add").'"></td>';
print '<td class="center"><input type="submit" name="add" class="button button-add small" value="'.$langs->trans("Add").'"></td>';
print '</tr>';
}

View File

@ -550,7 +550,7 @@ foreach ($accounts as $key => $type) {
// Account type
if (!empty($arrayfields['accountype']['checked'])) {
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($objecttmp->type_lib[$objecttmp->type]).'">';
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($objecttmp->type_lib[$objecttmp->type]).'">';
print $objecttmp->type_lib[$objecttmp->type];
print '</td>';
if (!$i) {

View File

@ -83,7 +83,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -84,7 +84,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -84,7 +84,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -84,7 +84,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -5008,7 +5008,7 @@ if ($action == 'create') {
$paymentstatic->datepaye = $db->jdate($objp->dp);
$paymentstatic->ref = $objp->ref;
$paymentstatic->num_payment = $objp->num_payment;
$paymentstatic->payment_code = $objp->payment_code;
$paymentstatic->paiementcode = $objp->payment_code;
print '<tr class="oddeven"><td class="nowraponall">';
print $paymentstatic->getNomUrl(1);

View File

@ -104,11 +104,18 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
print getNumberInvoicesPieChart('customers');
print '<br>';
print getNumberInvoicesPieChart('fourn');
print '<br>';
if (!empty($conf->fournisseur->enabled)) {
print getNumberInvoicesPieChart('fourn');
print '<br>';
}
print getCustomerInvoiceDraftTable($max, $socid);
print '<br>';
print getDraftSupplierTable($max, $socid);
if (!empty($conf->fournisseur->enabled)) {
print '<br>';
print getDraftSupplierTable($max, $socid);
}
print '</div><div class="fichetwothirdright">';

View File

@ -79,8 +79,8 @@ class Paiement extends CommonObject
public $pos_change = 0; // Excess received in TakePOS cash payment
public $author;
public $paiementid; // Type of payment. Id saved into fields fk_paiement on llx_paiement
public $paiementcode; // Code of payment.
public $paiementid; // ID of mode of payment. Is saved into fields fk_paiement on llx_paiement = id of llx_c_paiement
public $paiementcode; // Code of mode of payment.
/**
* @var string Type of payment label

View File

@ -78,6 +78,8 @@ class BonPrelevement extends CommonObject
public $statut; // 0-Wait, 1-Trans, 2-Done
public $labelStatus = array();
public $factures = array();
public $invoice_in_error = array();
public $thirdparty_in_error = array();
@ -913,6 +915,7 @@ class BonPrelevement extends CommonObject
$this->db->begin();
$now = dol_now();
$ref = '';
/*
* Process order generation
@ -1485,7 +1488,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, ' <NbOfTxs>'.$i.'</NbOfTxs>'.$CrLf);
fputs($this->file, ' <CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf);
fputs($this->file, ' <InitgPty>'.$CrLf);
fputs($this->file, ' <Nm>'.dolEscapeXML(strtoupper(dol_string_unaccent($this->raison_sociale))).'</Nm>'.$CrLf);
fputs($this->file, ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf);
fputs($this->file, ' <Id>'.$CrLf);
fputs($this->file, ' <PrvtId>'.$CrLf);
fputs($this->file, ' <Othr>'.$CrLf);
@ -1601,7 +1604,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, ' <NbOfTxs>'.$i.'</NbOfTxs>'.$CrLf);
fputs($this->file, ' <CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf);
fputs($this->file, ' <InitgPty>'.$CrLf);
fputs($this->file, ' <Nm>'.dolEscapeXML(strtoupper(dol_string_unaccent($this->raison_sociale))).'</Nm>'.$CrLf);
fputs($this->file, ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf);
fputs($this->file, ' <Id>'.$CrLf);
fputs($this->file, ' <PrvtId>'.$CrLf);
fputs($this->file, ' <Othr>'.$CrLf);
@ -1851,16 +1854,16 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .= ' </FinInstnId>'.$CrLf;
$XML_DEBITOR .= ' </DbtrAgt>'.$CrLf;
$XML_DEBITOR .= ' <Dbtr>'.$CrLf;
$XML_DEBITOR .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_unaccent($row_nom))).'</Nm>'.$CrLf;
$XML_DEBITOR .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom)))).'</Nm>'.$CrLf;
$XML_DEBITOR .= ' <PstlAdr>'.$CrLf;
$XML_DEBITOR .= ' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
$addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => ""));
if (trim($addressline1)) {
$XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_unaccent($addressline1), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
if (trim($addressline2)) {
$XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_unaccent($addressline2), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
$XML_DEBITOR .= ' </PstlAdr>'.$CrLf;
$XML_DEBITOR .= ' </Dbtr>'.$CrLf;
@ -1920,16 +1923,16 @@ class BonPrelevement extends CommonObject
$XML_CREDITOR .= ' </FinInstnId>'.$CrLf;
$XML_CREDITOR .= ' </CdtrAgt>'.$CrLf;
$XML_CREDITOR .= ' <Cdtr>'.$CrLf;
$XML_CREDITOR .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_unaccent($row_nom))).'</Nm>'.$CrLf;
$XML_CREDITOR .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom)))).'</Nm>'.$CrLf;
$XML_CREDITOR .= ' <PstlAdr>'.$CrLf;
$XML_CREDITOR .= ' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
$addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => ""));
if (trim($addressline1)) {
$XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_unaccent($addressline1), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
if (trim($addressline2)) {
$XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_unaccent($addressline2), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
$XML_CREDITOR .= ' </PstlAdr>'.$CrLf;
$XML_CREDITOR .= ' </Cdtr>'.$CrLf;
@ -2093,16 +2096,16 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' </PmtTpInf>'.$CrLf;
$XML_SEPA_INFO .= ' <ReqdColltnDt>'.$dateTime_ETAD.'</ReqdColltnDt>'.$CrLf;
$XML_SEPA_INFO .= ' <Cdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_unaccent($this->raison_sociale))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => ""));
if ($addressline1) {
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_unaccent($addressline1), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
if ($addressline2) {
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_unaccent($addressline2), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </Cdtr>'.$CrLf;
@ -2117,11 +2120,11 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' </FinInstnId>'.$CrLf;
$XML_SEPA_INFO .= ' </CdtrAgt>'.$CrLf;
/* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_unaccent($this->raison_sociale))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>').$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS))).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/
$XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf; // Field "Responsible of fees". Must be SLEV
@ -2159,16 +2162,16 @@ class BonPrelevement extends CommonObject
}
$XML_SEPA_INFO .= ' <ReqdExctnDt>'.dol_print_date($dateTime_ETAD, 'dayrfc').'</ReqdExctnDt>'.$CrLf;
$XML_SEPA_INFO .= ' <Dbtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_unaccent($this->raison_sociale))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => ""));
if ($addressline1) {
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_unaccent($addressline1), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
if ($addressline2) {
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_unaccent($addressline2), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </Dbtr>'.$CrLf;
@ -2183,11 +2186,11 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' </FinInstnId>'.$CrLf;
$XML_SEPA_INFO .= ' </DbtrAgt>'.$CrLf;
/* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_unaccent($this->raison_sociale))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS))).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/
$XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf; // Field "Responsible of fees". Must be SLEV

View File

@ -551,11 +551,11 @@ if ($id > 0) {
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
$morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'fk_project', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'fk_project', 0, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref .= '</form>';
} else {
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, 0, $object->fk_project, 'none', 0, 0, 0, 1);
}
} else {
if (!empty($object->fk_project)) {

View File

@ -84,7 +84,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -84,7 +84,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?action=create#newattrib\">".$langs->trans("NewAttribute")."</a>";
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -31,6 +31,11 @@
// $noback may be defined
// $triggermodname may be defined
$hidedetails = isset($hidedetails) ? $hidedetails : '';
$hidedesc = isset($hidedesc) ? $hidedesc : '';
$hideref = isset($hideref) ? $hideref : '';
if (!empty($permissionedit) && empty($permissiontoadd)) {
$permissiontoadd = $permissionedit; // For backward compatibility
}
@ -381,10 +386,10 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) {
if (method_exists($object, 'generateDocument')) {
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {

View File

@ -1,195 +0,0 @@
<?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2015-2020 Frederic France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/boxes/box_members.php
* \ingroup adherent
* \brief Module to show box of members
*/
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
/**
* Class to manage the box to show last members
*/
class box_members extends ModeleBoxes
{
public $boxcode = "lastmembers";
public $boximg = "object_user";
public $boxlabel = "BoxLastMembers";
public $depends = array("adherent");
/**
* @var DoliDB Database handler.
*/
public $db;
public $param;
public $enabled = 1;
public $info_box_head = array();
public $info_box_contents = array();
/**
* Constructor
*
* @param DoliDB $db Database handler
* @param string $param More parameters
*/
public function __construct($db, $param = '')
{
global $conf, $user;
$this->db = $db;
// disable module for such cases
$listofmodulesforexternal = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
if (!in_array('adherent', $listofmodulesforexternal) && !empty($user->socid)) {
$this->enabled = 0; // disabled for external users
}
$this->hidden = !($user->rights->adherent->lire);
}
/**
* Load data into info_box_contents array to show array later.
*
* @param int $max Maximum number of records to load
* @return void
*/
public function loadBox($max = 5)
{
global $user, $langs, $conf;
$langs->load("boxes");
$this->max = $max;
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
$memberstatic = new Adherent($this->db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedMembers", $max));
if ($user->rights->adherent->lire) {
$sql = "SELECT a.rowid, a.ref, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql .= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
$sql .= ' a.photo, a.email, a.gender, a.morphy,';
$sql .= " t.subscription, t.libelle as label";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t";
$sql .= " WHERE a.entity IN (".getEntity('member').")";
$sql .= " AND a.fk_adherent_type = t.rowid";
$sql .= " ORDER BY a.tms DESC";
$sql .= $this->db->plimit($max, 0);
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);
$line = 0;
while ($line < $num) {
$objp = $this->db->fetch_object($result);
$datec = $this->db->jdate($objp->datec);
$datem = $this->db->jdate($objp->tms);
$memberstatic->lastname = $objp->lastname;
$memberstatic->firstname = $objp->firstname;
$memberstatic->id = $objp->rowid;
$memberstatic->ref = $objp->ref;
$memberstatic->photo = $objp->photo;
$memberstatic->gender = $objp->gender;
$memberstatic->email = $objp->email;
$memberstatic->morphy = $objp->morphy;
$memberstatic->company = $objp->company;
$memberstatic->statut = $objp->status;
$memberstatic->date_creation = $datec;
$memberstatic->date_modification = $datem;
$memberstatic->need_subscription = $objp->subscription;
$memberstatic->datefin = $this->db->jdate($objp->date_end_subscription);
if (!empty($objp->fk_soc)) {
$memberstatic->socid = $objp->fk_soc;
$memberstatic->fetch_thirdparty();
$memberstatic->name = $memberstatic->thirdparty->name;
} else {
$memberstatic->name = $objp->company;
}
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $memberstatic->getNomUrl(-1),
'asis' => 1,
);
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $memberstatic->company,
'url' => DOL_URL_ROOT."/adherents/card.php?rowid=".$objp->rowid,
);
$this->info_box_contents[$line][] = array(
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"',
'text' => dol_print_date($datem, "day", 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
'td' => 'class="right" width="18"',
'text' => $memberstatic->LibStatut($objp->status, $objp->subscription, $this->db->jdate($objp->date_end_subscription), 3),
);
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'text'=>$langs->trans("NoRecordedCustomers"),
);
}
$this->db->free($result);
} else {
$this->info_box_contents[0][0] = array(
'td' => '',
'maxlength'=>500,
'text' => ($this->db->error().' sql='.$sql),
);
}
} else {
$this->info_box_contents[0][0] = array(
'td' => 'class="nohover opacitymedium left"',
'text' => $langs->trans("ReadPermissionNotAllowed")
);
}
}
/**
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return string
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
/**
* Class to manage the box to show last modofied members
* Class to manage the box to show last modified members
*/
class box_members_last_modified extends ModeleBoxes
{
@ -92,7 +92,7 @@ class box_members_last_modified extends ModeleBoxes
if ($user->rights->adherent->lire) {
$sql = "SELECT a.rowid, a.ref, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql .= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
$sql .= " a.datec, a.tms as datem, a.statut as status, a.datefin as date_end_subscription,";
$sql .= ' a.photo, a.email, a.gender, a.morphy,';
$sql .= " t.rowid as typeid, t.subscription, t.libelle as label";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t";
@ -121,6 +121,8 @@ class box_members_last_modified extends ModeleBoxes
$memberstatic->morphy = $objp->morphy;
$memberstatic->company = $objp->company;
$memberstatic->statut = $objp->status;
$memberstatic->date_creation = $datec;
$memberstatic->date_modification = $datem;
$memberstatic->need_subscription = $objp->subscription;
$memberstatic->datefin = $this->db->jdate($objp->date_end_subscription);
if (!empty($objp->fk_soc)) {
@ -140,6 +142,11 @@ class box_members_last_modified extends ModeleBoxes
'asis' => 1,
);
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' =>$memberstatic->company,
);
$this->info_box_contents[$line][] = array(
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
'text' => $statictype->getNomUrl(1, 32),
@ -147,7 +154,7 @@ class box_members_last_modified extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
'td' => 'class="center nowraponall"',
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"',
'text' => dol_print_date($datem, "day", 'tzuserrel'),
);

View File

@ -151,7 +151,7 @@ class Canvas
public function assign_values(&$action = 'view', $id = 0, $ref = '')
{
// phpcs:enable
if (method_exists($this->control, 'assign_values')) {
if (is_object($this->control) && method_exists($this->control, 'assign_values')) {
$this->control->assign_values($action, $id, $ref);
}
}

View File

@ -447,8 +447,9 @@ abstract class CommonDocGenerator
$resarray = array(
$array_key.'_id'=>$object->id,
$array_key.'_ref'=>$object->ref,
$array_key.'_ref_ext'=>$object->ref_ext,
$array_key.'_ref' => (property_exists($object, 'ref') ? $object->ref : ''),
$array_key.'_label' => (property_exists($object, 'label') ? $object->label : ''),
$array_key.'_ref_ext' => (property_exists($object, 'ref_ext') ? $object->ref_ext : ''),
$array_key.'_ref_customer'=>(!empty($object->ref_client) ? $object->ref_client : (empty($object->ref_customer) ? '' : $object->ref_customer)),
$array_key.'_ref_supplier'=>(!empty($object->ref_fournisseur) ? $object->ref_fournisseur : (empty($object->ref_supplier) ? '' : $object->ref_supplier)),
$array_key.'_source_invoice_ref'=>$invoice_source->ref,
@ -469,7 +470,7 @@ abstract class CommonDocGenerator
$array_key.'_payment_term_code'=>$object->cond_reglement_code,
$array_key.'_payment_term'=>($outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) != 'PaymentCondition'.$object->cond_reglement_code ? $outputlangs->transnoentitiesnoconv('PaymentCondition'.$object->cond_reglement_code) : ($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement)),
$array_key.'_incoterms'=>(method_exists($object, 'display_incoterms') ? $object->display_incoterms() : ''),
$array_key.'_incoterms' => (method_exists($object, 'display_incoterms') ? $object->display_incoterms() : ''),
$array_key.'_bank_iban'=>$bank_account->iban,
$array_key.'_bank_bic'=>$bank_account->bic,
@ -834,25 +835,38 @@ abstract class CommonDocGenerator
*
* @param Object $object Dolibarr Object
* @param Translate $outputlangs Language object for output
* @param boolean $recursive Want to fetch child array or child object
* @param boolean|int $recursive Want to fetch child array or child object.
* @return array Array of substitution key->code
*/
public function get_substitutionarray_each_var_object(&$object, $outputlangs, $recursive = true)
public function get_substitutionarray_each_var_object(&$object, $outputlangs, $recursive = 1)
{
// phpcs:enable
$array_other = array();
if (!empty($object)) {
foreach ($object as $key => $value) {
if (in_array($key, array('db', 'fields', 'lines', 'modelpdf', 'model_pdf'))) { // discard some properties
continue;
}
if (!empty($value)) {
if (!is_array($value) && !is_object($value)) {
$array_other['object_'.$key] = $value;
}
if (is_array($value) && $recursive) {
$array_other['object_'.$key] = $this->get_substitutionarray_each_var_object($value, $outputlangs, false);
} elseif (is_array($value) && $recursive) {
$tmparray = $this->get_substitutionarray_each_var_object($value, $outputlangs, 0);
foreach ($tmparray as $key2 => $value2) {
$array_other['object_'.$key.'_'.preg_replace('/^object_/', '', $key2)] = $value2;
}
} elseif (is_object($value) && $recursive) {
$tmparray = $this->get_substitutionarray_each_var_object($value, $outputlangs, 0);
foreach ($tmparray as $key2 => $value2) {
$array_other['object_'.$key.'_'.preg_replace('/^object_/', '', $key2)] = $value2;
}
}
}
}
}
//var_dump($array_other);
return $array_other;
}

View File

@ -64,7 +64,9 @@ trait CommonIncoterm
$result = $this->db->query($sql);
if ($result) {
$res = $this->db->fetch_object($result);
$out .= $res->code;
if ($res) {
$out .= $res->code;
}
}
}
@ -76,7 +78,7 @@ trait CommonIncoterm
/**
* Return incoterms informations for pdf display
*
* @return string incoterms info
* @return string|boolean Incoterms info or false
*/
public function getIncotermsForPDF()
{
@ -86,7 +88,11 @@ trait CommonIncoterm
$num = $this->db->num_rows($resql);
if ($num > 0) {
$res = $this->db->fetch_object($resql);
return 'Incoterm : '.$res->code.' - '.$this->location_incoterms;
if ($res) {
return 'Incoterm : '.$res->code.' - '.$this->location_incoterms;
} else {
return $res;
}
} else {
return '';
}

View File

@ -2649,7 +2649,9 @@ abstract class CommonObject
$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
$sql .= " , deposit_percent = " . (! empty($deposit_percent) ? "'".$this->db->escape($deposit_percent)."'" : 'NULL');
if (in_array($this->table_element, array('propal', 'commande'))) {
$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
}
$sql .= ' WHERE rowid='.((int) $this->id);
if ($this->db->query($sql)) {
@ -7998,7 +8000,11 @@ abstract class CommonObject
}
// Convert float submited string into real php numeric (value in memory must be a php numeric)
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('price', 'double'))) {
$value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) || $value) ? price2num($value) : $this->array_options['options_'.$key];
if (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) || $value) {
$value = price2num($value);
} elseif (isset($this->array_options['options_'.$key])) {
$value = $this->array_options['options_'.$key];
}
}
// HTML, text, select, integer and varchar: take into account default value in database if in create mode

View File

@ -817,7 +817,8 @@ class ExtraFields
$array_name_label = array();
// We should not have several time this request. If we have, there is some optimization to do by calling a simple $extrafields->fetch_optionals() in top of code and not into subcode
$sql = "SELECT rowid, name, label, type, size, elementtype, fieldunique, fieldrequired, param, pos, alwayseditable, perms, langs, list, printable, totalizable, fielddefault, fieldcomputed, entity, enabled, help";
$sql = "SELECT rowid, name, label, type, size, elementtype, fieldunique, fieldrequired, param, pos, alwayseditable, perms, langs, list, printable, totalizable, fielddefault, fieldcomputed, entity, enabled, help,";
$sql .= " css, cssview, csslist";
$sql .= " FROM ".$this->db->prefix()."extrafields";
//$sql.= " WHERE entity IN (0,".$conf->entity.")"; // Filter is done later
if ($elementtype) {
@ -866,6 +867,9 @@ class ExtraFields
$this->attributes[$tab->elementtype]['entityid'][$tab->name] = $tab->entity;
$this->attributes[$tab->elementtype]['enabled'][$tab->name] = $tab->enabled;
$this->attributes[$tab->elementtype]['help'][$tab->name] = $tab->help;
$this->attributes[$tab->elementtype]['css'][$tab->name] = $tab->css;
$this->attributes[$tab->elementtype]['cssview'][$tab->name] = $tab->cssview;
$this->attributes[$tab->elementtype]['csslist'][$tab->name] = $tab->csslist;
$this->attributes[$tab->elementtype]['loaded'] = 1;
}
@ -1667,13 +1671,15 @@ class ExtraFields
}
} else {
$translabel = '';
if (!empty($obj->{$InfoFieldList[1]})) {
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
$tmppropname = $InfoFieldList[1];
//$obj->$tmppropname = '';
if (!empty(isset($obj->$tmppropname) ? $obj->$tmppropname : '')) {
$translabel = $langs->trans($obj->$tmppropname);
}
if ($translabel != $obj->{$InfoFieldList[1]}) {
if ($translabel != (isset($obj->$tmppropname) ? $obj->$tmppropname : '')) {
$value = dol_trunc($translabel, 18);
} else {
$value = $obj->{$InfoFieldList[1]};
$value = isset($obj->$tmppropname) ? $obj->$tmppropname : '';
}
}
} else {
@ -1838,7 +1844,7 @@ class ExtraFields
}
/**
* Return tag to describe alignement to use for this extrafield
* Return the CSS to use for this extrafield into list
*
* @param string $key Key of attribute
* @param string $extrafieldsobjectkey If defined, use the new method to get extrafields data
@ -1854,29 +1860,33 @@ class ExtraFields
$type = $this->attribute_type[$key];
}
$align = '';
$cssstring = '';
if ($type == 'date') {
$align = "center";
$cssstring = "center";
} elseif ($type == 'datetime') {
$align = "center";
$cssstring = "center";
} elseif ($type == 'int') {
$align = "right";
$cssstring = "right";
} elseif ($type == 'price') {
$align = "right";
$cssstring = "right";
} elseif ($type == 'double') {
$align = "right";
$cssstring = "right";
} elseif ($type == 'boolean') {
$align = "center";
$cssstring = "center";
} elseif ($type == 'radio') {
$align = "center";
$cssstring = "center";
} elseif ($type == 'checkbox') {
$align = "center";
$cssstring = "center";
} elseif ($type == 'price') {
$align = "right";
$cssstring = "right";
}
return $align;
if (!empty($this->attributes[$extrafieldsobjectkey]['csslist'][$key])) {
$cssstring .= ($cssstring ? ' ' : '').$this->attributes[$extrafieldsobjectkey]['csslist'][$key];
}
return $cssstring;
}
/**

View File

@ -920,7 +920,9 @@ class Form
}
if (empty($disablefavorites)) {
array_multisort($favorite, SORT_DESC, $label, SORT_ASC, $countryArray);
$array1_sort_order = SORT_DESC;
$array2_sort_order = SORT_ASC;
array_multisort($favorite, $array1_sort_order, $label, $array2_sort_order, $countryArray);
} else {
$countryArray = dol_sort_array($countryArray, 'label');
}
@ -4975,7 +4977,7 @@ class Form
if (!empty($input['label'])) {
$more .= $input['label'].'</div><div class="tagtd left">';
}
$more .= $this->selectarray($input['name'], $input['values'], $input['default'], $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss);
$more .= $this->selectarray($input['name'], $input['values'], isset($input['default'])?$input['default']:'', $show_empty, $key_in_label, $value_as_key, $moreattr, $translate, $maxlen, $disabled, $sort, $morecss);
$more .= '</div></div>'."\n";
} elseif ($input['type'] == 'checkbox') {
$more .= '<div class="tagtr">';

View File

@ -259,7 +259,6 @@ class FormActions
}
$ref = $actioncomm->getNomUrl(1, -1);
$label = $actioncomm->getNomUrl(0, 36);
print '<tr class="oddeven">';
@ -304,7 +303,7 @@ class FormActions
print '</td>';
// Label
print '<td>'.$label.'</td>';
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($actioncomm->label).'">'.$actioncomm->getNomUrl(0, 36).'</td>';
// Date
print '<td class="center nowraponall">'.dol_print_date($actioncomm->datep, 'dayhour', 'tzuserrel');

View File

@ -113,7 +113,7 @@ class FormAdmin
$out .= '>'.$langs->trans("AutoDetectLang").'</option>';
}
asort($langs_available);
asort($langs_available); // array('XX' => 'Language (Country)', ...)
foreach ($langs_available as $key => $value) {
$valuetoshow = $value;

View File

@ -1470,7 +1470,7 @@ class FormFile
print '<td class="valignmiddle right actionbuttons nowraponall"><!-- action on files -->';
if ($useinecm == 1 || $useinecm == 5) { // ECM manual tree only
// $section is inside $param
$newparam .= preg_replace('/&file=.*$/', '', $param); // We don't need param file=
$newparam = preg_replace('/&file=.*$/', '', $param); // We don't need param file=
$backtopage = DOL_URL_ROOT.'/ecm/index.php?&section_dir='.urlencode($relativepath).$newparam;
print '<a class="editfielda editfilelink" href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'&backtopage='.urlencode($backtopage).'" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
}

View File

@ -1697,4 +1697,9 @@ class ModelMail
public $content_lines;
public $lang;
public $joinfiles;
/**
* @var string Module the template is dedicated for
*/
public $module;
}

View File

@ -161,9 +161,10 @@ function versiondolibarrarray()
* @param int $nocommentremoval Do no try to remove comments (in such a case, we consider that each line is a request, so use also $linelengthlimit=0)
* @param int $offsetforchartofaccount Offset to use to load chart of account table to update sql on the fly to add offset to rowid and account_parent value
* @param int $colspan 2=Add a colspan=2 on td
* @param int $onlysqltoimportwebsite Only sql resquests used to import a website template is allowed
* @return int <=0 if KO, >0 if OK
*/
function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0, $colspan = 0)
function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handler = '', $okerror = 'default', $linelengthlimit = 32768, $nocommentremoval = 0, $offsetforchartofaccount = 0, $colspan = 0, $onlysqltoimportwebsite = 0)
{
global $db, $conf, $langs, $user;
@ -323,6 +324,52 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle
$keyforsql = md5($sqlfile);
foreach ($arraysql as $i => $sql) {
if ($sql) {
// Test if sql is allowed
if ($onlysqltoimportwebsite) {
$newsql = str_replace(array("\'"), '__BACKSLASHQUOTE__', $sql);
// Remove all strings contents
$l = strlen($newsql);
$is = 0;
$quoteopen = 0;
$newsqlclean = '';
while ($is < $l) {
$char = $newsql[$is];
if ($char == "'") {
if ($quoteopen) {
$quoteopen--;
} else {
$quoteopen++;
}
} elseif (empty($quoteopen)) {
$newsqlclean .= $char;
}
$is++;
}
$newsqlclean = str_replace(array("null"), '__000__', $newsqlclean);
//print $newsqlclean."<br>\n";
// A very small control. This can still by bypassed by adding a second SQL request concatenated
$qualified = 0;
if (preg_match('/^--/', $newsqlclean)) {
$qualified = 1;
} elseif (preg_match('/^UPDATE llx_website SET fk_default_home = \d+\+\d+ WHERE rowid = \d+;$/', $newsqlclean)) {
$qualified = 1;
} elseif (preg_match('/^INSERT INTO llx_website_page\([a-z0-9_\s,]+\) VALUES\([0-9_\s,\+]+\);$/', $newsqlclean)) {
// Insert must match
// INSERT INTO llx_website_page(rowid, fk_page, fk_website, pageurl, aliasalt, title, description, lang, image, keywords, status, date_creation, tms, import_key, grabbed_from, type_container, htmlheader, content, author_alias) VALUES(1+123, null, 17, , , , , , , , , , , null, , , , , );
$qualified = 1;
}
if (!$qualified) {
$error++;
//print 'Request '.($i + 1)." contains non allowed instructions.<br>\n";
//print "newsqlclean = ".$newsqlclean."<br>\n";
dol_syslog('Admin.lib::run_sql Request '.($i + 1)." contains non allowed instructions.", LOG_DEBUG);
dol_syslog('$newsqlclean='.$newsqlclean, LOG_DEBUG);
break;
}
}
// Replace the prefix tables
if (MAIN_DB_PREFIX != 'llx_') {
$sql = preg_replace('/llx_/i', MAIN_DB_PREFIX, $sql);
@ -365,7 +412,7 @@ function run_sql($sqlfile, $silent = 1, $entity = '', $usesavepoint = 1, $handle
$sqlmodified++;
}
// Replace __x__ with rowid of insert nb x
// Replace __x__ with the rowid of the result of the insert number x
while (preg_match('/__([0-9]+)__/', $newsql, $reg)) {
$cursor = $reg[1];
if (empty($listofinsertedrowid[$cursor])) {

View File

@ -342,7 +342,7 @@ function dol_shutdown()
$depth = $db->transaction_opened;
$disconnectdone = $db->close();
}
dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ?LOG_WARNING:LOG_INFO));
dol_syslog("--- End access to ".$_SERVER["PHP_SELF"].(($disconnectdone && $depth) ? ' (Warn: db disconnection forced, transaction depth was '.$depth.')' : ''), (($disconnectdone && $depth) ? LOG_WARNING : LOG_INFO));
}
/**
@ -1563,6 +1563,11 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
}
}
// Check if we have a forced suffix
if (defined('USESUFFIXINLOG')) {
$suffixinfilename .= constant('USESUFFIXINLOG');
}
if ($ident < 0) {
foreach ($conf->loghandlers as $loghandlerinstance) {
$loghandlerinstance->setIdent($ident);
@ -2761,7 +2766,7 @@ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = 'auto',
}
//var_dump($localtz);
//var_dump($year.'-'.$month.'-'.$day.'-'.$hour.'-'.$minute);
$dt = new DateTime(null, $localtz);
$dt = new DateTime('now', $localtz);
$dt->setDate((int) $year, (int) $month, (int) $day);
$dt->setTime((int) $hour, (int) $minute, (int) $second);
$date = $dt->getTimestamp(); // should include daylight saving time
@ -3882,7 +3887,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'accountancy', 'accounting_account', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset',
'bank_account', 'barcode', 'bank', 'bell', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'briefcase-medical', 'bug', 'building',
'card', 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype',
'card', 'calendarlist', 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype',
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cubes',
'currency', 'multicurrency',
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'dynamicprice',
@ -3942,7 +3947,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'sign-out'=>'sign-out-alt',
'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'switch_on_red'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star',
'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'filter'=>'filter',
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
'list-alt'=>'list-alt', 'calendarlist'=>'bars', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'currency'=>'dollar-sign', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
'error'=>'exclamation-triangle', 'warning'=>'exclamation-triangle',
'other'=>'square',
@ -10040,7 +10045,7 @@ function getDictionaryValue($tablename, $field, $id, $checkentity = false, $rowi
$resql = $db->query($sql);
if ($resql) {
while ($obj = $db->fetch_object($resql)) {
$dictvalues[$obj->{$rowidfield}] = $obj;
$dictvalues[$obj->{$rowidfield}] = $obj; // $obj is stdClass
}
} else {
dol_print_error($db);
@ -10051,7 +10056,8 @@ function getDictionaryValue($tablename, $field, $id, $checkentity = false, $rowi
if (!empty($dictvalues[$id])) {
// Found
return $dictvalues[$id]->{$field};
$tmp = $dictvalues[$id];
return (property_exists($tmp, $field) ? $tmp->$field : '');
} else {
// Not found
return '';

View File

@ -391,12 +391,19 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali
$socname = '';
if ($thirdparty instanceof Societe) {
$socname .= $thirdparty->name;
if (($includealias || !empty($conf->global->PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME)) && !empty($thirdparty->name_alias)) {
$socname .= " - ".$thirdparty->name_alias;
$socname = $thirdparty->name;
if (($includealias || getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) && !empty($thirdparty->name_alias)) {
if (getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME') == 2) {
$socname = $thirdparty->name_alias." - ".$thirdparty->name;
} else {
$socname = $thirdparty->name." - ".$thirdparty->name_alias;
}
}
} elseif ($thirdparty instanceof Contact) {
$socname = $thirdparty->socname;
if (($includealias || getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) && !empty($thirdparty->name_alias)) {
// TODO PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME not completely implemented
}
} else {
throw new InvalidArgumentException('Parameter 1 $thirdparty is not a Societe nor Contact');
}
@ -2352,13 +2359,13 @@ function pdf_getLinkedObjects(&$object, $outputlangs)
if (count($objects) > 1 && count($objects) <= (getDolGlobalInt("MAXREFONDOC") ? getDolGlobalInt("MAXREFONDOC") : 10)) {
$object->note_public = dol_concatdesc($object->note_public, '<br>'.$outputlangs->transnoentities("RefOrder").' : <br>');
foreach ($objects as $elementobject) {
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' ');
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref).(!empty($elementobject->ref_client) ? ' ('.$elementobject->ref_client.')' : '').(!empty($elementobject->ref_supplier) ? ' ('.$elementobject->ref_supplier.')' : '').' ');
$object->note_public = dol_concatdesc($object->note_public, $outputlangs->transnoentities("OrderDate").' : '.dol_print_date($elementobject->date, 'day', '', $outputlangs).'<br>');
}
} elseif (count($objects) == 1) {
$elementobject = array_shift($objects);
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder");
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '');
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref).(!empty($elementobject->ref_client) ? ' ('.$elementobject->ref_client.')' : '').(!empty($elementobject->ref_supplier) ? ' ('.$elementobject->ref_supplier.')' : '');
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate");
$linkedobjects[$objecttype]['date_value'] = dol_print_date($elementobject->date, 'day', '', $outputlangs);
}

View File

@ -2,7 +2,8 @@
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
*
* 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
@ -208,7 +209,7 @@ function project_prepare_head(Project $project, $moreparam = '')
$h++;
}
if ($conf->eventorganization->enabled && !empty($project->usage_organize_event)) {
if (!empty($conf->eventorganization->enabled) && !empty($project->usage_organize_event)) {
$langs->load('eventorganization');
$head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php?projectid=' . $project->id;
$head[$h][1] = $langs->trans("EventOrganization");
@ -635,7 +636,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
$taskstatic->id = $lines[$i]->id;
$taskstatic->ref = $lines[$i]->ref;
$taskstatic->label = ($taskrole[$lines[$i]->id] ? $langs->trans("YourRole").': '.$taskrole[$lines[$i]->id] : '');
$taskstatic->label = (!empty($taskrole[$lines[$i]->id]) ? $langs->trans("YourRole").': '.$taskrole[$lines[$i]->id] : '');
$taskstatic->projectstatus = $lines[$i]->projectstatus;
$taskstatic->progress = $lines[$i]->progress;
$taskstatic->fk_statut = $lines[$i]->status;

View File

@ -77,7 +77,7 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1)
$securekeyseed = '';
if ($type == 'proposal') {
$securekeyseed = $conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN;
$securekeyseed = isset($conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN) ? $conf->global->PROPOSAL_ONLINE_SIGNATURE_SECURITY_TOKEN : '';
$out = $urltouse.'/public/onlinesign/newonlinesign.php?source=proposal&ref='.($mode ? '<span style="color: #666666">' : '');
if ($mode == 1) {

View File

@ -879,7 +879,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// foreach ($menu_array as $key => $row) {
// $position[$key] = $row['position'];
// }
// array_multisort($position, SORT_ASC, $menu_array);
// $array1_sort_order = SORT_ASC;
// array_multisort($position, $array1_sort_order, $menu_array);
}
// TODO Use the position property in menu_array to reorder the $menu_array
@ -2002,7 +2003,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
$newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->rights->produit->lire);
}
if (isModEnabled('propal') || (isModEnabled('commande') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('facture') || isModEnabled('fournisseur') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) {
$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire);
$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire);
}
// Categories
@ -2019,7 +2020,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
$newmenu->add("/product/card.php?leftmenu=service&amp;action=create&amp;type=1", $langs->trans("NewService"), 1, $user->rights->service->creer);
$newmenu->add("/product/list.php?leftmenu=service&amp;type=1", $langs->trans("List"), 1, $user->rights->service->lire);
if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || (isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) {
$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire || $user->rights->product->lire);
$newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire);
}
// Categories
if (isModEnabled('categorie')) {

View File

@ -246,6 +246,7 @@ class doc_generic_bom_odt extends ModelePDFBom
}
$object->fetch_thirdparty();
$object->fetch_product();
$dir = $conf->bom->multidir_output[isset($object->entity) ? $object->entity : 1];
$objectref = dol_sanitizeFileName($object->ref);

View File

@ -48,6 +48,18 @@ class mod_commande_marbre extends ModeleNumRefCommandes
public $name = 'Marbre';
/**
* Constructor
*/
public function __construct()
{
global $conf, $mysoc;
if ((float) $conf->global->MAIN_VERSION_LAST_INSTALL >= 16.0 && $mysoc->country_code != 'FR') {
$this->prefix = 'SO'; // We use correct standard code "SO = Sale Order"
}
}
/**
* Return description of numbering module
*

View File

@ -55,7 +55,15 @@ class mod_facture_mars extends ModeleNumRefFactures
*/
public function __construct()
{
global $conf;
global $conf, $mysoc;
if ((float) $conf->global->MAIN_VERSION_LAST_INSTALL >= 16.0 && $mysoc->country_code != 'FR') {
$this->prefixinvoice = 'IN'; // We use correct standard code "IN = Invoice"
$this->prefixreplacement = 'IR';
$this->prefixdeposit = 'ID';
$this->prefixcreditnote = 'IC';
}
if (!empty($conf->global->INVOICE_NUMBERING_MARS_FORCE_PREFIX)) {
$this->prefixinvoice = $conf->global->INVOICE_NUMBERING_MARS_FORCE_PREFIX;
}

View File

@ -42,6 +42,12 @@ class mod_facture_terre extends ModeleNumRefFactures
*/
public $prefixinvoice = 'FA';
/**
* Prefix for replacement invoices
* @var string
*/
public $prefixreplacement = 'FA';
/**
* Prefix for credit note
* @var string
@ -65,7 +71,15 @@ class mod_facture_terre extends ModeleNumRefFactures
*/
public function __construct()
{
global $conf;
global $conf, $mysoc;
if ((float) $conf->global->MAIN_VERSION_LAST_INSTALL >= 16.0 && $mysoc->country_code != 'FR') {
$this->prefixinvoice = 'IN'; // We use correct standard code "IN = Invoice"
$this->prefixreplacement = 'IR';
$this->prefixdeposit = 'ID';
$this->prefixcreditnote = 'IC';
}
if (!empty($conf->global->INVOICE_NUMBERING_TERRE_FORCE_PREFIX)) {
$this->prefixinvoice = $conf->global->INVOICE_NUMBERING_TERRE_FORCE_PREFIX;
}

View File

@ -166,77 +166,21 @@ class modEmailCollector extends DolibarrModules
// Permissions
$this->rights = array(); // Permission array used by this module
/*
$r=0;
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
$this->rights[$r][1] = 'Read myobject of dav'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
$r++;
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
$this->rights[$r][1] = 'Create/Update myobject of dav'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
$r++;
$this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used)
$this->rights[$r][1] = 'Delete myobject of dav'; // Permission label
$this->rights[$r][3] = 0; // Permission by default for new user (0/1)
$this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
$this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2)
*/
// Main menu entries
$this->menu = array(); // List of menus to add
$r = 0;
// Add here entries to declare new menus
/* BEGIN MODULEBUILDER TOPMENU */
/*$this->menu[$r++]=array('fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'top', // This is a Top menu entry
'titre'=>'dav',
'mainmenu'=>'dav',
'leftmenu'=>'',
'url'=>'/dav/davindex.php',
'langs'=>'dav@dav', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->dav->enabled', // Define condition to show or hide menu entry. Use '$conf->dav->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->dav->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
*/
/* END MODULEBUILDER TOPMENU */
/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT
$this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=dav', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
'titre'=>'List MyObject',
'mainmenu'=>'dav',
'leftmenu'=>'dav_myobject_list',
'url'=>'/dav/myobject_list.php',
'langs'=>'dav@dav', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->dav->enabled', // Define condition to show or hide menu entry. Use '$conf->dav->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'1', // Use 'perms'=>'$user->rights->dav->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=dav,fk_leftmenu=dav', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
'titre'=>'New MyObject',
'mainmenu'=>'dav',
'leftmenu'=>'dav_myobject_new',
'url'=>'/dav/myobject_page.php?action=create',
'langs'=>'dav@dav', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000+$r,
'enabled'=>'$conf->dav->enabled', // Define condition to show or hide menu entry. Use '$conf->dav->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'1', // Use 'perms'=>'$user->rights->dav->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
END MODULEBUILDER LEFTMENU MYOBJECT */
$this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
'type'=>'left', // This is a Left menu entry
'titre'=>'EmailCollectors',
'url'=>'/admin/emailcollector_list.php?leftmenu=admintools',
'langs'=>'admin', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>201,
'enabled'=>'$conf->emailcollector->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'$user->admin', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'',
'user'=>2); // 0=Menu for internal users, 1=external users, 2=both
$r++;
}
/**
@ -265,19 +209,21 @@ class modEmailCollector extends DolibarrModules
$sqlforexampleFilterA1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterA1 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = ".$conf->entity."), 'isnotanswer', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleFilterA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterA2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
//$sqlforexampleFilterA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
//$sqlforexampleFilterA2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = ".$conf->entity."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleFilterA3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
$sqlforexampleFilterA3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = ".$conf->entity."), 'to', 'support@example.com', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleA4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleA4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = ".$conf->entity."), 'ticket', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleActionA1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleActionA1 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Ticket_Requests' and entity = ".$conf->entity."), 'ticket', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sql[] = $sqlforexampleA1;
$sql[] = $sqlforexampleFilterA1;
$sql[] = $sqlforexampleFilterA2;
//$sql[] = $sqlforexampleFilterA2;
$sql[] = $sqlforexampleFilterA3;
$sql[] = $sqlforexampleA4;
$sql[] = $sqlforexampleActionA1;
}
} else {
dol_print_error($this->db);
@ -296,12 +242,15 @@ class modEmailCollector extends DolibarrModules
$sqlforexampleFilterA1 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses_Out' and entity = ".((int) $conf->entity)."), 'isanswer', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleFilterA2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterA2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses_Out' and entity = ".((int) $conf->entity)."), 'withouttrackingidinmsgid', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleActionA1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleActionA1 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses_Out' and entity = ".((int) $conf->entity)."), 'recordevent', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sql[] = $sqlforexampleA1;
$sql[] = $sqlforexampleFilterA1;
$sql[] = $sqlforexampleFilterA2;
$sql[] = $sqlforexampleActionA1;
}
}
@ -314,14 +263,18 @@ class modEmailCollector extends DolibarrModules
$label = $langs->trans('EmailCollectorExampleToCollectDolibarrAnswers');
$sqlforexampleB1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollector (entity, ref, label, description, source_directory, date_creation, fk_user_creat, status)";
$sqlforexampleB1 .= " VALUES (".$conf->entity.", 'Collect_Responses_In', '".$this->db->escape($label)."', '".$this->db->escape($descriptionB1)."', 'INBOX', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 0)";
$sqlforexampleB2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleB2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = ".((int) $conf->entity)."), 'isanswer', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleB3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleB3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = ".((int) $conf->entity)."), 'recordevent', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleFilterB2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterB2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = ".((int) $conf->entity)."), 'isanswer', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleActionB3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleActionB3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Responses_In' and entity = ".((int) $conf->entity)."), 'recordevent', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sql[] = $sqlforexampleB1;
$sql[] = $sqlforexampleB2;
$sql[] = $sqlforexampleB3;
$sql[] = $sqlforexampleFilterB2;
$sql[] = $sqlforexampleActionB3;
}
} else {
dol_print_error($this->db);
@ -338,19 +291,21 @@ class modEmailCollector extends DolibarrModules
$sqlforexampleFilterC1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC1 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".((int) $conf->entity)."), 'isnotanswer', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleFilterC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".((int) $conf->entity)."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
//$sqlforexampleFilterC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
//$sqlforexampleFilterC2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".((int) $conf->entity)."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleFilterC3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".((int) $conf->entity)."), 'to', 'sales@example.com', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleC4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, actionparam, date_creation, fk_user_creat, status)";
$sqlforexampleC4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".((int) $conf->entity)."), 'project', 'tmp_from=EXTRACT:HEADER:^From:(.*);socid=SETIFEMPTY:1;usage_opportunity=SET:1;description=EXTRACT:BODY:(.*);title=SET:Lead or message from __tmp_from__ received by email', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleActionC4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, actionparam, date_creation, fk_user_creat, status)";
$sqlforexampleActionC4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Leads' and entity = ".((int) $conf->entity)."), 'project', 'tmp_from=EXTRACT:HEADER:^From:(.*);socid=SETIFEMPTY:1;usage_opportunity=SET:1;description=EXTRACT:BODY:(.*);title=SET:Lead or message from __tmp_from__ received by email', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sql[] = $sqlforexampleC1;
$sql[] = $sqlforexampleFilterC1;
$sql[] = $sqlforexampleFilterC2;
//$sql[] = $sqlforexampleFilterC2;
$sql[] = $sqlforexampleFilterC3;
$sql[] = $sqlforexampleC4;
$sql[] = $sqlforexampleActionC4;
}
} else {
dol_print_error($this->db);
@ -367,19 +322,21 @@ class modEmailCollector extends DolibarrModules
$sqlforexampleFilterC1 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC1 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".((int) $conf->entity)."), 'isnotanswer', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleFilterC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".((int) $conf->entity)."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
//$sqlforexampleFilterC2 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, date_creation, fk_user_creat, status)";
//$sqlforexampleFilterC2 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".((int) $conf->entity)."), 'withouttrackingid', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleFilterC3 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectorfilter (fk_emailcollector, type, rulevalue, date_creation, fk_user_creat, status)";
$sqlforexampleFilterC3 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".((int) $conf->entity)."), 'to', 'jobs@example.com', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleC4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, actionparam, date_creation, fk_user_creat, status)";
$sqlforexampleC4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".((int) $conf->entity)."), 'candidature', 'tmp_from=EXTRACT:HEADER:^From:(.*)(<.*>)?;fk_recruitmentjobposition=EXTRACT:HEADER:^To:[^\n]*\+([^\n]*);description=EXTRACT:BODY:(.*);lastname=SET:__tmp_from__', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sqlforexampleActionC4 = "INSERT INTO ".MAIN_DB_PREFIX."emailcollector_emailcollectoraction (fk_emailcollector, type, actionparam, date_creation, fk_user_creat, status)";
$sqlforexampleActionC4 .= " VALUES ((SELECT rowid FROM ".MAIN_DB_PREFIX."emailcollector_emailcollector WHERE ref = 'Collect_Candidatures' and entity = ".((int) $conf->entity)."), 'candidature', 'tmp_from=EXTRACT:HEADER:^From:(.*)(<.*>)?;fk_recruitmentjobposition=EXTRACT:HEADER:^To:[^\n]*\+([^\n]*);description=EXTRACT:BODY:(.*);lastname=SET:__tmp_from__', '".$this->db->idate(dol_now())."', ".((int) $user->id).", 1)";
$sql[] = $sqlforexampleC1;
$sql[] = $sqlforexampleFilterC1;
$sql[] = $sqlforexampleFilterC2;
//$sql[] = $sqlforexampleFilterC2;
$sql[] = $sqlforexampleFilterC3;
$sql[] = $sqlforexampleC4;
$sql[] = $sqlforexampleActionC4;
}
} else {
dol_print_error($this->db);

View File

@ -832,8 +832,18 @@ class modSociete extends DolibarrModules
's.note_public' => "My public note"
);
$this->import_updatekeys_array[$r] = array(
's.rowid' => 'Id'
's.rowid' => 'Id',
's.lastname' => "Lastname",
);
if (!empty($conf->socialnetworks->enabled)) {
$sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_socialnetworks WHERE active = 1";
$resql = $this->db->query($sql);
while ($obj = $this->db->fetch_object($resql)) {
$fieldname = 's.socialnetworks_'.$obj->code;
$fieldlabel = ucfirst($obj->label);
$this->import_updatekeys_array[$r][$fieldname] = $fieldlabel;
}
}
// Import Bank Accounts
$r++;

View File

@ -173,7 +173,7 @@ class mod_syslog_file extends LogHandler implements LogHandlerInterface
$this->lastTime = $now;
}
$message = strftime("%Y-%m-%d %H:%M:%S", time()).$delay." ".sprintf("%-7s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident > 0 ?str_pad('', $this->ident, ' ') : '').$content['message'];
$message = dol_print_date(dol_now('gmt'), 'standard', 'gmt').$delay." ".sprintf("%-7s", $logLevels[$content['level']])." ".sprintf("%-15s", $content['ip'])." ".($this->ident > 0 ?str_pad('', $this->ident, ' ') : '').$content['message'];
fwrite($filefd, $message."\n");
fclose($filefd);
@chmod($logfile, octdec(empty($conf->global->MAIN_UMASK) ? '0664' : $conf->global->MAIN_UMASK));

View File

@ -24,10 +24,10 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) {
if (!empty($arrayfields[$extrafieldsobjectprefix.$key]['checked'])) {
$align = $extrafields->getAlignFlag($key);
$cssclass = $extrafields->getAlignFlag($key, $extrafieldsobjectkey);
$typeofextrafield = $extrafields->attributes[$extrafieldsobjectkey]['type'][$key];
print '<td class="liste_titre'.($align ? ' '.$align : '').'">';
print '<td class="liste_titre'.($cssclass ? ' '.$cssclass : '').'">';
$tmpkey = preg_replace('/'.$search_options_pattern.'/', '', $key);
if (in_array($typeofextrafield, array('varchar', 'int', 'double')) && empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) {
$searchclass = '';

View File

@ -22,7 +22,7 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
foreach ($extrafields->attributes[$extrafieldsobjectkey]['label'] as $key => $val) {
if (!empty($arrayfields[$extrafieldsobjectprefix.$key]['checked'])) {
$align = $extrafields->getAlignFlag($key);
$cssclass = $extrafields->getAlignFlag($key, $extrafieldsobjectkey);
$sortonfield = $extrafieldsobjectprefix.$key;
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['computed'][$key])) {
$sortonfield = '';
@ -36,7 +36,7 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table
$tooltip = empty($extrafields->attributes[$extrafieldsobjectkey]['help'][$key]) ? '' : $extrafields->attributes[$extrafieldsobjectkey]['help'][$key];
print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($align ? 'align="'.$align.'" data-titlekey="'.$key.'"' : 'data-titlekey="'.$key.'"'), $sortfield, $sortorder, '', $disablesortlink, $tooltip)."\n";
print getTitleFieldOfList($extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 0, $_SERVER["PHP_SELF"], $sortonfield, "", $param, ($cssclass ? 'class="'.$cssclass.'" data-titlekey="'.$key.'"' : 'data-titlekey="'.$key.'"'), $sortfield, $sortorder, '', $disablesortlink, $tooltip)."\n";
if (isset($totalarray) && isset($totalarray['nbfield'])) {
$totalarray['nbfield']++;
}

View File

@ -94,9 +94,11 @@ if ($permtoadd && GETPOSTISSET('website')) { // If on file manager to manage med
print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
print '</a>';
} elseif ($permtoadd && $module == 'ecm') { // If on file manager medias in ecm
print '<a id="agenerateimgwebp" href="'.$_SERVER["PHP_SELF"].'?action=confirmconvertimgwebp&token='.newToken().'" class="inline-block valignmiddle toolbarbutton paddingtop" title="'.dol_escape_htmltag($langs->trans("GenerateImgWebp")).'">';
print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
print '</a>';
if (getDolGlobalInt('ECM_SHOW_GENERATE_WEBP_BUTTON')) {
print '<a id="agenerateimgwebp" href="'.$_SERVER["PHP_SELF"].'?action=confirmconvertimgwebp&token='.newToken().'" class="inline-block valignmiddle toolbarbutton paddingtop" title="'.dol_escape_htmltag($langs->trans("GenerateImgWebp")).'">';
print img_picto('', 'images', '', false, 0, 0, '', 'size15x flip marginrightonly');
print '</a>';
}
}
print "<script>

View File

@ -546,21 +546,24 @@ if (($action == "create") || ($action == "edit")) {
$linkback = '<a href="'.DOL_URL_ROOT.'/cron/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
$morehtmlref .= $langs->trans($object->label);
$morehtmlref .= '</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);
// box add_jobs_box
print '<div class="fichecenter">';
print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">';
print '<tr><td class="titlefield">';
/*print '<tr><td class="titlefield">';
print $langs->trans('CronLabel')."</td>";
print "<td>".$langs->trans($object->label);
print "</td></tr>";
print "</td></tr>";*/
print "<tr><td>";
print '<tr><td class="titlefield">';
print $langs->trans('CronType')."</td><td>";
print $formCron->select_typejob('jobtype', $object->jobtype, 1);
print "</td></tr>";
@ -605,11 +608,11 @@ if (($action == "create") || ($action == "edit")) {
if (!empty($conf->multicompany->enabled)) {
print '<tr><td>';
print $langs->trans('Entity')."</td><td>";
if (!$object->entity) {
print $langs->trans("AllEntities");
if (empty($object->entity)) {
print img_picto($langs->trans("AllEntities"), 'entity', 'class="pictofixedwidth"').$langs->trans("AllEntities");
} else {
$mc->getInfo($object->entity);
print $mc->label;
print img_picto($langs->trans("AllEntities"), 'entity', 'class="pictofixedwidth"').$mc->label;
}
print "</td></tr>";
}
@ -617,10 +620,8 @@ if (($action == "create") || ($action == "edit")) {
print '</table>';
print '</div>';
print '<br>';
print '<div class="fichehalfright">';
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">';
@ -693,11 +694,11 @@ if (($action == "create") || ($action == "edit")) {
print "</td></tr>";
print '</table>';
print '</div>';
print '<br>';
print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent tableforfield">';
@ -736,8 +737,12 @@ if (($action == "create") || ($action == "edit")) {
print "</td></tr>";
print '</table>';
print '</div>';
print '<div class="clearboth"></div>';
print dol_get_fiche_end();

View File

@ -57,6 +57,7 @@ print dol_get_fiche_head($head, 'info', $langs->trans("CronTask"), -1, 'cron');
$linkback = '<a href="'.DOL_URL_ROOT.'/cron/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$morehtmlref = '<div class="refidno">';
$morehtmlref .= $langs->trans($object->label);
$morehtmlref .= '</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref);

View File

@ -45,6 +45,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid
$queries[] = array(
'sql' => $query['sql'],
'duration' => $query['duration'],
'duration_str' => round($query['duration'] * 1000, 2),
'memory' => $query['memory_usage'],
'is_success' => $query['is_success'],
'error_code' => $query['error_code'],

View File

@ -80,7 +80,7 @@ print dol_get_fiche_end();
// Buttons
if ($action != 'create' && $action != 'edit') {
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a></div>';
print '<a class="butAction reposition" href="'.$_SERVER["PHP_SELF"].'?action=create">'.$langs->trans("NewAttribute").'</a>';
print "</div>";
}

View File

@ -346,7 +346,7 @@ if ($action != 'edit') {
print $fulllink;
}
if ($action != 'edit') {
print ' <a href="'.$fulllink.'">'.$langs->trans("Download").'</a>'; // No target here.
print ' <a href="'.$fulllink.'">'.img_picto($langs->trans("Download"), 'download', 'class="opacitymedium paddingrightonly"').'</a>'; // No target here.
}
print '</td></tr>';

View File

@ -47,6 +47,8 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$backtopage = GETPOST('backtopage', 'alpha');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');

View File

@ -58,7 +58,7 @@ if (!$sortorder) {
$sortorder = "ASC";
}
if (!$sortfield) {
$sortfield = "fullname";
$sortfield = "name";
}
$ecmdir = new EcmDirectory($db);

View File

@ -36,6 +36,9 @@ if (empty($conf) || !is_object($conf)) {
if (empty($module)) {
$module = 'ecm';
}
if (empty($nameforformuserfile)) {
$nameforformuserfile = '';
}
$paramwithoutsection = preg_replace('/&?section=(\d+)/', '', $param);
$openeddir = '/'; // The root directory shown

Some files were not shown because too many files have changed in this diff Show More