';
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 258e79be2c0..aaf5aaf1baa 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -726,6 +726,7 @@ class Product extends CommonObject
$sql.= ", fk_unit= " . (!$this->fk_unit ? 'NULL' : $this->fk_unit);
$sql.= ", price_autogen = " . (!$this->price_autogen ? 0 : 1);
$sql.= ", fk_price_expression = ".($this->fk_price_expression != 0 ? $this->fk_price_expression : 'NULL');
+ $sql.= ", fk_user_modif = ".($user->id > 0 ? $user->id : 'NULL');
$sql.= " WHERE rowid = " . $id;
dol_syslog(get_class($this)."::update", LOG_DEBUG);
@@ -1067,9 +1068,11 @@ class Product extends CommonObject
* Delete a language for this product
*
* @param string $langtodelete Language code to delete
+ * @param User $user Object user making delete
+ *
* @return int <0 if KO, >0 if OK
*/
- function delMultiLangs($langtodelete)
+ function delMultiLangs($langtodelete, $user)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_lang";
$sql.= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($langtodelete)."'";
@@ -1078,6 +1081,14 @@ class Product extends CommonObject
$result = $this->db->query($sql);
if ($result)
{
+ // Call trigger
+ $result = $this->call_trigger('PRODUCT_DEL_MULTILANGS',$user);
+ if ($result < 0) {
+ $this->error = $this->db->lasterror();
+ dol_syslog(get_class($this).'::delMultiLangs error='.$this->error, LOG_ERR);
+ return -1;
+ }
+ // End call triggers
return 1;
}
else
@@ -4113,4 +4124,52 @@ class Product extends CommonObject
return $user->rights->service;
}
}
+
+ /**
+ * Load information for tab info
+ *
+ * @param int $id Id of thirdparty to load
+ * @return void
+ */
+ function info($id)
+ {
+ $sql = "SELECT p.rowid, p.ref, p.datec as date_creation, p.tms as date_modification,";
+ $sql.= " p.fk_user_author, p.fk_user_modif";
+ $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element." as p";
+ $sql.= " WHERE p.rowid = ".$id;
+
+ $result=$this->db->query($sql);
+ if ($result)
+ {
+ if ($this->db->num_rows($result))
+ {
+ $obj = $this->db->fetch_object($result);
+
+ $this->id = $obj->rowid;
+
+ if ($obj->fk_user_author) {
+ $cuser = new User($this->db);
+ $cuser->fetch($obj->fk_user_author);
+ $this->user_creation = $cuser;
+ }
+
+ if ($obj->fk_user_modif) {
+ $muser = new User($this->db);
+ $muser->fetch($obj->fk_user_modif);
+ $this->user_modification = $muser;
+ }
+
+ $this->ref = $obj->ref;
+ $this->date_creation = $this->db->jdate($obj->date_creation);
+ $this->date_modification = $this->db->jdate($obj->date_modification);
+ }
+
+ $this->db->free($result);
+
+ }
+ else
+ {
+ dol_print_error($this->db);
+ }
+ }
}
diff --git a/htdocs/product/info.php b/htdocs/product/info.php
new file mode 100644
index 00000000000..3ca96a2847d
--- /dev/null
+++ b/htdocs/product/info.php
@@ -0,0 +1,108 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
.
+ */
+
+/**
+ * \file htdocs/product/info.php
+ * \ingroup product
+ * \brief Information page for product
+ */
+
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
+
+$langs->load("product");
+$langs->load("other");
+if (! empty($conf->notification->enabled)) $langs->load("mails");
+
+// Security check
+$id = GETPOST('id','int');
+$ref = GETPOST('ref','alpha');
+
+$result=restrictedArea($user,'produit|service',$id,'product&product');
+
+// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
+$hookmanager->initHooks(array('infoproduct'));
+
+$object = new Product($db);
+
+
+/*
+ * Actions
+ */
+
+$parameters=array('id'=>$id);
+$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
+if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+
+
+
+/*
+ * View
+ */
+
+$form=new Form($b);
+
+$title=$langs->trans("Product");
+$helpurl='';
+if (GETPOST("type") == '0' || ($object->type == Product::TYPE_PRODUCT)) $helpurl='EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos';
+if (GETPOST("type") == '1' || ($object->type == Product::TYPE_SERVICE)) $helpurl='EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios';
+llxHeader('',$title,$help_url);
+
+if ($id > 0 || $ref)
+{
+ $result = $object->fetch($id,$ref);
+ if (! $result)
+ {
+ $langs->load("errors");
+ print $langs->trans("ErrorRecordNotFound");
+
+ llxFooter();
+ $db->close();
+
+ exit;
+ }
+
+ $head=product_prepare_head($object);
+ $titre=$langs->trans("CardProduct".$object->type);
+ $picto=($object->type== Product::TYPE_SERVICE?'service':'product');
+ dol_fiche_head($head, 'info', $titre, 0, $picto);
+
+ $linkback = '
'.$langs->trans("BackToList").'';
+
+ dol_banner_tab($object, 'ref', '', ($user->societe_id?0:1), 'ref');
+
+ $object->info($object->id);
+
+ print '
';
+
+ print '
';
+
+ print '
';
+
+ dol_print_object_info($object);
+
+ print '
';
+
+ dol_fiche_end();
+}
+
+
+llxFooter();
+
+$db->close();
diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php
index 3d97467f552..a40b7b15cd9 100644
--- a/htdocs/product/traduction.php
+++ b/htdocs/product/traduction.php
@@ -60,7 +60,7 @@ if ($action == 'delete' && GETPOST('langtodelete','alpha'))
{
$object = new Product($db);
$object->fetch($id);
- $object->delMultiLangs(GETPOST('langtodelete','alpha'));
+ $object->delMultiLangs(GETPOST('langtodelete','alpha'), $user);
}
// Add translation
@@ -144,7 +144,7 @@ $cancel != $langs->trans("Cancel") &&
$langtodelete=GETPOST('langdel','alpha');
- if ( $object->delMultiLangs($langtodelete) > 0 )
+ if ( $object->delMultiLangs($langtodelete, $user) > 0 )
{
$action = '';
}
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index d1b26453de9..b73f3456324 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -305,7 +305,14 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
print '
| '.$langs->trans("AffectedTo").' | ';
$contactsofproject=(! empty($object->id)?$object->getListContactId('internal'):'');
- $form->select_dolusers($user->id,'userid',0,'',0,'',$contactsofproject);
+ if (count($contactsofproject))
+ {
+ print $form->select_dolusers($user->id,'userid',0,'',0,'',$contactsofproject);
+ }
+ else
+ {
+ print $langs->trans("NoUserAssignedToTheProject");
+ }
print ' |
';
// Date start
diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php
index a415ae57b1c..3a2ecea9305 100644
--- a/htdocs/societe/info.php
+++ b/htdocs/societe/info.php
@@ -78,15 +78,13 @@ if ($socid > 0)
exit;
}
- $object->info($socid);
-
$head = societe_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("ThirdParty"), 0, 'company');
- $linkback = '
'.$langs->trans("BackToList").'';
-
- dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+ dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
+
+ $object->info($socid);
print '
';
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 0ebc5c54799..48fb4262925 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -1157,7 +1157,7 @@ div.vmenu, td.vmenu {
}
.menu_contenu {
- padding-top: 3px;
+ padding-top: 5px;
padding-bottom: 2px;
}
#menu_contenu_logo { padding-right: 4px; }
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index d1b2a357b70..f7a0cd54202 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -80,7 +80,7 @@ $dol_use_jmobile=$conf->dol_use_jmobile;
//var_dump($user->conf->THEME_ELDY_RGB);
// Colors
-$colorbackhmenu1='140,150,180'; // topmenu
+$colorbackhmenu1='0,0,0'; // topmenu
$colorbackvmenu1='255,255,255'; // vmenu
$colorbacktitle1='230,230,230'; // title of array
$colorbacktabcard1='255,255,255'; // card
@@ -102,7 +102,7 @@ $useboldtitle=1;
// Case of option always editable
if (! isset($conf->global->THEME_ELDY_BACKBODY)) $conf->global->THEME_ELDY_BACKBODY='255,255,255';
-if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=join(',',colorStringToArray('#37474F')); // topmenu (140,160,185)
+if (! isset($conf->global->THEME_ELDY_TOPMENU_BACK1)) $conf->global->THEME_ELDY_TOPMENU_BACK1=join(',',colorStringToArray('#000000')); // topmenu (140,160,185)
if (! isset($conf->global->THEME_ELDY_BACKTITLE1)) $conf->global->THEME_ELDY_BACKTITLE1='140,150,180'; // title of arrays TO MATCH ELDY (140,160,185)
if (! isset($conf->global->THEME_ELDY_USE_HOVER)) $conf->global->THEME_ELDY_USE_HOVER=='238,246,252';
if (! isset($conf->global->THEME_ELDY_TEXTLINK)) $conf->global->THEME_ELDY_TEXTLINK='0,0,120';
@@ -126,7 +126,6 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED))
}
//var_dump($conf->global->THEME_ELDY_BACKBODY);
//var_dump($user->conf->THEME_ELDY_BACKTITLE1);
-
// Case of option availables only if THEME_ELDY_ENABLE_PERSONALIZED is on
$colorbackhmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$conf->global->THEME_ELDY_TOPMENU_BACK1) :(empty($user->conf->THEME_ELDY_TOPMENU_BACK1)?$colorbackhmenu1:$user->conf->THEME_ELDY_TOPMENU_BACK1);
$colorbackvmenu1 =empty($user->conf->THEME_ELDY_ENABLE_PERSONALIZED)?(empty($conf->global->THEME_ELDY_VERMENU_BACK1)?$colorbackvmenu1:$conf->global->THEME_ELDY_VERMENU_BACK1) :(empty($user->conf->THEME_ELDY_VERMENU_BACK1)?$colorbackvmenu1:$user->conf->THEME_ELDY_VERMENU_BACK1);
@@ -723,7 +722,7 @@ $heightmenu=48; /* height of top menu, part with image */
$heightmenu2=48; /* height of top menu, ârt with login */
$disableimages = 0;
$maxwidthloginblock = 110;
-if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; }
+if (! empty($conf->global->THEME_MD_DISABLE_IMAGE)) { $heightmenu = 30; $disableimages = 1; $maxwidthloginblock = 180; }
?>
div#tmenu_tooltip {
@@ -820,11 +819,14 @@ li.tmenu, li.tmenusel {
vertical-align: bottom;
global->MAIN_MENU_INVERT)) { ?>
float: ;
+
height: px;
-
+ padding: 0px 0px 2px 0px;
+
+ padding: 0px 0px 0px 0px;
+
position:relative;
display: block;
- padding: 0px 0px 2px 0px;
margin: 0px 0px 0px 0px;
font-weight: normal;
}
@@ -845,13 +847,15 @@ div.tmenuleft
margin-top: 0px;
dol_optimize_smallscreen)) { ?>
width: 5px;
+
height: px;
+
/* background: url() 0 -6px no-repeat; */
}
div.tmenucenter
{
- padding-top: 2px;
+ padding-top: px;
padding-left: 0px;
padding-right: 0px;
height: px;
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index ffd2f878adf..49e6511b2ca 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -38,6 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
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->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
@@ -45,6 +46,7 @@ if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
+$mode = GETPOST('mode','alpha');
$confirm = GETPOST('confirm','alpha');
$subaction = GETPOST('subaction','alpha');
$group = GETPOST("group","int",3);
@@ -183,6 +185,11 @@ if (empty($reshook)) {
$object->api_key = GETPOST("api_key", 'alpha');
$object->gender = GETPOST("gender", 'alpha');
$object->admin = GETPOST("admin", 'alpha');
+ $object->address = GETPOST('address', 'alpha');
+ $object->zip = GETPOST('zipcode', 'alpha');
+ $object->town = GETPOST('town', 'alpha');
+ $object->country_id = GETPOST('country_id', 'int');
+ $object->state_id = GETPOST('state_id', 'int');
$object->office_phone = GETPOST("office_phone", 'alpha');
$object->office_fax = GETPOST("office_fax", 'alpha');
$object->user_mobile = GETPOST("user_mobile");
@@ -315,7 +322,12 @@ if (empty($reshook)) {
$object->pass = GETPOST("password");
$object->api_key = (GETPOST("api_key", 'alpha')) ? GETPOST("api_key", 'alpha') : $object->api_key;
$object->admin = empty($user->admin) ? 0 : GETPOST("admin"); // A user can only be set admin by an admin
- $object->office_phone = GETPOST("office_phone", 'alpha');
+ $object->address = GETPOST('address', 'alpha');
+ $object->zip = GETPOST('zipcode', 'alpha');
+ $object->town = GETPOST('town', 'alpha');
+ $object->country_id = GETPOST('country_id', 'int');
+ $object->state_id = GETPOST('state_id', 'int');
+ $object->office_phone = GETPOST("office_phone", 'alpha');
$object->office_fax = GETPOST("office_fax", 'alpha');
$object->user_mobile = GETPOST("user_mobile");
$object->skype = GETPOST("skype");
@@ -578,6 +590,7 @@ if (empty($reshook)) {
$form = new Form($db);
$formother=new FormOther($db);
+$formcompany = new FormCompany($db);
llxHeader('',$langs->trans("UserCard"));
@@ -865,6 +878,36 @@ if (($action == 'create') || ($action == 'adduserldap'))
print $form->textwithpicto($langs->trans("Internal"),$langs->trans("InternalExternalDesc"), 1, 'help', '', 0, 2);
print '