| ';
print $form->editfieldkey('Employee', 'fk_user', '', $object, 0, 'string', '', 1).' | ';
$noactive = 0; // We keep active and unactive users
print img_picto('', 'user', 'class="paddingrighonly"').$form->select_dolusers(GETPOST('fk_user', 'int'), 'fk_user', 1, '', 0, '', '', 0, 0, 0, 'AND employee=1', 0, '', 'maxwidth300', $noactive);
@@ -448,7 +459,7 @@ if ($action == 'create') {
// Amount
print ' |
| ';
print $form->editfieldkey('Amount', 'amount', '', $object, 0, 'string', '', 1).' | ';
- print '';
+ print '';
print ' |
';
// Project
@@ -461,7 +472,7 @@ if ($action == 'create') {
}
// Comments
- print '| ' . $langs->trans("Amount") . ' | ' . price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency) . ' |
';
}
diff --git a/htdocs/salaries/class/salariesstats.class.php b/htdocs/salaries/class/salariesstats.class.php
index 7d7f9a7b5f2..123dc044a4a 100644
--- a/htdocs/salaries/class/salariesstats.class.php
+++ b/htdocs/salaries/class/salariesstats.class.php
@@ -62,8 +62,8 @@ class SalariesStats extends Stats
$this->from = MAIN_DB_PREFIX.$object->table_element;
$this->field = 'amount';
- $this->where .= " entity = ".$conf->entity;
- if ($this->socid) {
+ $this->where = " entity = ".$conf->entity;
+ if ($this->socid > 0) {
$this->where .= " AND fk_soc = ".$this->socid;
}
if (is_array($this->userid) && count($this->userid) > 0) {
@@ -83,8 +83,8 @@ class SalariesStats extends Stats
{
$sql = "SELECT YEAR(datep) as dm, count(*)";
$sql .= " FROM ".$this->from;
+ $sql .= " WHERE ".$this->where;
$sql .= " GROUP BY dm DESC";
- //$sql .= " WHERE ".$this->where;
return $this->_getNbByYear($sql);
}
@@ -102,12 +102,12 @@ class SalariesStats extends Stats
$sql = "SELECT MONTH(datep) as dm, count(*)";
$sql .= " FROM ".$this->from;
$sql .= " WHERE YEAR(datep) = ".$year;
- //$sql .= " AND ".$this->where;
+ $sql .= " AND ".$this->where;
$sql .= " GROUP BY dm";
$sql .= $this->db->order('dm', 'DESC');
$res = $this->_getNbByMonth($year, $sql, $format);
- //var_dump($res);print '';
print '| '.$langs->trans("Filter").' |
';
// User
-print '| '.$langs->trans("User").' | ';
-print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
+print ' |
| '.$langs->trans("Employee").' | ';
+print $form->select_dolusers(($userid ? $userid : -1), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print ' |
';
// Year
print '| '.$langs->trans("Year").' | ';
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index e0131a420fb..d69a602c900 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -80,7 +80,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
-if ($user->socid) {
+if ($user->socid && empty($conf->global->MAIN_EXTERNAL_USERS_CAN_SEE_SUBSIDIARY_COMPANIES)) {
$socid = $user->socid;
}
if (empty($socid) && $action == 'view') {
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 508a871de68..03cd9366aba 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -2060,6 +2060,19 @@ if ($action == 'exportsite') {
// Regenerate site
if ($action == 'regeneratesite') {
+ // Check symlink to medias and restore it if ko. Recreate also dir of website if not found.
+ $pathtomedias = DOL_DATA_ROOT.'/medias';
+ $pathtomediasinwebsite = $pathofwebsite.'/medias';
+ if (!is_link(dol_osencode($pathtomediasinwebsite))) {
+ dol_syslog("Create symlink for ".$pathtomedias." into name ".$pathtomediasinwebsite);
+ dol_mkdir(dirname($pathtomediasinwebsite)); // To be sure dir for website exists
+ $result = symlink($pathtomedias, $pathtomediasinwebsite);
+ if (!$result) {
+ setEventMessages($langs->trans("ErrorFieldToCreateSymLinkToMedias", $pathtomediasinwebsite, $pathtomedias), null, 'errors');
+ $action = 'preview';
+ }
+ }
+
$result = $object->rebuildWebSiteFiles();
if ($result > 0) {
setEventMessages($langs->trans("PagesRegenerated", $result), null, 'mesgs');
@@ -2077,7 +2090,7 @@ if ($action == 'importsiteconfirm') {
$action = 'importsite';
} else {
if (!empty($_FILES) || GETPOSTISSET('templateuserfile')) {
- // Check symlink to medias and restore it if ko
+ // Check symlink to medias and restore it if ko. Recreate also dir of website if not found.
$pathtomedias = DOL_DATA_ROOT.'/medias';
$pathtomediasinwebsite = $pathofwebsite.'/medias';
if (!is_link(dol_osencode($pathtomediasinwebsite))) {
|