diff --git a/ChangeLog b/ChangeLog
index af9a2e81eba..8a74ce000dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@ For users:
- New: Add option to choose firstname-name or name-firstname.
- New: Add company in fields exported by export of members tool.
- New: Reorganise bank menu.
+- New: Bookmarks can be sorted on a particular order.
- Fix: Debug experimental module widthrawal.
- Fix: Format number was wrong for ar_AR language.
- Fix: Can change password if has only permission change password.
diff --git a/default.properties b/default.properties
new file mode 100644
index 00000000000..7cc29631d3e
--- /dev/null
+++ b/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Indicates whether an apk should be generated for each density.
+split.density=false
diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php
index 551f985015e..dc478065927 100644
--- a/htdocs/bookmarks/class/bookmark.class.php
+++ b/htdocs/bookmarks/class/bookmark.class.php
@@ -39,6 +39,7 @@ class Bookmark
var $url;
var $target; // 0=replace, 1=new window
var $title;
+ var $position;
var $favicon;
@@ -60,7 +61,7 @@ class Bookmark
function fetch($id)
{
$sql = "SELECT rowid, fk_user, dateb as datec, url, target,";
- $sql.= " title, favicon";
+ $sql.= " title, position, favicon";
$sql.= " FROM ".MAIN_DB_PREFIX."bookmark";
$sql.= " WHERE rowid = ".$id;
@@ -78,6 +79,7 @@ class Bookmark
$this->url = $obj->url;
$this->target = $obj->target;
$this->title = $obj->title;
+ $this->position= $obj->position;
$this->favicon = $obj->favicon;
$this->db->free($resql);
@@ -92,24 +94,25 @@ class Bookmark
/**
* \brief Insere bookmark en base
- * \return int <0 si ko, rowid du bookmark cr�� si ok
+ * \return int <0 si ko, rowid du bookmark cree si ok
*/
function create()
{
// Clean parameters
$this->url=trim($this->url);
$this->title=trim($this->title);
+ if (empty($this->position)) $this->position=0;
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_user,dateb,url,target";
- $sql.= " ,title,favicon";
+ $sql.= " ,title,favicon,position";
if ($this->fk_soc) $sql.=",fk_soc";
$sql.= ") VALUES (";
$sql.= ($this->fk_user > 0?"'".$this->fk_user."'":"0").",";
$sql.= " ".$this->db->idate(gmmktime()).",";
$sql.= " '".$this->url."', '".$this->target."',";
- $sql.= " '".addslashes($this->title)."', '".$this->favicon."'";
+ $sql.= " '".addslashes($this->title)."', '".$this->favicon."', '".$this->position."'";
if ($this->fk_soc) $sql.=",".$this->fk_soc;
$sql.= ")";
@@ -142,7 +145,7 @@ class Bookmark
}
/**
- * \brief Mise � jour du bookmark
+ * \brief Update bookmark record
* \return int <0 si ko, >0 si ok
*/
function update()
@@ -150,6 +153,7 @@ class Bookmark
// Clean parameters
$this->url=trim($this->url);
$this->title=trim($this->title);
+ if (empty($this->position)) $this->position=0;
$sql = "UPDATE ".MAIN_DB_PREFIX."bookmark";
$sql.= " SET fk_user = ".($this->fk_user > 0?"'".$this->fk_user."'":"0");
@@ -158,6 +162,7 @@ class Bookmark
$sql.= " ,target = '".$this->target."'";
$sql.= " ,title = '".addslashes($this->title)."'";
$sql.= " ,favicon = '".$this->favicon."'";
+ $sql.= " ,position = '".$this->position."'";
$sql.= " WHERE rowid = ".$this->id;
dol_syslog("Bookmark::update sql=".$sql, LOG_DEBUG);
diff --git a/htdocs/bookmarks/fiche.php b/htdocs/bookmarks/fiche.php
index ec077c510be..8c0f5a9dd74 100644
--- a/htdocs/bookmarks/fiche.php
+++ b/htdocs/bookmarks/fiche.php
@@ -35,6 +35,7 @@ $title=isset($_GET["title"])?$_GET["title"]:$_POST["title"];
$url=isset($_GET["url"])?$_GET["url"]:$_POST["url"];
$target=isset($_GET["target"])?$_GET["target"]:$_POST["target"];
$userid=isset($_GET["userid"])?$_GET["userid"]:$_POST["userid"];
+$position=isset($_GET["position"])?$_GET["position"]:$_POST["position"];
/*
@@ -58,6 +59,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
$bookmark->title=$title;
$bookmark->url=$url;
$bookmark->target=$target;
+ $bookmark->position=$position;
if (! $title) $mesg.=($mesg?'
':'').$langs->trans("ErrorFieldRequired",$langs->trans("BookmarkTitle"));
if (! $url) $mesg.=($mesg?'
':'').$langs->trans("ErrorFieldRequired",$langs->trans("UrlOrLink"));
@@ -156,6 +158,11 @@ if ($action == 'create')
$html->select_users(isset($_POST['userid'])?$_POST['userid']:$user->id,'userid',1);
print '