Merge branch 'develop' into Squiz.Scope.MethodScope.Missing

This commit is contained in:
Laurent Destailleur 2019-02-27 15:48:31 +01:00 committed by GitHub
commit b3fb0eaf5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 282 additions and 125 deletions

View File

@ -354,6 +354,22 @@ class Documents extends DolibarrApi
$upload_dir = $conf->facture->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'invoice'); $upload_dir = $conf->facture->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'invoice');
} }
else if ($modulepart == 'produit' || $modulepart == 'product')
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (!DolibarrApiAccess::$user->rights->produit->lire) {
throw new RestException(401);
}
$object = new Product($this->db);
$result=$object->fetch($id, $ref);
if ( ! $result ) {
throw new RestException(404, 'Product not found');
}
$upload_dir = $conf->product->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'product');
}
else if ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') else if ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event')
{ {
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';

View File

@ -1357,7 +1357,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
$sql.= ", p.date_livraison as date_livraison"; $sql.= ", p.date_livraison as date_livraison";
$sql.= ", p.model_pdf, p.last_main_doc, p.ref_client, p.extraparams"; $sql.= ", p.model_pdf, p.last_main_doc, p.ref_client, p.extraparams";
$sql.= ", p.note_private, p.note_public"; $sql.= ", p.note_private, p.note_public";
$sql.= ", p.fk_projet, p.fk_statut"; $sql.= ", p.fk_projet as fk_project, p.fk_statut";
$sql.= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture"; $sql.= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture";
$sql.= ", p.fk_delivery_address"; $sql.= ", p.fk_delivery_address";
$sql.= ", p.fk_availability"; $sql.= ", p.fk_availability";
@ -1412,7 +1412,7 @@ dol_syslog(get_class($this)."::updateLine rowid=$rowid, pu=$pu, qty=$qty, remise
$this->total_localtax2 = $obj->localtax2; $this->total_localtax2 = $obj->localtax2;
$this->total_ttc = $obj->total; $this->total_ttc = $obj->total;
$this->socid = $obj->fk_soc; $this->socid = $obj->fk_soc;
$this->fk_project = $obj->fk_projet; $this->fk_project = $obj->fk_project;
$this->modelpdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf;
$this->last_main_doc = $obj->last_main_doc; $this->last_main_doc = $obj->last_main_doc;
$this->note = $obj->note_private; // TODO deprecated $this->note = $obj->note_private; // TODO deprecated

View File

@ -247,7 +247,7 @@ class Deplacement extends CommonObject
*/ */
public function fetch($id, $ref = '') public function fetch($id, $ref = '')
{ {
$sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet, extraparams"; $sql = "SELECT rowid, fk_user, type, fk_statut, km, fk_soc, dated, note_private, note_public, fk_projet as fk_project, extraparams";
$sql.= " FROM ".MAIN_DB_PREFIX."deplacement"; $sql.= " FROM ".MAIN_DB_PREFIX."deplacement";
$sql.= " WHERE entity IN (".getEntity('deplacement').")"; $sql.= " WHERE entity IN (".getEntity('deplacement').")";
if ($ref) $sql.= " AND ref ='".$this->db->escape($ref)."'"; if ($ref) $sql.= " AND ref ='".$this->db->escape($ref)."'";
@ -269,7 +269,7 @@ class Deplacement extends CommonObject
$this->statut = $obj->fk_statut; $this->statut = $obj->fk_statut;
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->fk_project = $obj->fk_projet; $this->fk_project = $obj->fk_project;
$this->extraparams = (array) json_decode($obj->extraparams, true); $this->extraparams = (array) json_decode($obj->extraparams, true);

View File

@ -1159,30 +1159,6 @@ class Facture extends CommonInvoice
else return -1; else return -1;
} }
/**
* Return link to download file from a direct external access
*
* @param int $withpicto Add download picto into link
* @return string HTML link to file
*/
function getDirectExternalLink($withpicto = 0)
{
global $dolibarr_main_url_root;
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
// TODO Read into ecmfile table to get entry and hash exists (PS: If not found, add it)
include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
$ecmfile=new EcmFiles($this->db);
//$result = $ecmfile->get();
$hashp='todo';
return '<a href="'.$urlwithroot.'/document.php?modulepart=invoice&hashp='.$hashp.'" target="_download" rel="noindex, nofollow">'.$this->ref.'</a>';
}
/** /**
* Return clicable link of object (with eventually picto) * Return clicable link of object (with eventually picto)
* *

View File

@ -621,7 +621,7 @@ class Contrat extends CommonObject
$sql.= " ref_ext,"; $sql.= " ref_ext,";
$sql.= " fk_user_mise_en_service, date_contrat as datecontrat,"; $sql.= " fk_user_mise_en_service, date_contrat as datecontrat,";
$sql.= " fk_user_author, fin_validite, date_cloture,"; $sql.= " fk_user_author, fin_validite, date_cloture,";
$sql.= " fk_projet,"; $sql.= " fk_projet as fk_project,";
$sql.= " fk_commercial_signature, fk_commercial_suivi,"; $sql.= " fk_commercial_signature, fk_commercial_suivi,";
$sql.= " note_private, note_public, model_pdf, extraparams"; $sql.= " note_private, note_public, model_pdf, extraparams";
$sql.= " FROM ".MAIN_DB_PREFIX."contrat"; $sql.= " FROM ".MAIN_DB_PREFIX."contrat";
@ -672,8 +672,8 @@ class Contrat extends CommonObject
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->modelpdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf;
$this->fk_projet = $obj->fk_projet; // deprecated $this->fk_projet = $obj->fk_project; // deprecated
$this->fk_project = $obj->fk_projet; $this->fk_project = $obj->fk_project;
$this->socid = $obj->fk_soc; $this->socid = $obj->fk_soc;
$this->fk_soc = $obj->fk_soc; $this->fk_soc = $obj->fk_soc;

View File

@ -303,17 +303,6 @@ class EmailSenderProfile extends CommonObject
return $result; return $result;
} }
/**
* Return link to download file from a direct external access
*
* @param int $withpicto Add download picto into link
* @return string HTML link to file
*/
function getDirectExternalLink($withpicto = 0)
{
return 'todo';
}
/** /**
* Retourne le libelle du status d'un user (actif, inactif) * Retourne le libelle du status d'un user (actif, inactif)
* *

View File

@ -3682,6 +3682,75 @@ class Form
return $num; return $num;
} }
/**
* Return a HTML select list of establishment
*
* @param string $selected Id establishment pre-selected
* @param string $htmlname Name of select zone
* @param int $statut Status of searched establishment (0=open, 1=closed, 2=both)
* @param string $filtre To filter list
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
* @param string $moreattrib To add more attribute on select
* @return int <0 if error, Num of establishment found if OK (0, 1, 2, ...)
*/
function selectEstablishments($selected = '', $htmlname = 'entity', $statut = 0, $filtre = '', $useempty = 0, $moreattrib = '')
{
// phpcs:enable
global $langs, $conf;
$langs->load("admin");
$num = 0;
$sql = "SELECT rowid, name, fk_country, status, entity";
$sql.= " FROM ".MAIN_DB_PREFIX."establishment";
$sql.= " WHERE 1=1";
if ($statut != 2) $sql.= " AND status = '".$statut."'";
if ($filtre) $sql.=" AND ".$filtre;
$sql.= " ORDER BY name";
dol_syslog(get_class($this)."::select_establishment", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
$num = $this->db->num_rows($result);
$i = 0;
if ($num)
{
print '<select id="select'.$htmlname.'" class="flat selectestablishment" name="'.$htmlname.'"'.($moreattrib?' '.$moreattrib:'').'>';
if ($useempty == 1 || ($useempty == 2 && $num > 1))
{
print '<option value="-1">&nbsp;</option>';
}
while ($i < $num)
{
$obj = $this->db->fetch_object($result);
if ($selected == $obj->rowid)
{
print '<option value="'.$obj->rowid.'" selected>';
}
else
{
print '<option value="'.$obj->rowid.'">';
}
print trim($obj->name);
if ($statut == 2 && $obj->status == 1) print ' ('.$langs->trans("Closed").')';
print '</option>';
$i++;
}
print "</select>";
}
else
{
if ($statut == 0) print '<span class="opacitymedium">'.$langs->trans("NoActiveEstablishmentDefined").'</span>';
else print '<span class="opacitymedium">'.$langs->trans("NoEstablishmentFound").'</span>';
}
}
else {
dol_print_error($this->db);
}
}
/** /**
* Display form to select bank account * Display form to select bank account
* *

View File

@ -3081,7 +3081,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
elseif ($pictowithoutext == 'jabber') { elseif ($pictowithoutext == 'jabber') {
$fakey = 'fa-comment-o'; $fakey = 'fa-comment-o';
} }
elseif ($pictowithoutext == 'skype') { elseif (in_array($pictowithoutext, array('skype', 'twitter', 'facebook', 'linkedin'))) {
$fakey = 'fa-'.$pictowithoutext; $fakey = 'fa-'.$pictowithoutext;
if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa = 'fab'; if (! empty($conf->global->MAIN_USE_FONT_AWESOME_5)) $fa = 'fab';
} }

View File

@ -527,7 +527,7 @@ class Expedition extends CommonObject
// Check parameters // Check parameters
if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1; if (empty($id) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
$sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet, e.billed"; $sql = "SELECT e.rowid, e.ref, e.fk_soc as socid, e.date_creation, e.ref_customer, e.ref_ext, e.ref_int, e.fk_user_author, e.fk_statut, e.fk_projet as fk_project, e.billed";
$sql.= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height"; $sql.= ", e.weight, e.weight_units, e.size, e.size_units, e.width, e.height";
$sql.= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery"; $sql.= ", e.date_expedition as date_expedition, e.model_pdf, e.fk_address, e.date_delivery";
$sql.= ", e.fk_shipping_method, e.tracking_number"; $sql.= ", e.fk_shipping_method, e.tracking_number";
@ -575,7 +575,7 @@ class Expedition extends CommonObject
$this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility $this->origin = ($obj->origin?$obj->origin:'commande'); // For compatibility
$this->origin_id = $obj->origin_id; $this->origin_id = $obj->origin_id;
$this->billed = $obj->billed; $this->billed = $obj->billed;
$this->fk_project = $obj->fk_projet; $this->fk_project = $obj->fk_project;
$this->trueWeight = $obj->weight; $this->trueWeight = $obj->weight;
$this->weight_units = $obj->weight_units; $this->weight_units = $obj->weight_units;

View File

@ -379,7 +379,7 @@ class Fichinter extends CommonObject
$sql.= " f.datec, f.dateo, f.datee, f.datet, f.fk_user_author,"; $sql.= " f.datec, f.dateo, f.datee, f.datet, f.fk_user_author,";
$sql.= " f.date_valid as datev,"; $sql.= " f.date_valid as datev,";
$sql.= " f.tms as datem,"; $sql.= " f.tms as datem,";
$sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat"; $sql.= " f.duree, f.fk_projet as fk_project, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat";
$sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f";
if ($ref) { if ($ref) {
$sql.= " WHERE f.entity IN (".getEntity('intervention').")"; $sql.= " WHERE f.entity IN (".getEntity('intervention').")";
@ -407,7 +407,7 @@ class Fichinter extends CommonObject
$this->datet = $this->db->jdate($obj->datet); $this->datet = $this->db->jdate($obj->datet);
$this->datev = $this->db->jdate($obj->datev); $this->datev = $this->db->jdate($obj->datev);
$this->datem = $this->db->jdate($obj->datem); $this->datem = $this->db->jdate($obj->datem);
$this->fk_project = $obj->fk_projet; $this->fk_project = $obj->fk_project;
$this->note_public = $obj->note_public; $this->note_public = $obj->note_public;
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;
$this->modelpdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf;

View File

@ -78,7 +78,7 @@ dol_fiche_head($head, 'establishments', $langs->trans("HRM"), -1, "user");
$sql = "SELECT e.rowid, e.name, e.address, e.zip, e.town, e.status"; $sql = "SELECT e.rowid, e.name, e.address, e.zip, e.town, e.status";
$sql.= " FROM ".MAIN_DB_PREFIX."establishment as e"; $sql.= " FROM ".MAIN_DB_PREFIX."establishment as e";
$sql.= " WHERE e.entity = ".$conf->entity; $sql.= " WHERE e.entity IN (".getEntity('establishment').')';
$sql.= $db->order($sortfield, $sortorder); $sql.= $db->order($sortfield, $sortorder);
$sql.= $db->plimit($limit+1, $offset); $sql.= $db->plimit($limit+1, $offset);

View File

@ -208,6 +208,7 @@ class Establishment extends CommonObject
$sql .= ", fk_country = ".($this->country_id > 0 ? $this->country_id : 'null'); $sql .= ", fk_country = ".($this->country_id > 0 ? $this->country_id : 'null');
$sql .= ", status = ".$this->db->escape($this->status); $sql .= ", status = ".$this->db->escape($this->status);
$sql .= ", fk_user_mod = " . $user->id; $sql .= ", fk_user_mod = " . $user->id;
$sql .= ", entity = " . $this->entity;
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG); dol_syslog(get_class($this) . "::update sql=" . $sql, LOG_DEBUG);
@ -230,7 +231,7 @@ class Establishment extends CommonObject
*/ */
public function fetch($id) public function fetch($id)
{ {
$sql = "SELECT e.rowid, e.name, e.address, e.zip, e.town, e.status, e.fk_country as country_id,"; $sql = "SELECT e.rowid, e.name, e.address, e.zip, e.town, e.status, e.fk_country as country_id, e.entity,";
$sql.= ' c.code as country_code, c.label as country'; $sql.= ' c.code as country_code, c.label as country';
$sql.= " FROM ".MAIN_DB_PREFIX."establishment as e"; $sql.= " FROM ".MAIN_DB_PREFIX."establishment as e";
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON e.fk_country = c.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON e.fk_country = c.rowid';
@ -249,6 +250,7 @@ class Establishment extends CommonObject
$this->zip = $obj->zip; $this->zip = $obj->zip;
$this->town = $obj->town; $this->town = $obj->town;
$this->status = $obj->status; $this->status = $obj->status;
$this->entity = $obj->entity;
$this->country_id = $obj->country_id; $this->country_id = $obj->country_id;
$this->country_code = $obj->country_code; $this->country_code = $obj->country_code;
@ -352,7 +354,7 @@ class Establishment extends CommonObject
*/ */
public function info($id) public function info($id)
{ {
$sql = 'SELECT e.rowid, e.datec, e.fk_user_author, e.tms, e.fk_user_mod'; $sql = 'SELECT e.rowid, e.datec, e.fk_user_author, e.tms, e.fk_user_mod, e.entity';
$sql.= ' FROM '.MAIN_DB_PREFIX.'establishment as e'; $sql.= ' FROM '.MAIN_DB_PREFIX.'establishment as e';
$sql.= ' WHERE e.rowid = '.$id; $sql.= ' WHERE e.rowid = '.$id;
@ -390,6 +392,37 @@ class Establishment extends CommonObject
} }
} }
/**
* Get on record Establishment
*
* @param int $id Id of record
* @return obj
*/
function getEstablishment($id)
{
$sql = 'SELECT e.rowid, e.name, e.datec, e.fk_user_author, e.tms, e.fk_user_mod, e.entity';
$sql.= ' FROM '.MAIN_DB_PREFIX.'establishment as e';
$sql.= ' WHERE e.rowid = '.$id;
dol_syslog(get_class($this)."::fetch info", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
}
$this->db->free($result);
}
else
{
dol_print_error($this->db);
}
return $obj;
}
/** /**
* Return clicable name (with picto eventually) * Return clicable name (with picto eventually)
* *
@ -415,6 +448,34 @@ class Establishment extends CommonObject
return $result; return $result;
} }
/**
* Return clicable name (with picto eventually)
*
* @param int $id Id of record
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
* @return string String with URL
*/
function getNomUrlParent($id = 0, $withpicto = 0)
{
global $langs;
$result='';
$obj = $this->getEstablishment(($id>0)?$id:$conf->entity);
$link = '<a href="'.DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$obj->rowid.'">';
$linkend='</a>';
$picto='building';
$label=$langs->trans("Show").': '.$obj->name;
if ($withpicto) $result.=($link.img_object($label, $picto).$linkend);
if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$link.$obj->name.$linkend;
return $result;
}
/** /**
* Return account country code * Return account country code
* *

View File

@ -92,8 +92,7 @@ elseif ($action == 'add')
$object->status = GETPOST('status', 'int'); $object->status = GETPOST('status', 'int');
$object->fk_user_author = $user->id; $object->fk_user_author = $user->id;
$object->datec = dol_now(); $object->datec = dol_now();
$object->entity = GETPOST('entity', 'int')>0?GETPOST('entity', 'int'):$conf->entity;
$id = $object->create($user); $id = $object->create($user);
@ -141,6 +140,7 @@ elseif ($action == 'update')
$object->country_id = GETPOST('country_id', 'int'); $object->country_id = GETPOST('country_id', 'int');
$object->fk_user_mod = $user->id; $object->fk_user_mod = $user->id;
$object->status = GETPOST('status', 'int'); $object->status = GETPOST('status', 'int');
$object->entity = GETPOST('entity', 'int')>0?GETPOST('entity', 'int'):$conf->entity;
$result = $object->update($user); $result = $object->update($user);
@ -190,6 +190,14 @@ if ($action == 'create')
print '<td><input name="name" id="name" size="32" value="' . GETPOST("name", "alpha") . '"></td>'; print '<td><input name="name" id="name" size="32" value="' . GETPOST("name", "alpha") . '"></td>';
print '</tr>'; print '</tr>';
// Parent
print '<tr>';
print '<td>'.$form->editfieldkey('Parent', 'entity', '', $object, 0, 'string', '', 1).'</td>';
print '<td class="maxwidthonsmartphone">';
print $form->selectEstablishments(GETPOST('entity', 'int')>0?GETPOST('entity', 'int'):$conf->entity, 'entity', 1);
print '</td>';
print '</tr>';
// Address // Address
print '<tr>'; print '<tr>';
print '<td>'.$form->editfieldkey('Address', 'address', '', $object, 0).'</td>'; print '<td>'.$form->editfieldkey('Address', 'address', '', $object, 0).'</td>';
@ -284,6 +292,12 @@ if (($id || $ref) && $action == 'edit')
print '<input name="name" id="name" class="flat" size="32" value="'.$object->name.'">'; print '<input name="name" id="name" class="flat" size="32" value="'.$object->name.'">';
print '</td></tr>'; print '</td></tr>';
// Parent
print '<tr><td>'.$form->editfieldkey('Parent', 'entity', '', $object, 0, 'string', '', 1).'</td>';
print '<td class="maxwidthonsmartphone">';
print $form->selectEstablishments($object->entity>0?$object->entity:$conf->entity, 'entity', 1);
print '</td></tr>';
// Address // Address
print '<tr><td>'.$form->editfieldkey('Address', 'address', '', $object, 0).'</td>'; print '<tr><td>'.$form->editfieldkey('Address', 'address', '', $object, 0).'</td>';
print '<td>'; print '<td>';
@ -367,6 +381,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td>'.$object->name.'</td>'; print '<td>'.$object->name.'</td>';
print '</tr>'; print '</tr>';
// Parent
print '<tr>';
print '<td class="titlefield">'.$langs->trans("Parent").'</td>';
print '<td>'.$object->getNomUrlParent($object->entity).'</td>';
print '</tr>';
// Address // Address
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans("Address").'</td>'; print '<td>'.$langs->trans("Address").'</td>';

View File

@ -2846,7 +2846,7 @@ function migrate_project_task_actors($db, $langs, $conf)
$db->begin(); $db->begin();
$sql = "SELECT fk_projet_task, fk_user FROM ".MAIN_DB_PREFIX."projet_task_actors"; $sql = "SELECT fk_projet_task as fk_project_task, fk_user FROM ".MAIN_DB_PREFIX."projet_task_actors";
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
@ -2868,7 +2868,7 @@ function migrate_project_task_actors($db, $langs, $conf)
$sql2.= ") VALUES ("; $sql2.= ") VALUES (";
$sql2.= "'".$db->idate(dol_now())."'"; $sql2.= "'".$db->idate(dol_now())."'";
$sql2.= ", '4'"; $sql2.= ", '4'";
$sql2.= ", ".$obj->fk_projet_task; $sql2.= ", ".$obj->fk_project_task;
$sql2.= ", '180'"; $sql2.= ", '180'";
$sql2.= ", ".$obj->fk_user; $sql2.= ", ".$obj->fk_user;
$sql2.= ")"; $sql2.= ")";

View File

@ -885,7 +885,6 @@ LineNb=Line no.
IncotermLabel=Incoterms IncotermLabel=Incoterms
TabLetteringCustomer=Customer lettering TabLetteringCustomer=Customer lettering
TabLetteringSupplier=Vendor lettering TabLetteringSupplier=Vendor lettering
# Week day
Monday=Monday Monday=Monday
Tuesday=Tuesday Tuesday=Tuesday
Wednesday=Wednesday Wednesday=Wednesday
@ -965,3 +964,4 @@ SelectAThirdPartyFirst=Select a third party first...
YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode
Inventory=Inventory Inventory=Inventory
AnalyticCode=Analytic code AnalyticCode=Analytic code
TMenuMRP=MRP

View File

@ -109,3 +109,4 @@ UserLogoff=User logout
UserLogged=User logged UserLogged=User logged
DateEmployment=Employment Start Date DateEmployment=Employment Start Date
DateEmploymentEnd=Employment End Date DateEmploymentEnd=Employment End Date
CantDisableYourself=You can disable your own user record

View File

@ -238,7 +238,7 @@ class Task extends CommonObject
$sql = "SELECT"; $sql = "SELECT";
$sql.= " t.rowid,"; $sql.= " t.rowid,";
$sql.= " t.ref,"; $sql.= " t.ref,";
$sql.= " t.fk_projet,"; $sql.= " t.fk_projet as fk_project,";
$sql.= " t.fk_task_parent,"; $sql.= " t.fk_task_parent,";
$sql.= " t.label,"; $sql.= " t.label,";
$sql.= " t.description,"; $sql.= " t.description,";
@ -281,7 +281,7 @@ class Task extends CommonObject
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->ref; $this->ref = $obj->ref;
$this->fk_project = $obj->fk_projet; $this->fk_project = $obj->fk_project;
$this->fk_task_parent = $obj->fk_task_parent; $this->fk_task_parent = $obj->fk_task_parent;
$this->label = $obj->label; $this->label = $obj->label;
$this->description = $obj->description; $this->description = $obj->description;

View File

@ -838,6 +838,7 @@ if ($source == 'order')
// Debitor // Debitor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("ThirdParty"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("ThirdParty");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$order->thirdparty->name.'</b>'; print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$order->thirdparty->name.'</b>';
print '</td></tr>'."\n";
// Object // Object
$text='<b>'.$langs->trans("PaymentOrderRef", $order->ref).'</b>'; $text='<b>'.$langs->trans("PaymentOrderRef", $order->ref).'</b>';
@ -958,6 +959,7 @@ if ($source == 'invoice')
// Debitor // Debitor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("ThirdParty"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("ThirdParty");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$invoice->thirdparty->name.'</b>'; print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$invoice->thirdparty->name.'</b>';
print '</td></tr>'."\n";
// Object // Object
$text='<b>'.$langs->trans("PaymentInvoiceRef", $invoice->ref).'</b>'; $text='<b>'.$langs->trans("PaymentInvoiceRef", $invoice->ref).'</b>';
@ -1009,15 +1011,6 @@ if ($source == 'invoice')
print '<input type="hidden" name="fulltag" value="'.$fulltag.'">'; print '<input type="hidden" name="fulltag" value="'.$fulltag.'">';
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Add download link
if ($download > 0)
{
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Document");
print '</td><td class="CTableRow'.($var?'1':'2').'">';
print $invoice->getDirectExternalLink(1);
print '</td></tr>'."\n";
}
// Shipping address // Shipping address
$shipToName=$invoice->thirdparty->name; $shipToName=$invoice->thirdparty->name;
$shipToStreet=$invoice->thirdparty->address; $shipToStreet=$invoice->thirdparty->address;
@ -1295,22 +1288,20 @@ if ($source == 'membersubscription')
$fulltag=dol_string_unaccent($fulltag); $fulltag=dol_string_unaccent($fulltag);
// Creditor // Creditor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$creditor.'</b>'; print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$creditor.'</b>';
print '<input type="hidden" name="creditor" value="'.$creditor.'">'; print '<input type="hidden" name="creditor" value="'.$creditor.'">';
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Debitor // Debitor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Member"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Member");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'; print '</td><td class="CTableRow'.($var?'1':'2').'"><b>';
if ($member->morphy == 'mor' && ! empty($member->societe)) print $member->societe; if ($member->morphy == 'mor' && ! empty($member->societe)) print $member->societe;
else print $member->getFullName($langs); else print $member->getFullName($langs);
print '</b>'; print '</b>';
print '</td></tr>'."\n";
// Object // Object
$text='<b>'.$langs->trans("PaymentSubscription").'</b>'; $text='<b>'.$langs->trans("PaymentSubscription").'</b>';
if (GETPOST('desc', 'alpha')) $text='<b>'.$langs->trans(GETPOST('desc', 'alpha')).'</b>'; if (GETPOST('desc', 'alpha')) $text='<b>'.$langs->trans(GETPOST('desc', 'alpha')).'</b>';
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
@ -1343,7 +1334,6 @@ if ($source == 'membersubscription')
} }
// Amount // Amount
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
if (empty($amount)) if (empty($amount))
{ {
@ -1391,7 +1381,6 @@ if ($source == 'membersubscription')
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Tag // Tag
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b style="word-break: break-all;">'.$fulltag.'</b>'; print '</td><td class="CTableRow'.($var?'1':'2').'"><b style="word-break: break-all;">'.$fulltag.'</b>';
print '<input type="hidden" name="tag" value="'.$tag.'">'; print '<input type="hidden" name="tag" value="'.$tag.'">';
@ -1463,22 +1452,20 @@ if ($source == 'donation')
$fulltag=dol_string_unaccent($fulltag); $fulltag=dol_string_unaccent($fulltag);
// Creditor // Creditor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Creditor");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$creditor.'</b>'; print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'.$creditor.'</b>';
print '<input type="hidden" name="creditor" value="'.$creditor.'">'; print '<input type="hidden" name="creditor" value="'.$creditor.'">';
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Debitor // Debitor
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("ThirdParty"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("ThirdParty");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b>'; print '</td><td class="CTableRow'.($var?'1':'2').'"><b>';
if ($don->morphy == 'mor' && ! empty($don->societe)) print $don->societe; if ($don->morphy == 'mor' && ! empty($don->societe)) print $don->societe;
else print $don->getFullName($langs); else print $don->getFullName($langs);
print '</b>'; print '</b>';
print '</td></tr>'."\n";
// Object // Object
$text='<b>'.$langs->trans("PaymentDonation").'</b>'; $text='<b>'.$langs->trans("PaymentDonation").'</b>';
if (GETPOST('desc', 'alpha')) $text='<b>'.$langs->trans(GETPOST('desc', 'alpha')).'</b>'; if (GETPOST('desc', 'alpha')) $text='<b>'.$langs->trans(GETPOST('desc', 'alpha')).'</b>';
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Designation");
@ -1488,7 +1475,6 @@ if ($source == 'donation')
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Amount // Amount
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("Amount");
if (empty($amount)) if (empty($amount))
{ {
@ -1536,7 +1522,6 @@ if ($source == 'donation')
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Tag // Tag
print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode"); print '<tr class="CTableRow'.($var?'1':'2').'"><td class="CTableRow'.($var?'1':'2').'">'.$langs->trans("PaymentCode");
print '</td><td class="CTableRow'.($var?'1':'2').'"><b style="word-break: break-all;">'.$fulltag.'</b>'; print '</td><td class="CTableRow'.($var?'1':'2').'"><b style="word-break: break-all;">'.$fulltag.'</b>';
print '<input type="hidden" name="tag" value="'.$tag.'">'; print '<input type="hidden" name="tag" value="'.$tag.'">';

View File

@ -401,17 +401,6 @@ class SocieteAccount extends CommonObject
return $result; return $result;
} }
/**
* Return link to download file from a direct external access
*
* @param int $withpicto Add download picto into link
* @return string HTML link to file
*/
function getDirectExternalLink($withpicto = 0)
{
return 'todo';
}
/** /**
* Retourne le libelle du status d'un user (actif, inactif) * Retourne le libelle du status d'un user (actif, inactif)
* *

View File

@ -1226,7 +1226,7 @@ class SupplierProposal extends CommonObject
$sql.= ", p.date_livraison as date_livraison"; $sql.= ", p.date_livraison as date_livraison";
$sql.= ", p.model_pdf, p.extraparams"; $sql.= ", p.model_pdf, p.extraparams";
$sql.= ", p.note_private, p.note_public"; $sql.= ", p.note_private, p.note_public";
$sql.= ", p.fk_projet, p.fk_statut"; $sql.= ", p.fk_projet as fk_project, p.fk_statut";
$sql.= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture"; $sql.= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture";
$sql.= ", p.fk_cond_reglement"; $sql.= ", p.fk_cond_reglement";
$sql.= ", p.fk_mode_reglement"; $sql.= ", p.fk_mode_reglement";
@ -1266,7 +1266,7 @@ class SupplierProposal extends CommonObject
$this->total_localtax2 = $obj->localtax2; $this->total_localtax2 = $obj->localtax2;
$this->total_ttc = $obj->total; $this->total_ttc = $obj->total;
$this->socid = $obj->fk_soc; $this->socid = $obj->fk_soc;
$this->fk_project = $obj->fk_projet; $this->fk_project = $obj->fk_project;
$this->modelpdf = $obj->model_pdf; $this->modelpdf = $obj->model_pdf;
$this->note = $obj->note_private; // TODO deprecated $this->note = $obj->note_private; // TODO deprecated
$this->note_private = $obj->note_private; $this->note_private = $obj->note_private;

View File

@ -81,7 +81,6 @@ elseif ($query=="pro")
$file = array_pop($match); $file = array_pop($match);
if ($file=="") header('Location: ../../public/theme/common/nophoto.png'); if ($file=="") header('Location: ../../public/theme/common/nophoto.png');
else header('Location: '.$file); else header('Location: '.$file);
} }
else else
{ {

View File

@ -271,7 +271,7 @@ body {
.thumbstat { font-weight: bold !important; } .thumbstat { font-weight: bold !important; }
th a { font-weight: <?php echo ($useboldtitle?'bold':'normal'); ?> !important; } th a { font-weight: <?php echo ($useboldtitle?'bold':'normal'); ?> !important; }
a.tab { font-weight: bold !important; } a.tab { font-weight: 500 !important; }
a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: normal; color: rgb(<?php print $colortextlink; ?>); text-decoration: none; } a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: normal; color: rgb(<?php print $colortextlink; ?>); text-decoration: none; }
a:hover { text-decoration: underline; color: rgb(<?php print $colortextlink; ?>); } a:hover { text-decoration: underline; color: rgb(<?php print $colortextlink; ?>); }
@ -1591,8 +1591,10 @@ div.tmenudiv {
div.tmenudisabled, a.tmenudisabled { div.tmenudisabled, a.tmenudisabled {
opacity: 0.6; opacity: 0.6;
} }
a.tmenu, a.tmenusel, a.tmenudisabled {
font-weight: 300;
}
a.tmenudisabled:link, a.tmenudisabled:visited, a.tmenudisabled:hover, a.tmenudisabled:active { a.tmenudisabled:link, a.tmenudisabled:visited, a.tmenudisabled:hover, a.tmenudisabled:active {
font-weight: normal;
padding: 0px 5px 0px 5px; padding: 0px 5px 0px 5px;
white-space: nowrap; white-space: nowrap;
color: #<?php echo $colortextbackhmenu; ?>; color: #<?php echo $colortextbackhmenu; ?>;
@ -1601,14 +1603,12 @@ a.tmenudisabled:link, a.tmenudisabled:visited, a.tmenudisabled:hover, a.tmenudis
} }
a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active { a.tmenu:link, a.tmenu:visited, a.tmenu:hover, a.tmenu:active {
font-weight: normal;
padding: 0px 4px 0px 4px; padding: 0px 4px 0px 4px;
white-space: nowrap; white-space: nowrap;
color: #<?php echo $colortextbackhmenu; ?>; color: #<?php echo $colortextbackhmenu; ?>;
text-decoration: none; text-decoration: none;
} }
a.tmenusel:link, a.tmenusel:visited, a.tmenusel:hover, a.tmenusel:active { a.tmenusel:link, a.tmenusel:visited, a.tmenusel:hover, a.tmenusel:active {
font-weight: normal;
padding: 0px 4px 0px 4px; padding: 0px 4px 0px 4px;
margin: 0px 0px 0px 0px; margin: 0px 0px 0px 0px;
white-space: nowrap; white-space: nowrap;
@ -2162,8 +2162,8 @@ input.vmenusearchselectcombo[type=text] {
.searchform input { font-size: 16px; } .searchform input { font-size: 16px; }
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu { white-space: nowrap; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; } a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active, span.vmenu { white-space: nowrap; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; } /* bold = 600, 500 is ko with Edge on 1200x960 */
font.vmenudisabled { font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; } font.vmenudisabled { font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; } /* bold = 600, 500 is ko with Edge on 1200x960 */
a.vmenu:link, a.vmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; } a.vmenu:link, a.vmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; }
a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 6px; } a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 6px; }

