Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
c929c05dc5
@ -666,7 +666,7 @@ print '<td class="titlefield">'.$langs->trans("FiscalYearInformation").'</td><td
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
|
||||
print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').'</td></tr>';
|
||||
print $formother->select_month(!empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? $conf->global->SOCIETE_FISCAL_MONTH_START : '', 'SOCIETE_FISCAL_MONTH_START', 0, 1, 'maxwidth100').'</td></tr>';
|
||||
|
||||
print "</table>";
|
||||
print '<br>';
|
||||
|
||||
@ -289,7 +289,7 @@ if ($action == 'edit') {
|
||||
print '<br>';
|
||||
|
||||
|
||||
if ($conf->global->MAIN_DISABLE_METEO != 1) {
|
||||
if (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO != 1) {
|
||||
// Show logo for weather
|
||||
print '<span class="opacitymedium">'.$langs->trans("DescWeather").'</span> ';
|
||||
|
||||
@ -302,7 +302,7 @@ if ($conf->global->MAIN_DISABLE_METEO != 1) {
|
||||
$str_mode_enabled = $str_mode_percentage;
|
||||
}
|
||||
print '<a href="#" onclick="return false;" id="change_mode">'.$str_mode_enabled.'</a>';
|
||||
print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.$conf->global->MAIN_USE_METEO_WITH_PERCENTAGE.'" />';
|
||||
print '<input type="hidden" id="MAIN_USE_METEO_WITH_PERCENTAGE" name="MAIN_USE_METEO_WITH_PERCENTAGE" value="'.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? $conf->global->MAIN_USE_METEO_WITH_PERCENTAGE : '').'" />';
|
||||
|
||||
print '<br><br>';
|
||||
} else {
|
||||
|
||||
@ -48,7 +48,7 @@ $substitutionarrayfortest = array(
|
||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||
'__ID__' => 'RecipientIdRecord',
|
||||
//'__EMAIL__' => 'RecipientEMail', // Done into actions_sendmails
|
||||
'__CHECK_READ__' => (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
|
||||
'__CHECK_READ__' => (is_object($object) && !empty($object->thirdparty) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.$object->thirdparty->tag.'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '',
|
||||
'__USER_SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN)) ? $usersignature : ''), // Done into actions_sendmails
|
||||
'__LOGIN__' => 'RecipientLogin',
|
||||
'__LASTNAME__' => 'RecipientLastname',
|
||||
@ -554,7 +554,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
// Disable
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>'.yn($conf->global->MAIN_DISABLE_ALL_MAILS);
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>'.yn(!empty($conf->global->MAIN_DISABLE_ALL_MAILS));
|
||||
if (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
|
||||
print img_warning($langs->trans("Disabled"));
|
||||
}
|
||||
@ -737,14 +737,14 @@ if ($action == 'edit') {
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans('MAIN_MAIL_DEFAULT_FROMTYPE').'</td>';
|
||||
print '<td>';
|
||||
if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') {
|
||||
if (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'robot') {
|
||||
print $langs->trans('RobotEmail');
|
||||
} elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') {
|
||||
} elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user') {
|
||||
print $langs->trans('UserEmail');
|
||||
} elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') {
|
||||
} elseif (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) && $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company') {
|
||||
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
|
||||
} else {
|
||||
$id = preg_replace('/senderprofile_/', '', $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE);
|
||||
$id = preg_replace('/senderprofile_/', '', !empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : '');
|
||||
if ($id > 0) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php';
|
||||
$emailsenderprofile = new EmailSenderProfile($db);
|
||||
@ -756,7 +756,7 @@ if ($action == 'edit') {
|
||||
|
||||
// Errors To
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ERRORS_TO").'</td>';
|
||||
print '<td>'.$conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
print '<td>'.(!empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : '');
|
||||
if (!empty($conf->global->MAIN_MAIL_ERRORS_TO) && !isValidEmail($conf->global->MAIN_MAIL_ERRORS_TO)) {
|
||||
print img_warning($langs->trans("ErrorBadEMail"));
|
||||
}
|
||||
@ -776,7 +776,7 @@ if ($action == 'edit') {
|
||||
print '</td></tr>';
|
||||
|
||||
//Add user to select destinaries list
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").'</td><td>'.yn($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT).'</td></tr>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").'</td><td>'.yn(!empty($conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT)).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
* Copyright (C) 2017-2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.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
|
||||
@ -217,7 +218,15 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
$permissiontoread = $user->rights->propal->lire;
|
||||
$permissiontoadd = $user->rights->propal->write;
|
||||
$permissiontodelete = $user->rights->propal->supprimer;
|
||||
$permissiontoclose = $user->rights->propal->cloturer;
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$permissiontovalidate = $user->rights->propale->propal_advance->validate;
|
||||
$permissiontoclose = $user->rights->propale->propal_advance->close;
|
||||
$permissiontosendbymail = $user->rights->propale->propal_advance->send;
|
||||
} else {
|
||||
$permissiontovalidate = $user->rights->propal->write;
|
||||
$permissiontoclose = $user->rights->propal->write;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -298,7 +307,7 @@ if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
if ($action == 'validate' && $permissiontoadd) {
|
||||
if ($action == 'validate' && $permissiontovalidate) {
|
||||
if (GETPOST('confirm') == 'yes') {
|
||||
$tmpproposal = new Propal($db);
|
||||
$db->begin();
|
||||
@ -316,9 +325,10 @@ if ($action == 'validate' && $permissiontoadd) {
|
||||
setEventMessage($tmpproposal->ref." ".$langs->trans('IsNotADraft'), 'errors');
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
$error++;
|
||||
}
|
||||
dol_print_error($db);
|
||||
$error++;
|
||||
}
|
||||
if ($error) {
|
||||
$db->rollback();
|
||||
@ -815,18 +825,23 @@ if ($resql) {
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
'generate_doc'=>$langs->trans("ReGeneratePDF"),
|
||||
'builddoc'=>$langs->trans("PDFMerge"),
|
||||
'presend'=>$langs->trans("SendByMail"),
|
||||
'prevalidate'=>$langs->trans("Validate"),
|
||||
'generate_doc'=>img_picto('', 'pdf').' '.$langs->trans("ReGeneratePDF"),
|
||||
'builddoc'=>img_picto('', 'pdf').' '.$langs->trans("PDFMerge"),
|
||||
|
||||
);
|
||||
if ($user->rights->propal->cloturer) {
|
||||
$arrayofmassactions['presign']=$langs->trans("Sign");
|
||||
$arrayofmassactions['nopresign']=$langs->trans("NoSign");
|
||||
$arrayofmassactions['setbilled'] = $langs->trans("ClassifyBilled");
|
||||
if ($permissiontosendbymail) {
|
||||
$arrayofmassactions['presend']=img_picto('', 'email').' '.$langs->trans("SendByMail");
|
||||
}
|
||||
if ($user->rights->propal->supprimer) {
|
||||
$arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
|
||||
if ($permissiontovalidate) {
|
||||
$arrayofmassactions['prevalidate']=img_picto('', 'check').' '.$langs->trans("Validate");
|
||||
}
|
||||
if ($permissiontoclose) {
|
||||
$arrayofmassactions['presign']=img_picto('', 'propal').' '.$langs->trans("Sign");
|
||||
$arrayofmassactions['nopresign']=img_picto('', 'propal').' '.$langs->trans("NoSign");
|
||||
$arrayofmassactions['setbilled'] =img_picto('', 'bill').' '.$langs->trans("ClassifyBilled");
|
||||
}
|
||||
if ($permissiontodelete) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete').' '.$langs->trans("Delete");
|
||||
}
|
||||
|
||||
if (in_array($massaction, array('presend', 'predelete', 'closed'))) {
|
||||
|
||||
@ -66,7 +66,7 @@ class box_dolibarr_state_board extends ModeleBoxes
|
||||
$this->enabled = 0; // disabled by this option
|
||||
}
|
||||
|
||||
$this->hidden = !($user->rights->societe->lire && empty($user->socid));
|
||||
$this->hidden = !(!empty($user->rights->societe->lire) && empty($user->socid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1884,14 +1884,14 @@ function email_admin_prepare_head()
|
||||
$head[$h][2] = 'common';
|
||||
$h++;
|
||||
|
||||
if ($conf->mailing->enabled) {
|
||||
if (!empty($conf->mailing->enabled)) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/mails_emailing.php";
|
||||
$head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("EMailing"));
|
||||
$head[$h][2] = 'common_emailing';
|
||||
$h++;
|
||||
}
|
||||
|
||||
if ($conf->ticket->enabled) {
|
||||
if (!empty($conf->ticket->enabled)) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/mails_ticket.php";
|
||||
$head[$h][1] = $langs->trans("OutGoingEmailSetupForEmailing", $langs->transnoentitiesnoconv("Ticket"));
|
||||
$head[$h][2] = 'common_ticket';
|
||||
|
||||
@ -132,7 +132,7 @@ class modDataPolicy extends DolibarrModules {
|
||||
array('DATAPOLICY_ADHERENT', 'chaine', '', $langs->trans('NUMBER_MONTH_BEFORE_DELETION'), 0),
|
||||
);
|
||||
|
||||
$country = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
|
||||
$country = explode(":", empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY) ? '' : $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
|
||||
|
||||
// Some keys to add into the overwriting translation tables
|
||||
/* $this->overwrite_translation = array(
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
|
||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2016 Francis Appels <francis.appels@yahoo.com>
|
||||
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.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
|
||||
@ -35,6 +36,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('products', 'stocks', 'companies', 'categories'));
|
||||
|
||||
@ -100,6 +106,7 @@ if (empty($reshook)) {
|
||||
if ($action == 'add' && $user->rights->stock->creer) {
|
||||
$object->ref = (string) GETPOST("ref", "alpha");
|
||||
$object->fk_parent = (int) GETPOST("fk_parent", "int");
|
||||
$object->fk_project = GETPOST('projectid', 'int');
|
||||
$object->label = (string) GETPOST("libelle", "alpha");
|
||||
$object->description = (string) GETPOST("desc", "alpha");
|
||||
$object->statut = GETPOST("statut");
|
||||
@ -163,6 +170,7 @@ if (empty($reshook)) {
|
||||
if ($object->fetch($id)) {
|
||||
$object->label = GETPOST("libelle");
|
||||
$object->fk_parent = GETPOST("fk_parent");
|
||||
$object->fk_project = GETPOST('projectid');
|
||||
$object->description = GETPOST("desc");
|
||||
$object->statut = GETPOST("statut");
|
||||
$object->lieu = GETPOST("lieu");
|
||||
@ -216,6 +224,9 @@ if (empty($reshook)) {
|
||||
if ($error) {
|
||||
$action = 'edit_extras';
|
||||
}
|
||||
} elseif ($action == 'classin' && $usercancreate) {
|
||||
// Link to a project
|
||||
$object->setProject(GETPOST('projectid', 'int'));
|
||||
}
|
||||
|
||||
if ($cancel == $langs->trans("Cancel")) {
|
||||
@ -239,6 +250,9 @@ $form = new Form($db);
|
||||
$formproduct = new FormProduct($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$formfile = new FormFile($db);
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$formproject = new FormProjets($db);
|
||||
}
|
||||
|
||||
$help_url = 'EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks';
|
||||
llxHeader("", $langs->trans("WarehouseCard"), $help_url);
|
||||
@ -268,6 +282,15 @@ if ($action == 'create') {
|
||||
print img_picto('', 'stock').$formproduct->selectWarehouses((GETPOSTISSET('fk_parent') ? GETPOST('fk_parent', 'int') : 'ifone'), 'fk_parent', '', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load('projects');
|
||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
||||
print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
// Editeur wysiwyg
|
||||
@ -382,6 +405,38 @@ if ($action == 'create') {
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
$morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu;
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.img_picto('', 'project').' '.$langs->trans('Project').' ';
|
||||
if ($usercancreate) {
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
|
||||
}
|
||||
if ($action == 'classify') {
|
||||
$projectid = $object->fk_project;
|
||||
$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(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
$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>';
|
||||
|
||||
$shownav = 1;
|
||||
@ -489,7 +544,7 @@ if ($action == 'create') {
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
if (empty($action)) {
|
||||
if (empty($action) || $action == 'classin') {
|
||||
if ($user->rights->stock->creer) {
|
||||
print '<a class="butAction" href="card.php?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Modify").'</a>';
|
||||
} else {
|
||||
@ -708,6 +763,16 @@ if ($action == 'create') {
|
||||
print $formproduct->selectWarehouses($object->fk_parent, 'fk_parent', '', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Project
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$projectid = $object->fk_project;
|
||||
$langs->load('projects');
|
||||
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
|
||||
print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
|
||||
print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
// Editeur wysiwyg
|
||||
|
||||
@ -108,6 +108,11 @@ class Entrepot extends CommonObject
|
||||
*/
|
||||
public $fk_parent;
|
||||
|
||||
/**
|
||||
* @var int ID of project
|
||||
*/
|
||||
public $fk_project;
|
||||
|
||||
/**
|
||||
* @var array List of short language codes for status
|
||||
*/
|
||||
@ -124,6 +129,7 @@ class Entrepot extends CommonObject
|
||||
'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35, 'searchall'=>1),
|
||||
'lieu' =>array('type'=>'varchar(64)', 'label'=>'LocationSummary', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'showoncombobox'=>1, 'searchall'=>1),
|
||||
'fk_parent' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:1:statut=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ParentWarehouse', 'enabled'=>1, 'visible'=>-2, 'position'=>41),
|
||||
'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
|
||||
'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-2, 'position'=>45, 'searchall'=>1),
|
||||
'zip' =>array('type'=>'varchar(10)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-2, 'position'=>50, 'searchall'=>1),
|
||||
'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-2, 'position'=>55, 'searchall'=>1),
|
||||
@ -198,8 +204,8 @@ class Entrepot extends CommonObject
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent)";
|
||||
$sql .= " VALUES ('".$this->db->escape($this->label)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")";
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent, fk_project)";
|
||||
$sql .= " VALUES ('".$this->db->escape($this->label)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").", ".($this->fk_project > 0 ? $this->fk_project : "NULL").")";
|
||||
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@ -290,6 +296,7 @@ class Entrepot extends CommonObject
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."entrepot ";
|
||||
$sql .= " SET ref = '".$this->db->escape($this->label)."'";
|
||||
$sql .= ", fk_parent = ".(($this->fk_parent > 0) ? $this->fk_parent : "NULL");
|
||||
$sql .= ", fk_project = ".(($this->fk_project > 0) ? $this->fk_project : "NULL");
|
||||
$sql .= ", description = '".$this->db->escape($this->description)."'";
|
||||
$sql .= ", statut = ".$this->statut;
|
||||
$sql .= ", lieu = '".$this->db->escape($this->lieu)."'";
|
||||
@ -432,7 +439,7 @@ class Entrepot extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = "SELECT rowid, entity, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id, phone, fax,";
|
||||
$sql = "SELECT rowid, entity, fk_parent, fk_project, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id, phone, fax,";
|
||||
$sql .= " model_pdf, import_key";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."entrepot";
|
||||
if ($id) {
|
||||
@ -452,6 +459,7 @@ class Entrepot extends CommonObject
|
||||
$this->id = $obj->rowid;
|
||||
$this->entity = $obj->entity;
|
||||
$this->fk_parent = $obj->fk_parent;
|
||||
$this->fk_project = $obj->fk_project;
|
||||
$this->ref = $obj->label;
|
||||
$this->label = $obj->label;
|
||||
$this->libelle = $obj->label; // deprecated
|
||||
|
||||
Loading…
Reference in New Issue
Block a user