From d61219feedd7412b5dd0126ca507d6d595afc295 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Jan 2009 16:44:12 +0000 Subject: [PATCH] Enhancement in bookmark module --- COPYRIGHT | 3 + bookmarks.patch | 190 ------------------ htdocs/admin/bookmark.php | 87 ++++++++ htdocs/bookmarks/bookmarks.lib.php | 4 +- htdocs/comm/index.php | 22 +- htdocs/ecm/index.php | 2 +- htdocs/includes/modules/modBookmark.class.php | 4 +- htdocs/langs/en_US/admin.lang | 4 + htdocs/langs/fr_FR/admin.lang | 4 + 9 files changed, 117 insertions(+), 203 deletions(-) delete mode 100644 bookmarks.patch create mode 100644 htdocs/admin/bookmark.php diff --git a/COPYRIGHT b/COPYRIGHT index bf328de49a3..955d54dd0d8 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -36,6 +36,9 @@ http://www.fsf.org/licensing/licenses/index_html Copyright --------- +Copyright (C) 2009 +- Laurent Destailleur + Copyright (C) 2008 - Laurent Destailleur - Regis Houssin diff --git a/bookmarks.patch b/bookmarks.patch deleted file mode 100644 index 65d5ad1996d..00000000000 --- a/bookmarks.patch +++ /dev/null @@ -1,190 +0,0 @@ -diff -Naur --exclude=add.png --exclude=html.formactions.class.php --exclude=paiement.php --exclude=CVS --exclude=synchro_dev.sh --exclude=recup_cvs.sh --exclude=patch.sh --exclude='.#*' --exclude='*~' --exclude='*.rej' --exclude='*.orig' --exclude='*.bak' --exclude=conf.php --exclude=documents /var/www/html/dolibarr/htdocs/bookmarks/fonctions.inc.php /var/www/html/dolibarr_dev/htdocs/bookmarks/fonctions.inc.php ---- /var/www/html/dolibarr/htdocs/bookmarks/fonctions.inc.php 1970-01-01 01:00:00.000000000 +0100 -+++ /var/www/html/dolibarr_dev/htdocs/bookmarks/fonctions.inc.php 2009-01-21 22:41:44.000000000 +0100 -@@ -0,0 +1,51 @@ -+load("bookmarks"); -+ -+ $ret = ''; -+ $ret .= '
'; -+ -+ $ret .= ''; -+ -+ $ret .= ''; -+ -+ $ret .= '
'; -+ -+ return $ret; -+ } -+ -+?> -\ Pas de fin de ligne à la fin du fichier. -diff -Naur --exclude=add.png --exclude=html.formactions.class.php --exclude=paiement.php --exclude=CVS --exclude=synchro_dev.sh --exclude=recup_cvs.sh --exclude=patch.sh --exclude='.#*' --exclude='*~' --exclude='*.rej' --exclude='*.orig' --exclude='*.bak' --exclude=conf.php --exclude=documents /var/www/html/dolibarr/htdocs/langs/fr_FR/bookmarks.lang /var/www/html/dolibarr_dev/htdocs/langs/fr_FR/bookmarks.lang ---- /var/www/html/dolibarr/htdocs/langs/fr_FR/bookmarks.lang 1970-01-01 01:00:00.000000000 +0100 -+++ /var/www/html/dolibarr_dev/htdocs/langs/fr_FR/bookmarks.lang 2009-01-21 22:14:05.000000000 +0100 -@@ -0,0 +1,4 @@ -+# Dolibarr language file - fr_FR - marque pages -+CHARSET=ISO-8859-1 -+Bookm=Marque pages -+NewBookmark=Nouveau marque page -\ Pas de fin de ligne à la fin du fichier. -diff -Naur --exclude=add.png --exclude=html.formactions.class.php --exclude=paiement.php --exclude=CVS --exclude=synchro_dev.sh --exclude=recup_cvs.sh --exclude=patch.sh --exclude='.#*' --exclude='*~' --exclude='*.rej' --exclude='*.orig' --exclude='*.bak' --exclude=conf.php --exclude=documents /var/www/html/dolibarr/htdocs/main.inc.php /var/www/html/dolibarr_dev/htdocs/main.inc.php ---- /var/www/html/dolibarr/htdocs/main.inc.php 2009-01-21 17:09:23.000000000 +0100 -+++ /var/www/html/dolibarr_dev/htdocs/main.inc.php 2009-01-21 21:01:39.000000000 +0100 -@@ -886,6 +886,15 @@ - img_object($langs->trans("List"),'user').' '.$langs->trans("Members"), 'member', 'sall'); - } - -+ // Zone d'affichage permanente des marque pages -+ if ($conf->bookmark->enabled && $conf->global->MAIN_PERMANENT_BOOKMARKS && $user->rights->bookmark->lire) -+ { -+ include_once (DOL_DOCUMENT_ROOT.'/bookmarks/fonctions.inc.php'); -+ $langs->load("bookmarks"); -+ -+ $ret.=printBookmarksList($db, $langs); -+ } -+ - if ($ret) - { - print "\n"; -@@ -901,7 +910,7 @@ - { - print $form_search; - } -- -+ - // Lien vers l'aide en ligne (uniquement si langue fr_FR) - if ($helppagename) - { -diff -Naur --exclude=add.png --exclude=html.formactions.class.php --exclude=paiement.php --exclude=CVS --exclude=synchro_dev.sh --exclude=recup_cvs.sh --exclude=patch.sh --exclude='.#*' --exclude='*~' --exclude='*.rej' --exclude='*.orig' --exclude='*.bak' --exclude=conf.php --exclude=documents /var/www/html/dolibarr/output.patch /var/www/html/dolibarr_dev/output.patch ---- /var/www/html/dolibarr/output.patch 1970-01-01 01:00:00.000000000 +0100 -+++ /var/www/html/dolibarr_dev/output.patch 2009-01-21 22:41:47.000000000 +0100 -@@ -0,0 +1,93 @@ -+diff -Naur --exclude=add.png --exclude=html.formactions.class.php --exclude=paiement.php --exclude=CVS --exclude=synchro_dev.sh --exclude=recup_cvs.sh --exclude=patch.sh --exclude='.#*' --exclude='*~' --exclude='*.rej' --exclude='*.orig' --exclude='*.bak' --exclude=conf.php --exclude=documents /var/www/html/dolibarr/htdocs/bookmarks/fonctions.inc.php /var/www/html/dolibarr_dev/htdocs/bookmarks/fonctions.inc.php -+--- /var/www/html/dolibarr/htdocs/bookmarks/fonctions.inc.php 1970-01-01 01:00:00.000000000 +0100 -++++ /var/www/html/dolibarr_dev/htdocs/bookmarks/fonctions.inc.php 2009-01-21 22:41:44.000000000 +0100 -+@@ -0,0 +1,51 @@ -++load("bookmarks"); -++ -++ $ret = ''; -++ $ret .= '
'; -++ -++ $ret .= ''; -++ -++ $ret .= ''; -++ -++ $ret .= '
'; -++ -++ return $ret; -++ } -++ -++?> -+\ Pas de fin de ligne à la fin du fichier. -+diff -Naur --exclude=add.png --exclude=html.formactions.class.php --exclude=paiement.php --exclude=CVS --exclude=synchro_dev.sh --exclude=recup_cvs.sh --exclude=patch.sh --exclude='.#*' --exclude='*~' --exclude='*.rej' --exclude='*.orig' --exclude='*.bak' --exclude=conf.php --exclude=documents /var/www/html/dolibarr/htdocs/langs/fr_FR/bookmarks.lang /var/www/html/dolibarr_dev/htdocs/langs/fr_FR/bookmarks.lang -+--- /var/www/html/dolibarr/htdocs/langs/fr_FR/bookmarks.lang 1970-01-01 01:00:00.000000000 +0100 -++++ /var/www/html/dolibarr_dev/htdocs/langs/fr_FR/bookmarks.lang 2009-01-21 22:14:05.000000000 +0100 -+@@ -0,0 +1,4 @@ -++# Dolibarr language file - fr_FR - marque pages -++CHARSET=ISO-8859-1 -++Bookm=Marque pages -++NewBookmark=Nouveau marque page -+\ Pas de fin de ligne à la fin du fichier. -+diff -Naur --exclude=add.png --exclude=html.formactions.class.php --exclude=paiement.php --exclude=CVS --exclude=synchro_dev.sh --exclude=recup_cvs.sh --exclude=patch.sh --exclude='.#*' --exclude='*~' --exclude='*.rej' --exclude='*.orig' --exclude='*.bak' --exclude=conf.php --exclude=documents /var/www/html/dolibarr/htdocs/main.inc.php /var/www/html/dolibarr_dev/htdocs/main.inc.php -+--- /var/www/html/dolibarr/htdocs/main.inc.php 2009-01-21 17:09:23.000000000 +0100 -++++ /var/www/html/dolibarr_dev/htdocs/main.inc.php 2009-01-21 21:01:39.000000000 +0100 -+@@ -886,6 +886,15 @@ -+ img_object($langs->trans("List"),'user').' '.$langs->trans("Members"), 'member', 'sall'); -+ } -+ -++ // Zone d'affichage permanente des marque pages -++ if ($conf->bookmark->enabled && $conf->global->MAIN_PERMANENT_BOOKMARKS && $user->rights->bookmark->lire) -++ { -++ include_once (DOL_DOCUMENT_ROOT.'/bookmarks/fonctions.inc.php'); -++ $langs->load("bookmarks"); -++ -++ $ret.=printBookmarksList($db, $langs); -++ } -++ -+ if ($ret) -+ { -+ print "\n"; -+@@ -901,7 +910,7 @@ -+ { -+ print $form_search; -+ } -+- -++ -+ // Lien vers l'aide en ligne (uniquement si langue fr_FR) -+ if ($helppagename) -+ { diff --git a/htdocs/admin/bookmark.php b/htdocs/admin/bookmark.php new file mode 100644 index 00000000000..a3bc3cbe0c7 --- /dev/null +++ b/htdocs/admin/bookmark.php @@ -0,0 +1,87 @@ + + * Copyright (C) 2005-2009 Laurent Destailleur + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** \file htdocs/admin/bookmark.php + * \ingroup bookmark + * \brief Page to setup bookmark module + * \version $Id$ + */ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); + +$langs->load("admin"); + +if (!$user->admin) + accessforbidden(); + + +if ($_POST["action"] == 'setvalue' && $user->admin) +{ + $result=dolibarr_set_const($db, "BOOKMARKS_SHOW_IN_MENU",$_POST["BOOKMARKS_SHOW_IN_MENU"]); + if ($result >= 0) + { + $mesg='
'.$langs->trans("Success").'
'; + } + else + { + dolibarr_print_error($db); + } +} + + +/* + * + * + */ + +llxHeader(); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("BookmarkSetup"),$linkback,'setup'); + +print $langs->trans("BookmarkDesc")."
\n"; + + +if ($mesg) print '
'.$mesg; + +print '
'; +print '
'; +print ''; + +$var=true; + +print ''; +print ''; +print ''; +print ''; +print "\n"; +$var=!$var; +print ''; + +print ''; +print '
'.$langs->trans("Name").''.$langs->trans("Value").'
'; +print $langs->trans("NbOfBoomarkToShow").''; +print ''; +print '
'; + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?> diff --git a/htdocs/bookmarks/bookmarks.lib.php b/htdocs/bookmarks/bookmarks.lib.php index ea547fa49b2..ea3b15d51a4 100644 --- a/htdocs/bookmarks/bookmarks.lib.php +++ b/htdocs/bookmarks/bookmarks.lib.php @@ -29,7 +29,8 @@ * @param unknown_type $aDb * @param unknown_type $aLangs * @return unknown - */function printBookmarksList ($aDb, $aLangs) + */ +function printBookmarksList ($aDb, $aLangs) { global $conf, $user; @@ -37,6 +38,7 @@ $langs = $aLangs; require_once(DOL_DOCUMENT_ROOT."/bookmarks/bookmark.class.php"); + if (! isset($conf->global->BOOKMARKS_SHOW_IN_MENU)) $conf->global->BOOKMARKS_SHOW_IN_MENU=5; $bookm = new Bookmark($db); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index d2286ed3c97..d51e5f2f47f 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2008 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -35,7 +35,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/agenda.lib.php"); if (!$user->rights->societe->lire) accessforbidden(); - + $langs->load("commercial"); $langs->load("orders"); @@ -342,7 +342,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // \todo A REF print ''; print ''; $i = 0; - + $staticcontrat=new Contrat($db); $var=false; @@ -400,13 +400,15 @@ if ($conf->propal->enabled && $user->rights->propale->lire) $obj = $db->fetch_object($result); $var=!$var; print ""; + + // Ref print '"; + print "\n"; print "\n"; @@ -442,8 +445,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) } /* - * Derni�res propales ferm�es - * + * Last closed proposals */ if ($conf->propal->enabled && $user->rights->propale->lire) @@ -466,7 +468,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) if ( $db->query($sql) ) { $num = $db->num_rows(); - + $i = 0; print '
'.$langs->trans("LastContracts",5).'
'; $propalstatic->id=$obj->propalid; $propalstatic->ref=$obj->ref; print ''; - print ''; print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; @@ -420,6 +422,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) print '
'; print "
rowid."\">".img_object($langs->trans("ShowCompany"),"company")." ".dolibarr_trunc($obj->nom,44).""; print dolibarr_print_date($obj->dp,'day')."
'; print ''; @@ -475,13 +477,15 @@ if ($conf->propal->enabled && $user->rights->propale->lire) { $objp = $db->fetch_object(); print ""; + + // Ref print '
'.$langs->trans("LastClosedProposals",$NBMAX).'
'; $propalstatic->id=$objp->propalid; $propalstatic->ref=$objp->ref; print ''; - print ''; print '
'; + print ''; print $propalstatic->getNomUrl(1); print ''; @@ -506,7 +510,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) $var=!$var; } - + print "
"; $db->free(); } diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 48f5a32c099..e2824c3ba93 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2009 Laurent Destailleur * * 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 diff --git a/htdocs/includes/modules/modBookmark.class.php b/htdocs/includes/modules/modBookmark.class.php index 1f30166cf10..dde9df3ffe3 100644 --- a/htdocs/includes/modules/modBookmark.class.php +++ b/htdocs/includes/modules/modBookmark.class.php @@ -64,12 +64,12 @@ class modBookmark extends DolibarrModules // Dir $this->dirs = array(); - // D�pendances + // Dependancies $this->depends = array(); $this->requiredby = array(); // Config pages - //$this->config_page_url = array(); + $this->config_page_url = array('bookmark.php'); // Constantes $this->const = array(); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 231dd07ffe1..86fb9fba3f3 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -981,3 +981,7 @@ CashDeskSetup=Cash desk module setup CashDeskThirdPartyForSell=Generic third party to use for sells CashDeskBankAccountForSell=Cash account to use for sells CashDeskIdWareHouse=Datawarehous to user for sells +##### Bookmark ##### +BookmarkSetup=Bookmark module setup +BookmarkDesc=This module allows you to manage bookmarks. You can also add shortcuts to any Dolibarr pages or externale web sites on your left menu. +NbOfBoomarkToShow=Maximum number of bookmarks to show in left menu \ No newline at end of file diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index c0cf117c73f..a12b8a0b6c0 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -987,3 +987,7 @@ CashDeskSetup=Configuration du module Caisse enregistreuse CashDeskThirdPartyForSell=Tiers générique à utiliser pour les ventes CashDeskBankAccountForSell=Compte caisse à utiliser pour les ventes CashDeskIdWareHouse=Entrepot à utiliser pour les ventes +##### Bookmark ##### +BookmarkSetup=Configuration du module Bookmark +BookmarkDesc=Ce module vous permet de gérer des liens et raccourcis. Il permet aussi d'ajouter n'importe quelle page de Dolibarr ou lien web dans le menu d'accès rapide sur la gauche. +NbOfBoomarkToShow=Nombre maximum de marques-pages à afficher dans le menu \ No newline at end of file