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

Conflicts:
	htdocs/comm/action/class/api_agendaevents.class.php
This commit is contained in:
Laurent Destailleur 2021-03-08 19:31:47 +01:00
commit c3a047ee06
7 changed files with 20 additions and 10 deletions

View File

@ -74,7 +74,7 @@ $nowarray = dol_getdate($now);
if (!GETPOSTISSET("date_startmonth")) {
$date_start = dol_get_first_day($nowarray['year'], $nowarray['mon'], 'tzuserrel');
} else if (GETPOST("date_startmonth") > 0) {
} elseif (GETPOST("date_startmonth") > 0) {
$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth", 'int'), GETPOST("date_startday", 'int'), GETPOST("date_startyear", 'int'), 'tzuserrel');
} else {
$date_start = -1;

View File

@ -16,9 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use Luracast\Restler\RestException;
use Luracast\Restler\RestException;
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
/**
* API class for Agenda Events

View File

@ -323,7 +323,7 @@ if ($action == 'create') {
print $langs->trans("Date");
print '</td>';
print '<td>';
print $form->selectDate(!empty($dateech) ? $dateech : '-1', 'ech', 0, 0, 0, 'charge', 1);
print $form->selectDate(!empty($dateech) ? $dateech : '-1', 'ech', 0, 0, 0, 'charge', 1, 1);
print '</td>';
print "</tr>\n";
@ -536,10 +536,10 @@ if ($id > 0) {
// Amount
if ($action == 'edit') {
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td>";
print '<input type="text" name="amount" size="12" class="flat" value="'.$object->amount.'">';
print '<input type="text" name="amount" size="12" class="flat" value="'.price($object->amount).'">';
print "</td></tr>";
} else {
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td>'.price($object->amount, 0, $langs, 1, -1, -1, $conf->currency).'</td></tr>';
}
// Mode of payment

View File

@ -786,6 +786,15 @@ abstract class CommonDocGenerator
$resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs);
// Load product data optional fields to the line -> enables to use "line_product_options_{extrafield}"
if (isset($line->fk_product) && $line->fk_product > 0)
{
$tmpproduct = new Product($this->db);
$result = $tmpproduct->fetch($line->fk_product);
foreach ($tmpproduct->array_options as $key=>$label)
$resarray["line_product_".$key] = $label;
}
return $resarray;
}

View File

@ -1368,7 +1368,7 @@ class FormFile
// $section is inside $param
$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" href="'.DOL_URL_ROOT.'/ecm/file_card.php?urlfile='.urlencode($file['name']).$param.'&backtopage='.urlencode($backtopage).'" class="editfilelink" rel="'.urlencode($file['name']).'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
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>';
}
if (empty($useinecm) || $useinecm == 2 || $useinecm == 6) { // 6=Media file manager
@ -1392,7 +1392,7 @@ class FormFile
if ($permtoeditline) {
$paramsectiondir = (in_array($modulepart, array('medias', 'ecm')) ? '&section_dir='.urlencode($relativepath) : '');
print '<a class="editfielda reposition" href="'.(($useinecm == 1 || $useinecm == 5) ? '#' : ($url.'?action=editfile&urlfile='.urlencode($filepath).$paramsectiondir.$param)).'" class="editfilelink" rel="'.$filepath.'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
print '<a class="editfielda reposition editfilelink" href="'.(($useinecm == 1 || $useinecm == 5) ? '#' : ($url.'?action=editfile&urlfile='.urlencode($filepath).$paramsectiondir.$param)).'" rel="'.$filepath.'">'.img_edit('default', 0, 'class="paddingrightonly"').'</a>';
}
}
if ($permonobject) {

View File

@ -328,7 +328,7 @@ ALTER TABLE llx_product MODIFY COLUMN desiredstock float;
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN seuil_stock_alerte float;
ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float;
ALTER TABLE llx_product ADD COLUMN fk_state integer DEFAULT NULL;
ALTER TABLE llx_product ADD COLUMN fk_state integer DEFAULT NULL AFTER fk_country;
ALTER TABLE llx_projet ADD COLUMN email_msgid varchar(255);
ALTER TABLE llx_ticket ADD COLUMN email_msgid varchar(255);

View File

@ -1823,7 +1823,7 @@ class Thirdparties extends DolibarrApi
*
* Return an array with thirdparty informations
*
* @param int $rowid Id of third party to load
* @param int $rowid Id of third party to load (Use 0 to get a specimen record, use null to use other search criterias)
* @param string $ref Reference of third party, name (Warning, this can return several records)
* @param string $ref_ext External reference of third party (Warning, this information is a free field not provided by Dolibarr)
* @param string $barcode Barcode of third party to load