2
0
forked from Wavyzz/dolibarr

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

This commit is contained in:
Laurent Destailleur
2021-10-22 15:57:16 +02:00
18 changed files with 58 additions and 46 deletions

View File

@@ -894,7 +894,7 @@ if ($resql) {
$valuetoshow = $langs->trans("Content"); $showfield = 0;
}
if ($fieldlist[$field] == 'content_lines') {
$valuetoshow = $langs->trans("ContentLines"); $showfield = 0;
$valuetoshow = $langs->trans("ContentForLines"); $showfield = 0;
}
// Show fields
@@ -973,6 +973,14 @@ if ($resql) {
$doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (!empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 500, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%');
print $doleditor->Create(1);
}
if ($tmpfieldlist == 'content_lines') {
print $form->textwithpicto($langs->trans("ContentForLines"), $tabhelp[$id][$tmpfieldlist], 1, 'help', '', 0, 2, $tmpfieldlist).'<br>';
$okforextended = true;
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL))
$okforextended = false;
$doleditor = new DolEditor($tmpfieldlist.'-'.$rowid, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%');
print $doleditor->Create(1);
}
print '</td>';
print '<td></td>';
print '<td></td>';
@@ -1114,35 +1122,6 @@ if ($resql) {
//else print '<a href="#">'.img_delete().'</a>'; // Some dictionary can be edited by other profile than admin
}
print '</td>';
/*
$fieldsforcontent = array('content');
if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES))
{
$fieldsforcontent = array('content', 'content_lines');
}
foreach ($fieldsforcontent as $tmpfieldlist)
{
$showfield = 1;
$align = "left";
$valuetoshow = $obj->{$tmpfieldlist};
$class = 'tddict';
// Show value for field
if ($showfield) {
print '</tr><tr class="oddeven" nohover tr-'.$tmpfieldlist.'-'.$i.' "><td colspan="5">'; // To create an artificial CR for the current tr we are on
$okforextended = true;
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL))
$okforextended = false;
$doleditor = new DolEditor($tmpfieldlist.'-'.$i, (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : ''), '', 140, 'dolibarr_mailings', 'In', 0, false, $okforextended, ROWS_6, '90%', 1);
print $doleditor->Create(1);
print '</td>';
print '<td></td><td></td><td></td>';
}
}*/
print "</tr>\n";
}

View File

