diff --git a/ChangeLog b/ChangeLog
index 6f6ffce37d2..e1889ac6522 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
English Dolibarr changelog
+***** Changelog for 2.5 compared to 2.4 *****
+
+For users:
+- Support bookmark add of product cards.
+- New view in ecm module.
+
+For translators:
+- The errors language file contains only error or warning messages with
+ prefix Error or Warning.
+
+For developers:
+- Update skeletons.
+
***** Changelog for 2.4 compared to 2.2 *****
diff --git a/htdocs/bookmarks/fiche.php b/htdocs/bookmarks/fiche.php
index bba707007f4..066635d6874 100644
--- a/htdocs/bookmarks/fiche.php
+++ b/htdocs/bookmarks/fiche.php
@@ -40,31 +40,45 @@ $target=isset($_GET["target"])?$_GET["target"]:$_POST["target"];
* Actions
*/
-if ($action == 'add')
+if ($action == 'add' || $action == 'addproduct')
{
$mesg='';
$bookmark=new Bookmark($db);
$bookmark->fk_user=$user->id;
- if ($_GET["socid"]) // Lien vers fiche comm société
+ $bookmark->title=$title;
+ $bookmark->url=$url;
+ $bookmark->target=$target;
+
+ if ($action == 'add' && $_GET["socid"]) // Link to third party card
{
require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
+ $langs->load("companies");
$societe=new Societe($db);
$societe->fetch($_GET["socid"]);
- $bookmark->fk_soc=$societe->id;
$bookmark->url=DOL_URL_ROOT.'/soc.php?socid='.$societe->id;
$bookmark->target='0';
- $bookmark->title=$societe->nom;
+ $bookmark->title=$langs->trans("ThirdParty").' '.$societe->nom;
+ //$bookmark->title=$societe->nom;
+ $title=$bookmark->title;
+ $url=$bookmark->url;
}
- else
+ if ($action == 'addproduct' && $_GET["id"]) // Link to product card
{
- if (! $title) $mesg.=($mesg?'
':'').$langs->trans("ErrorFieldRequired",$langs->trans("BookmarkTitle"));
- if (! $url) $mesg.=($mesg?'
':'').$langs->trans("ErrorFieldRequired",$langs->trans("UrlOrLink"));
-
- $bookmark->title=$title;
- $bookmark->url=$url;
- $bookmark->target=$target;
+ require_once(DOL_DOCUMENT_ROOT."/product.class.php");
+ $langs->load("products");
+ $product=new Product($db);
+ $product->fetch($_GET["id"]);
+ $bookmark->url=DOL_URL_ROOT.'/product/fiche.php?id='.$product->id;
+ $bookmark->target='0';
+ $bookmark->title=($product->type != 1 ?$langs->trans("Product"):$langs->trans("Service")).' '.$product->ref;
+ //$bookmark->title=$product->ref;
+ $title=$bookmark->title;
+ $url=$bookmark->url;
}
+
+ if (! $title) $mesg.=($mesg?'
':'').$langs->trans("ErrorFieldRequired",$langs->trans("BookmarkTitle"));
+ if (! $url) $mesg.=($mesg?'
':'').$langs->trans("ErrorFieldRequired",$langs->trans("UrlOrLink"));
if (! $mesg)
{
@@ -89,8 +103,6 @@ if ($action == 'add')
$mesg='
*
* 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
@@ -14,18 +14,15 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
- * $Source$
*/
/**
- \file htdocs/bookmarks/liste.php
- \brief Page affichage des bookmarks
- \ingroup bookmark
- \version $Revision$
-*/
-
+ * \file htdocs/bookmarks/liste.php
+ * \brief Page affichage des bookmarks
+ * \ingroup bookmark
+ * \version $Id$
+ */
+
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/bookmarks/bookmark.class.php");
@@ -54,6 +51,7 @@ if ($_GET["action"] == 'delete')
if ($res > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
+ exit;
}
else
{
@@ -63,7 +61,7 @@ if ($_GET["action"] == 'delete')
/*
- * Affichage liste
+ * View
*/
llxHeader();
@@ -124,7 +122,7 @@ if ($resql)
$lien="Dolibarr";
if (! $obj->title)
{
- // Pour compatibilite avec anciens bookmarks
+ // For compatibility with old Dolibarr bookmarks
require_once(DOL_DOCUMENT_ROOT."/societe.class.php");
$societe=new Societe($db);
$societe->fetch($obj->rowid);
@@ -150,11 +148,11 @@ if ($resql)
if ($obj->target == 1) print $langs->trans("BookmarkTargetNewWindowShort");
print "\n";
- // Auteur
+ // Author
print ''.img_object($langs->trans("ShowUser"),"user").' '.$obj->login." | \n";
// Date creation
- print ''.dolibarr_print_date($obj->dateb) ." | ";
+ print ''.dolibarr_print_date($obj->dateb,'day') ." | ";
// Actions
print "";
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 2b7d5fb8d56..f6224e384a9 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -18,7 +18,7 @@ ErrorSupplierCodeAlreadyUsed=Supplier code already used
ErrorBadParameters=Bad parameters
ErrorFailedToWriteInDir=Failed to write in directory %s
ErrorFoundBadEmailInFile=Found incorrect email syntax for %s lines in file (example line %s with email=%s)
-UserCannotBeDelete=User can not be deleted. May be it is associated on Dolibarr entities.
+ErrorUserCannotBeDelete=User can not be deleted. May be it is associated on Dolibarr entities.
ErrorFieldsRequired=Some required fields were not filled.
ErrorFailedToCreateDir=Failed to create a directory. Check that Web server user has permissions to write into Dolibarr documents directory. If parameter safe_mode is enabled on this PHP, check that Dolibarr php files owns to web server user (or group).
ErrorNoMailDefinedForThisUser=No mail defined for this user
@@ -28,6 +28,7 @@ ErrorLeftMenuMustHaveAParentId=A menu of type 'Left' must have a parent id.
ErrorGenbarCodeNotfound=File not found (Bad path, wrong permissions or access denied by openbasedir parameter)
ErrorFunctionNotAvailableInPHP=Function %s is required for this feature but is not available in this version/setup of PHP.
ErrorDirAlreadyExists=A directory with this name already exists.
-WarningAllowUrlFopenMustBeOn=Parameter allow_url_fopen must be set to on in filer php.ini for having this module working completely. You must modify this file manually.
ErrorFieldCanNotContainSpecialCharacters=Field %s must not contains special characters.
-WarningBuildScriptNotRunned=Script %s was not yet ran to build graphics.
\ No newline at end of file
+WarningAllowUrlFopenMustBeOn=Parameter allow_url_fopen must be set to on in filer php.ini for having this module working completely. You must modify this file manually.
+WarningBuildScriptNotRunned=Script %s was not yet ran to build graphics.
+WarningBookmarkAlreadyExists=A bookmark with this title or this target (URL) already exists.
diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang
index 9f86e5017ee..a1739dc927e 100644
--- a/htdocs/langs/es_ES/errors.lang
+++ b/htdocs/langs/es_ES/errors.lang
@@ -1,6 +1,4 @@
# Dolibarr language file - es_ES - errors
-
-
ErrorDuplicateTrigger=Un archvio trigger de nombre '%s' está cargado. Elimine el dobre de la carpeta '%s'.
ErrorFailToDeleteFile=Error al eliminar el archivo '%s'.
ErrorThisContactIsAlreadyDefinedAsThisType=Este contacto ya está definido como contacto para este tipo.
@@ -16,7 +14,7 @@ ErrorSupplierCodeRequired=C
ErrorSupplierCodeAlreadyUsed=Código de proveedor ya utilizado
ErrorBadParameters=Parámetros incorrectos
ErrorFailedToWriteInDir=Imposible escribir en la carpeta %s
-UserCannotBeDelete=El usuario no puede ser eliminado. Quizá esé asociado a elementos de Dolibarr.
+ErrorUserCannotBeDelete=El usuario no puede ser eliminado. Quizá esé asociado a elementos de Dolibarr.
ErrorFieldsRequired=No se indicaron algunos campos obligatorios
ErrorFailedToCreateDir=Error en la creación de una carpeta. Compruebe que el usuario del servidor Web tiene derechos de escritura en las carpetas de documentos de Dolibarr. Si el parámetro safe_mode está activo en este PHP, Compruebe que los archivos php dolibarr pertenecen al usuario del servidor Web.
ErrorNoMailDefinedForThisUser=E-Mail no definido para este usuario
diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang
index c0fd11d99eb..f75734a44ab 100644
--- a/htdocs/langs/fr_FR/errors.lang
+++ b/htdocs/langs/fr_FR/errors.lang
@@ -18,7 +18,7 @@ ErrorSupplierCodeAlreadyUsed=Code fournisseur deja utilise
ErrorBadParameters=Parametres incorrects
ErrorFailedToWriteInDir=Impossible d'écrire dans le répertoire %s
ErrorFoundBadEmailInFile=Syntaxe de mail incorrecte trouvée pour %s lignes dans le fichier (exemple line %s avec email=%s)
-UserCannotBeDelete=L'utilisateur ne peut pas etre supprimée. Peut-être est-il associé à des éléments de Dolibarr.
+ErrorUserCannotBeDelete=L'utilisateur ne peut pas etre supprimée. Peut-être est-il associé à des éléments de Dolibarr.
ErrorFieldsRequired=Des champs obligatoires n'ont pas été renseignés
ErrorFailedToCreateDir=Echec a la creation d'un repertoire. Verifiez que le user du serveur Web a bien les droits d'ecriture dans les repertoires documents de Dolibarr. Si le parametre safe_mode a été activé sur ce PHP, vérifier que les fichiers php dolibarr appartiennent à l'utilisateur du serveur Web.
ErrorNoMailDefinedForThisUser=EMail non defini pour cet utilisateur
@@ -28,6 +28,7 @@ ErrorLeftMenuMustHaveAParentId=Un menu de type 'Left' doit avoir un id de p
ErrorGenbarCodeNotfound=Fichier introuvable (Mauvais chemin, permissions incorrectes ou accès interdit par le paramètre openbasedir)
ErrorFunctionNotAvailableInPHP=La fonction %s est requise pour cette fonctionnalité mais n'est pas disponible dans cette version/installation de PHP.
ErrorDirAlreadyExists=Un répertoire portant ce nom existe déjà.
-WarningAllowUrlFopenMustBeOn=Attention, le paramètre allow_url_fopen doit etre positionné à on dans le fichier php.ini pour que ce module soit pleinement opérationnel. Vous devez modifier ce fichier manuellement.
ErrorFieldCanNotContainSpecialCharacters=Le champ %s ne peut contenir de caractères spéciaux.
-WarningBuildScriptNotRunned=Le script %s n'a pas encore été lancé pour générer les graphiques.
\ No newline at end of file
+WarningAllowUrlFopenMustBeOn=Attention, le paramètre allow_url_fopen doit etre positionné à on dans le fichier php.ini pour que ce module soit pleinement opérationnel. Vous devez modifier ce fichier manuellement.
+WarningBuildScriptNotRunned=Le script %s n'a pas encore été lancé pour générer les graphiques.
+WarningBookmarkAlreadyExists=Un marque-page avec ce titre ou cette destination (URL) existe déjà.
\ No newline at end of file
diff --git a/htdocs/lib/product.lib.php b/htdocs/lib/product.lib.php
index 846820a2568..2df3a6ceace 100644
--- a/htdocs/lib/product.lib.php
+++ b/htdocs/lib/product.lib.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2007 Rodolphe Quiedeville
+/* Copyright (C) 2006-2008 Laurent Destailleur
+ * Copyright (C) 2007 Rodolphe Quiedeville
*
* 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
@@ -19,9 +19,9 @@
*/
/**
- \file htdocs/lib/product.lib.php
- \brief Ensemble de fonctions de base pour le module produit et service
- \version $Id$
+ * \file htdocs/lib/product.lib.php
+ * \brief Ensemble de fonctions de base pour le module produit et service
+ * \version $Id$
*/
function product_prepare_head($product, $user)
@@ -45,7 +45,7 @@ function product_prepare_head($product, $user)
$head[$h][2] = 'photos';
$h++;
- //affichage onglet cat�gorie
+ // Show category tab
if ($conf->categorie->enabled)
{
$head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$product->id;
@@ -54,7 +54,7 @@ function product_prepare_head($product, $user)
$h++;
}
- // Affichage onglet code barre
+ // Show barcode tab
if ($conf->global->MAIN_MODULE_BARCODE)
{
$head[$h][0] = DOL_URL_ROOT."/product/barcode.php?id=".$product->id;
@@ -72,7 +72,7 @@ function product_prepare_head($product, $user)
$h++;
}
- // sousproduits
+ // Sub products
if($conf->global->PRODUIT_SOUSPRODUITS == 1)
{
$head[$h][0] = DOL_URL_ROOT."/product/sousproduits/fiche.php?id=".$product->id;
@@ -122,11 +122,19 @@ function product_prepare_head($product, $user)
{
foreach ($product->onglets as $onglet)
{
- $head[$h] = $onglet;
- $h++;
+ $head[$h] = $onglet;
+ $h++;
}
}
+ if ($conf->bookmark->enabled && $user->rights->bookmark->creer)
+ {
+ $head[$h][0] = DOL_URL_ROOT."/bookmarks/fiche.php?action=addproduct&id=".$product->id."&urlsource=".$_SERVER["PHP_SELF"]."?id=".$product->id;
+ $head[$h][1] = img_object($langs->trans("BookmarkThisPage"),'bookmark');
+ $head[$h][2] = 'image';
+ $h++;
+ }
+
return $head;
}
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index 7117456e0a4..4be05987a23 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -115,7 +115,7 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes")
if ($result < 0)
{
$langs->load("errors");
- $message=' '.$langs->trans("UserCannotBeDelete").' ';
+ $message=''.$langs->trans("ErrorUserCannotBeDelete").' ';
}
else
{
|