View File

@ -264,7 +264,7 @@ body {
.thumbstat { font-weight: bold !important; } .thumbstat { font-weight: bold !important; }
th a { font-weight: <?php echo ($useboldtitle?'bold':'normal'); ?> !important; } th a { font-weight: <?php echo ($useboldtitle?'bold':'normal'); ?> !important; }
a.tab { font-weight: bold !important; } a.tab { font-weight: 500 !important; }
a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: normal; color: rgb(<?php print $colortextlink; ?>); text-decoration: none; } a:link, a:visited, a:hover, a:active { font-family: <?php print $fontlist ?>; font-weight: normal; color: rgb(<?php print $colortextlink; ?>); text-decoration: none; }
a:hover { text-decoration: underline; color: rgb(<?php print $colortextlink; ?>); } a:hover { text-decoration: underline; color: rgb(<?php print $colortextlink; ?>); }

View File

@ -48,6 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
@ -91,7 +92,7 @@ $result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
if ($user->id <> $id && ! $canreaduser) accessforbidden(); if ($user->id <> $id && ! $canreaduser) accessforbidden();
// Load translation files required by page // Load translation files required by page
$langs->loadLangs(array('users', 'companies', 'ldap', 'admin', 'hrm')); $langs->loadLangs(array('users', 'companies', 'ldap', 'admin', 'hrm', 'stocks'));
$object = new User($db); $object = new User($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
@ -238,6 +239,8 @@ if (empty($reshook)) {
$dateemploymentend = dol_mktime(0, 0, 0, GETPOST('dateemploymentendmonth'), GETPOST('dateemploymentendday'), GETPOST('dateemploymentendyear')); $dateemploymentend = dol_mktime(0, 0, 0, GETPOST('dateemploymentendmonth'), GETPOST('dateemploymentendday'), GETPOST('dateemploymentendyear'));
$object->dateemploymentend = $dateemploymentend; $object->dateemploymentend = $dateemploymentend;
$object->fk_warehouse = GETPOST('fk_warehouse', 'int');
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object); $ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) { if ($ret < 0) {
@ -386,6 +389,11 @@ if (empty($reshook)) {
$dateemploymentend = dol_mktime(0, 0, 0, GETPOST('dateemploymentendmonth', 'int'), GETPOST('dateemploymentendday', 'int'), GETPOST('dateemploymentendyear', 'int')); $dateemploymentend = dol_mktime(0, 0, 0, GETPOST('dateemploymentendmonth', 'int'), GETPOST('dateemploymentendday', 'int'), GETPOST('dateemploymentendyear', 'int'));
$object->dateemploymentend = $dateemploymentend; $object->dateemploymentend = $dateemploymentend;
if (! empty($conf->stock->enabled))
{
$object->fk_warehouse = GETPOST('fk_warehouse', 'int');
}
if (! empty($conf->multicompany->enabled)) if (! empty($conf->multicompany->enabled))
{ {
if (! empty($_POST["superadmin"])) if (! empty($_POST["superadmin"]))
@ -642,6 +650,7 @@ $form = new Form($db);
$formother=new FormOther($db); $formother=new FormOther($db);
$formcompany = new FormCompany($db); $formcompany = new FormCompany($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
if (! empty($conf->stock->enabled)) $formproduct = new FormProduct($db);
llxHeader('', $langs->trans("UserCard")); llxHeader('', $langs->trans("UserCard"));
@ -1185,6 +1194,13 @@ if ($action == 'create' || $action == 'adduserldap')
print '<input class="maxwidth200" type="text" name="job" value="'.GETPOST('job').'">'; print '<input class="maxwidth200" type="text" name="job" value="'.GETPOST('job').'">';
print '</td></tr>'; print '</td></tr>';
// Default warehouse
if (! empty($conf->stock->enabled))
{
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
print $formproduct->selectWarehouses($object->fk_warehouse, 'fk_warehouse', 'warehouseopen', 1);
print '</td></tr>';
}
if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|| (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read))) || (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read)))
@ -1538,6 +1554,17 @@ else
print '<td>'.$object->job.'</td>'; print '<td>'.$object->job.'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
// Default warehouse
if (! empty($conf->stock->enabled))
{
require_once DOL_DOCUMENT_ROOT .'/product/stock/class/entrepot.class.php';
$warehousestatic=new Entrepot($db);
$warehousestatic->fetch($object->fk_warehouse);
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
print $warehousestatic->getNomUrl();
print '</td></tr>';
}
//$childids = $user->getAllChildIds(1); //$childids = $user->getAllChildIds(1);
if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
@ -1801,18 +1828,25 @@ else
} }
} }
// Activer // Enable user
if ($user->id <> $id && $candisableuser && $object->statut == 0 && if ($user->id <> $id && $candisableuser && $object->statut == 0 &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
{ {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=enable">'.$langs->trans("Reactivate").'</a></div>'; print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=enable">'.$langs->trans("Reactivate").'</a></div>';
} }
// Desactiver // Disable user
if ($user->id <> $id && $candisableuser && $object->statut == 1 && if ($user->id <> $id && $candisableuser && $object->statut == 1 &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
{ {
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&amp;id='.$object->id.'">'.$langs->trans("DisableUser").'</a></div>'; print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=disable&amp;id='.$object->id.'">'.$langs->trans("DisableUser").'</a></div>';
} }
else
{
if ($user->id == $id)
{
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("CantDisableYourself").'">'.$langs->trans("DisableUser").'</a></div>';
}
}
// Delete // Delete
if ($user->id <> $id && $candisableuser && if ($user->id <> $id && $candisableuser &&
((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
@ -2556,6 +2590,15 @@ else
} }
print '</td></tr>'; print '</td></tr>';
// Default warehouse
if (! empty($conf->stock->enabled))
{
print '<tr><td>'.$langs->trans("DefaultWarehouse").'</td><td>';
print $formproduct->selectWarehouses($object->fk_warehouse, 'fk_warehouse', 'warehouseopen', 1);
print ' <a href="'.DOL_URL_ROOT.'/product/stock/card.php?action=create&amp;backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit').'">'.$langs->trans("AddWarehouse").'</a>';
print '</td></tr>';
}
if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) if ((! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
|| (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read))) || (! empty($conf->hrm->enabled) && ! empty($user->rights->hrm->employee->read)))
{ {

View File

@ -175,6 +175,8 @@ class User extends CommonObject
public $default_c_exp_tax_cat; public $default_c_exp_tax_cat;
public $default_range; public $default_range;
public $fk_warehouse;
public $fields = array( public $fields = array(
'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'), 'rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'), 'lastname'=>array('type'=>'varchar(50)', 'label'=>'Name', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>20, 'searchall'=>1, 'comment'=>'Reference of object'),
@ -249,6 +251,7 @@ class User extends CommonObject
$sql.= " u.weeklyhours,"; $sql.= " u.weeklyhours,";
$sql.= " u.color,"; $sql.= " u.color,";
$sql.= " u.dateemployment, u.dateemploymentend,"; $sql.= " u.dateemployment, u.dateemploymentend,";
$sql.= " u.fk_warehouse,";
$sql.= " u.ref_int, u.ref_ext,"; $sql.= " u.ref_int, u.ref_ext,";
$sql.= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode $sql.= " u.default_range, u.default_c_exp_tax_cat,"; // Expense report default mode
$sql.= " c.code as country_code, c.label as country,"; $sql.= " c.code as country_code, c.label as country,";
@ -370,6 +373,7 @@ class User extends CommonObject
$this->default_range = $obj->default_range; $this->default_range = $obj->default_range;
$this->default_c_exp_tax_cat = $obj->default_c_exp_tax_cat; $this->default_c_exp_tax_cat = $obj->default_c_exp_tax_cat;
$this->fk_warehouse = $obj->fk_warehouse;
// Protection when module multicompany was set, admin was set to first entity and then, the module was disabled, // Protection when module multicompany was set, admin was set to first entity and then, the module was disabled,
// in such case, this admin user must be admin for ALL entities. // in such case, this admin user must be admin for ALL entities.
@ -1484,6 +1488,7 @@ class User extends CommonObject
$this->color = empty($this->color)?'':$this->color; $this->color = empty($this->color)?'':$this->color;
$this->dateemployment = empty($this->dateemployment)?'':$this->dateemployment; $this->dateemployment = empty($this->dateemployment)?'':$this->dateemployment;
$this->dateemploymentend = empty($this->dateemploymentend)?'':$this->dateemploymentend; $this->dateemploymentend = empty($this->dateemploymentend)?'':$this->dateemploymentend;
$this->fk_warehouse = trim(empty($this->fk_warehouse)?'':$this->fk_warehouse);
// Check parameters // Check parameters
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
@ -1542,6 +1547,7 @@ class User extends CommonObject
$sql.= ", entity = '".$this->db->escape($this->entity)."'"; $sql.= ", entity = '".$this->db->escape($this->entity)."'";
$sql.= ", default_range = ".($this->default_range > 0 ? $this->default_range : 'null'); $sql.= ", default_range = ".($this->default_range > 0 ? $this->default_range : 'null');
$sql.= ", default_c_exp_tax_cat = ".($this->default_c_exp_tax_cat > 0 ? $this->default_c_exp_tax_cat : 'null'); $sql.= ", default_c_exp_tax_cat = ".($this->default_c_exp_tax_cat > 0 ? $this->default_c_exp_tax_cat : 'null');
$sql.= ", fk_warehouse = ".($this->fk_warehouse?"'".$this->db->escape($this->fk_warehouse)."'":"null");
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;

View File

@ -35,12 +35,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
$canreadperms=($user->admin || $user->rights->user->user->lire); $canreadperms=($user->admin || $user->rights->user->user->lire);
$caneditperms=($user->admin || $user->rights->user->user->creer); $caneditperms=($user->admin || $user->rights->user->user->creer);
$candisableperms=($user->admin || $user->rights->user->user->supprimer); $candisableperms=($user->admin || $user->rights->user->user->supprimer);
$feature2 = 'user';
// Advanced permissions // Advanced permissions
if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS)) if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS))
{ {
$canreadperms=($user->admin || $user->rights->user->group_advance->read); $canreadperms=($user->admin || $user->rights->user->group_advance->read);
$caneditperms=($user->admin || $user->rights->user->group_advance->write); $caneditperms=($user->admin || $user->rights->user->group_advance->write);
$candisableperms=($user->admin || $user->rights->user->group_advance->delete); $candisableperms=($user->admin || $user->rights->user->group_advance->delete);
$feature2 = 'group_advance';
} }
// Load translation files required by page // Load translation files required by page
@ -55,7 +58,7 @@ $contextpage = GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'groupc
$userid = GETPOST('user', 'int'); $userid = GETPOST('user', 'int');
// Security check // Security check
$result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', 'user'); $result = restrictedArea($user, 'user', $id, 'usergroup&usergroup', $feature2);
// Users/Groups management only in master entity if transverse mode // Users/Groups management only in master entity if transverse mode
if (! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE) if (! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)