@@ -2545,7 +2545,7 @@ class Contrat extends CommonObject
if (!$error) {
foreach ($this->lines as $line) {
$result = $clonedObj->addline($line->desc, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, $line->date_ouverture, $line->date_cloture, 'HT', 0, $line->info_bits, $line->fk_fournprice, $line->pa_ht, $line->array_options, $line->fk_unit);
$result = $clonedObj->addline($line->description, $line->subprice, $line->qty, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->fk_product, $line->remise_percent, $line->date_ouverture, $line->date_cloture, 'HT', 0, $line->info_bits, $line->fk_fournprice, $line->pa_ht, $line->array_options, $line->fk_unit);
if ($result < 0) {
$error++;
$this->error = $clonedObj->error;

View File

@@ -65,6 +65,8 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
public function loadBox($max = 5)
{
global $conf, $user, $langs;
$dataseries = "";
$graphtoshow = "";
$badgeStatus0 = '#cbd3d3'; // draft
$badgeStatus1 = '#bc9526'; // validated

View File

@@ -98,10 +98,10 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes
$num = $this->db->num_rows($resql);
if ($num > 0) {
$objp = $this->db->fetch_object($resql);
$data[] = array($langs->trans('TicketCreatedToday'), $objp->nb);
$data[] = array($langs->transnoentitiesnoconv('TicketCreatedToday'), $objp->nb);
$totalnb += $objp->nb;
} else {
$data[] = array($langs->trans('TicketCreatedToday'), 0);
$data[] = array($langs->transnoentitiesnoconv('TicketCreatedToday'), 0);
}
} else {
dol_print_error($this->db);
@@ -116,10 +116,10 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes
$num = $this->db->num_rows($resql);
if ($num > 0) {
$objp = $this->db->fetch_object($resql);
$data[] = array($langs->trans('TicketClosedToday'), $objp->nb);
$data[] = array($langs->transnoentitiesnoconv('TicketClosedToday'), $objp->nb);
$totalnb += $objp->nb;
} else {
$data[] = array($langs->trans('TicketClosedToday'), 0);
$data[] = array($langs->transnoentitiesnoconv('TicketClosedToday'), 0);
}
} else {
dol_print_error($this->db);

View File

@@ -111,4 +111,20 @@ abstract class CommonObjectLine extends CommonObject
return -1;
}
}
/**
* Empty function to prevent errors on call of this function must be overload if usefull
*
* @param string $sortorder Sort Order
* @param string $sortfield Sort field
* @param int $limit offset limit
* @param int $offset offset limit
* @param array $filter filter array
* @param string $filtermode filter mode (AND or OR)
* @return int <0 if KO, >0 if OK
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{
return 0;
}
}

View File

@@ -1054,6 +1054,7 @@ class DolGraph
}
$showlegend = $this->showlegend;
$bordercolor = "";
$legends = array();
$nblot = 0;

View File

@@ -1526,7 +1526,7 @@ class FormMail extends Form
$product = new Product($this->db);
$product->fetch($line->fk_product, '', '', 1);
$product->fetch_optionals();
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) {
if (is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) {
foreach ($extrafields->attributes[$product->table_element]['label'] as $key => $label) {
$substit_line['__PRODUCT_EXTRAFIELD_'.strtoupper($key).'__'] = $product->array_options['options_'.$key];
}

View File

@@ -753,6 +753,8 @@ class FormTicket
print ajax_combobox('select'.$htmlname);
} elseif ($htmlname!='') {
$selectedgroups = array();
$groupvalue = "";
$groupticket=GETPOST($htmlname, 'aZ09');
$child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0;
if (!empty($groupticket)) {

View File

@@ -210,6 +210,9 @@ if ($action == 'presend') {
}
// Make substitution in email content
if ($object) {
$formmail->setSubstitFromObject($object, $langs);
}
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object);
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.urlencode($object->thirdparty->tag).'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated

View File

@@ -288,7 +288,7 @@ if ($projectid > 0) {
$morehtmlref .= '</div>';
// Define a complementary filter for search of next/prev ref.
if (!$user->rights->project->all->lire) {
if (empty($user->rights->project->all->lire)) {
$objectsListId = $project->getProjectsAuthorizedForUser($user, 0, 0);
$project->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ? join(',', array_keys($objectsListId)) : '0').")";
}

View File

@@ -378,3 +378,8 @@ ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_customer varchar(2
ALTER TABLE llx_societe_perentity ADD COLUMN accountancy_code_supplier varchar(24) AFTER accountancy_code_customer; -- equivalent to code_compta_supplier in llx_societe
ALTER TABLE llx_projet_task ADD COLUMN budget_amount double(24,8) AFTER priority;
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_ticket_by_severity.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_ticket_by_severity.php' AND entity = 1);
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_ticket_last_x_days.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_ticket_last_x_days.php' AND entity = 1);
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_nb_tickets_type.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_nb_tickets_type.php' AND entity = 1);
-- VMYSQL4.1 INSERT INTO llx_boxes_def (file, entity) SELECT 'box_graph_new_vs_close_ticket.php', 1 FROM DUAL WHERE NOT EXISTS (SELECT * FROM llx_boxes_def WHERE file = 'box_graph_new_vs_close_ticket.php' AND entity = 1);

View File

@@ -279,6 +279,7 @@ SpaceX=Space X
SpaceY=Space Y
FontSize=Font size
Content=Content
ContentForLines=Content to display for each product or service (from variable __LINES__ of Content)
NoticePeriod=Notice period
NewByMonth=New by month
Emails=Emails

View File

@@ -280,6 +280,7 @@ SpaceX=Área X
SpaceY=Área Y
FontSize=Tamaño de fuente
Content=Contenido
ContentForLines=Contenido a mostrar por cada línea de producto o servicio (de la variable __LINES__ definida en Contenido)
NoticePeriod=Plazo de aviso
NewByMonth=Nuevo por mes
Emails=E-Mails

View File

@@ -491,7 +491,8 @@ class Mos extends DolibarrApi
if (!$error && $line->fk_warehouse > 0) {
// Record stock movement
$id_product_batch = 0;
$stockmove->origin = $this->mo;
$stockmove->origin_type = 'mo';
$stockmove->origin_id = $this->mo->id;
if ($qtytoprocess >= 0) {
$idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement);
} else {
@@ -550,7 +551,8 @@ class Mos extends DolibarrApi
if (!$error && $line->fk_warehouse > 0) {
// Record stock movement
$id_product_batch = 0;
$stockmove->origin = $this->mo;
$stockmove->origin_type = 'mo';
$stockmove->origin_id = $this->mo->id;
if ($qtytoprocess >= 0) {
$idstockmove = $stockmove->livraison(DolibarrApiAccess::$user, $line->fk_product, $line->fk_warehouse, $qtytoprocess, 0, $labelmovement, dol_now(), '', '', $tmpproduct->status_batch, $id_product_batch, $codemovement);
} else {

View File

@@ -625,6 +625,7 @@ class Mo extends CommonObject
public function updateProduction(User $user, $notrigger = true)
{
$error = 0;
$role = "";
if ($this->status != self::STATUS_DRAFT) {
$this->error = 'BadStatus';

View File

@@ -773,7 +773,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
print '<br>';
}
if (!empty($conf->eventorganization->enabled)) {
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'"> ';
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
$htmltext = $langs->trans("EventOrganizationDescriptionLong");
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
}

View File

@@ -478,8 +478,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
// Output page
// --------------------------------------------------------------------
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'classforhorizontalscrolloftabs');
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', '');
if ($socid && !$projectid && !$project_ref && $user->rights->societe->lire) {
$socstat = new Societe($db);

View File

@@ -103,7 +103,7 @@ $thirdparty_fields = array(
'address' => array('name'=>'address', 'type'=>'xsd:string'),
'zip' => array('name'=>'zip', 'type'=>'xsd:string'),
'town' => array('name'=>'town', 'type'=>'xsd:string'),
'province_id' => array('name'=>'province_id', 'type'=>'xsd:string'),
'region_code' => array('name'=>'region_code', 'type'=>'xsd:string'),
'country_id' => array('name'=>'country_id', 'type'=>'xsd:string'),
'country_code' => array('name'=>'country_code', 'type'=>'xsd:string'),
'country' => array('name'=>'country', 'type'=>'xsd:string'),
@@ -343,7 +343,7 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '', $bar
'address' => $thirdparty->address,
'zip' => $thirdparty->zip,
'town' => $thirdparty->town,
'province_id' => $thirdparty->state_id,
'region_code' => $thirdparty->region_code,
'country_id' => $thirdparty->country_id,
'country_code' => $thirdparty->country_code,
'country' => $thirdparty->country,
@@ -462,7 +462,7 @@ function createThirdParty($authentication, $thirdparty)
if ($thirdparty['country_code']) {
$newobject->country_id = getCountry($thirdparty['country_code'], 3);
}
$newobject->province_id = $thirdparty['province_id'];
$newobject->region_code = $thirdparty['region_code'];
//if ($thirdparty['province_code']) $newobject->province_code=getCountry($thirdparty['province_code'],3);
$newobject->phone = $thirdparty['phone'];
@@ -597,7 +597,7 @@ function updateThirdParty($authentication, $thirdparty)
if ($thirdparty['country_code']) {
$object->country_id = getCountry($thirdparty['country_code'], 3);
}
$object->province_id = $thirdparty['province_id'];
$object->region_code = $thirdparty['region_code'];
//if ($thirdparty['province_code']) $newobject->province_code=getCountry($thirdparty['province_code'],3);
$object->phone = $thirdparty['phone'];