diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php
index 82df4bed430..67c6914f1cf 100644
--- a/htdocs/admin/security_file.php
+++ b/htdocs/admin/security_file.php
@@ -36,6 +36,14 @@ if (!$user->admin) {
}
$action = GETPOST('action', 'aZ09');
+$sortfield = GETPOST('sortfield', 'aZ09');
+$sortorder = GETPOST('sortorder', 'aZ09');
+if (empty($sortfield)) {
+ $sortfield = 'date';
+}
+if (empty($sortorder)) {
+ $sortorder = 'desc';
+}
$upload_dir = $conf->admin->dir_temp;
@@ -73,8 +81,6 @@ if ($action == 'updateform') {
} else {
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile', 'alpha')), null, 'errors');
}
- Header('Location: '.$_SERVER["PHP_SELF"]);
- exit;
}
@@ -190,7 +196,7 @@ $formfile = new FormFile($db);
$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1, 50, '', '', 1, '', 0);
// List of document
-$filearray = dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1);
+$filearray = dol_dir_list($upload_dir, "files", 0, '', '', $sortfield, $sortorder == 'desc' ? SORT_DESC : SORT_ASC, 1);
$formfile->list_of_documents($filearray, null, 'admin_temp', '');
// End of page
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index cad584e8731..c01ff5af541 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1504,7 +1504,7 @@ class FormFile
if (!empty($conf->global->MAIN_ECM_DISABLE_JS)) {
$useajax = 0;
}
- print ''.img_delete().'';
+ print ''.img_delete().'';
}
print "";
diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php
index 68bb8236d72..5606586a6e2 100644
--- a/htdocs/core/js/lib_head.js.php
+++ b/htdocs/core/js/lib_head.js.php
@@ -1167,7 +1167,7 @@ $(document).ready(function() {
});
-// Force to hide menus when page is inside an iFrame
+// Force to hide menus when page is inside an iFrame so we can show any page into a dialog popup
$(document).ready(function() {
if (window.location !== window.parent.location ) {
console.log("Page is detected to be into an iframe, we hide by CSS the menus");
diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php
index 1d529be6327..c57807800d7 100644
--- a/htdocs/core/lib/signature.lib.php
+++ b/htdocs/core/lib/signature.lib.php
@@ -119,11 +119,9 @@ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1)
}
// For multicompany
- /*
- if (!empty($out)) {
- $out .= "&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities
+ if (!empty($out) && !empty($conf->multicompany->enabled)) {
+ $out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities
}
- */
return $out;
}
diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php
index 1ffe39f26ce..3fe71278101 100644
--- a/htdocs/ecm/class/ecmfiles.class.php
+++ b/htdocs/ecm/class/ecmfiles.class.php
@@ -369,7 +369,7 @@ class EcmFiles extends CommonObject
* @param string $ref Hash of file name (filename+filepath). Not always defined on some version.
* @param string $relativepath Relative path of file from document directory. Example: 'path/path2/file' or 'path/path2/*'
* @param string $hashoffile Hash of file content. Take the first one found if same file is at different places. This hash will also change if file content is changed.
- * @param string $hashforshare Hash of file sharing.
+ * @param string $hashforshare Hash of file sharing or 'shared'
* @param string $src_object_type src_object_type to search (value of object->table_element)
* @param string $src_object_id src_object_id to search
* @return int <0 if KO, 0 if not found, >0 if OK
@@ -425,12 +425,16 @@ class EcmFiles extends CommonObject
$sql .= " AND t.label = '".$this->db->escape($hashoffile)."'";
$sql .= " AND t.entity = ".$conf->entity; // unique key include the entity so each company has its own index
} elseif (!empty($hashforshare)) {
- $sql .= " AND t.share = '".$this->db->escape($hashforshare)."'";
+ if ($hashforshare != 'shared') {
+ $sql .= " AND t.share = '".$this->db->escape($hashforshare)."'";
+ } else {
+ $sql .= " AND t.share IS NOT NULL AND t.share <> ''";
+ }
//$sql .= " AND t.entity = ".$conf->entity; // hashforshare already unique
} elseif ($src_object_type && $src_object_id) {
// Warning: May return several record, and only first one is returned !
$sql .= " AND t.src_object_type = '".$this->db->escape($src_object_type)."' AND t.src_object_id = ".((int) $src_object_id);
- $sql .= " AND t.entity = ".$conf->entity;
+ $sql .= " AND t.entity = ".((int) $conf->entity);
} else {
$sql .= ' AND t.rowid = '.((int) $id); // rowid already unique
}
diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php
index adc9e115aa5..45f4decc740 100644
--- a/htdocs/partnership/class/partnership.class.php
+++ b/htdocs/partnership/class/partnership.class.php
@@ -106,7 +106,7 @@ class Partnership extends CommonObject
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"),
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1),
- 'fk_type' => array('type' => 'integer:PartnershipType:partnership/class/partnership_type.class.php', 'label' => 'Type', 'notnull'=>1, 'enabled' => 1, 'visible' => 1, 'position' => 20),
+ 'fk_type' => array('type' => 'integer:PartnershipType:partnership/class/partnership_type.class.php:0:active=1', 'label' => 'Type', 'notnull'=>1, 'enabled' => 1, 'visible' => 1, 'position' => 20),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,),
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
@@ -201,7 +201,7 @@ class Partnership extends CommonObject
if (!empty($conf->global->PARTNERSHIP_IS_MANAGED_FOR) && $conf->global->PARTNERSHIP_IS_MANAGED_FOR == 'member') {
$this->fields['fk_member'] = array('type'=>'integer:Adherent:adherents/class/adherent.class.php:1', 'label'=>'Member', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'member', 'csslist'=>'tdoverflowmax150');
} else {
- $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company', 'csslist'=>'tdoverflowmax150');
+ $this->fields['fk_soc'] = array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'picto'=>'company', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150');
}
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid'])) {
diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php
index 6916d95e4f3..536ccdf0c88 100644
--- a/htdocs/partnership/class/partnership_type.class.php
+++ b/htdocs/partnership/class/partnership_type.class.php
@@ -69,7 +69,7 @@ class PartnershipType extends CommonObject
public $fields=array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>15, 'index'=>1),
- 'code' =>array('type'=>'varchar(32)', 'label'=>'Code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20, 'showoncombobox'=>1),
+ 'code' =>array('type'=>'varchar(32)', 'label'=>'Code', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20),
'label' =>array('type'=>'varchar(64)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25, 'showoncombobox'=>1),
'active' =>array('type'=>'integer', 'label'=>'Active', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>30),
);
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 6f587a67a7f..433a933c75b 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -632,11 +632,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
}
if (count($array) > 0) {
- print $form->selectarray('public', $array, GETPOSTISSET('public') ? GETPOST('public') : $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1);
+ print $form->selectarray('public', $array, GETPOST('public'), 0, 0, 0, '', 0, 0, 0, '', '', 1);
} else {
- print '';
+ print '';
- if ( (GETPOSTISSET('public') ? GETPOST('public') : $object->public)==0) {
+ if (GETPOST('public') == 0) {
print $langs->trans("PrivateProject");
} else {
print $langs->trans("SharedProject");
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 0a1000cce05..2ac2e0744b3 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -7404,8 +7404,8 @@ div.clipboardCPValue.hidewithsize {
}
.valuefield.fieldname_type span.badgeneutral {
- margin-top: 5px;
- display: inline-block;
+ margin-top: 5px;
+ display: inline-block;
}
tr.trextrafieldseparator td, tr.trextrafields_collapse_last td {