From f89e3238eec39807b0f5abb114b32974827cbfaa Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 20 Oct 2012 10:53:44 +0200 Subject: [PATCH 1/9] New: try to use hooks for customizing lists --- htdocs/comm/list.php | 2 +- htdocs/comm/prospect/list.php | 35 +++++++++++++++++++++++++++++------ htdocs/fourn/liste.php | 35 ++++++++++++++++++++++++++++++----- 3 files changed, 60 insertions(+), 12 deletions(-) diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index eebb066beed..73fb5e06c76 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -149,7 +149,7 @@ if ($result) $i = 0; - print '
'."\n"; + print ''."\n"; // Filter on categories $moreforfilter=''; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index caac721333c..f30fdcc943d 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -145,9 +145,20 @@ if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id; // List of avaible states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state) $sts = array(-1,0,1,2,3); + +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +$hookmanager=new HookManager($db); +$hookmanager->initHooks(array('prospectlist')); + + /* * Actions */ + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks + if ($action == 'cstc') { $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm = ".$_GET["pstcomm"]; @@ -255,9 +266,7 @@ if ($resql) // Print the search-by-sale and search-by-categ filters - print ''; - - print ''; + print ''; // Filter on categories $moreforfilter=''; @@ -275,12 +284,13 @@ if ($resql) } if ($moreforfilter) { - print ''; - print ''; + print ''; } + print '
'; + print '
'; print $moreforfilter; - print '
'; + print ''; print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","",$param,"",$sortfield,$sortorder); @@ -290,6 +300,10 @@ if ($resql) print_liste_field_titre($langs->trans("StatusProsp"),$_SERVER["PHP_SELF"],"s.fk_stcomm","",$param,'align="center"',$sortfield,$sortorder); print ''; print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder); + + $parameters=array(); + $formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print "\n"; print ''; @@ -348,6 +362,9 @@ if ($resql) print ''; print ''; + $parameters=array(); + $formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print "\n"; $i = 0; @@ -399,6 +416,9 @@ if ($resql) print $prospectstatic->getLibStatut(3); print ''; + $parameters=array('obj' => $obj); + $formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print "\n"; $i++; } @@ -410,6 +430,9 @@ if ($resql) print ""; $db->free($resql); + + $parameters=array('sql' => $sql); + $formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook } else { diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index 7589e021e6e..f371931c374 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -55,6 +55,17 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="nom"; +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; +$hookmanager=new HookManager($db); +$hookmanager->initHooks(array('supplierlist')); + +/* + * Actions + */ + +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks /* @@ -114,8 +125,7 @@ if ($resql) print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords); - print ''; - print '
 
'; + print ''."\n"; // Filter on categories $moreforfilter=''; @@ -127,12 +137,13 @@ if ($resql) } if ($moreforfilter) { - print ''; - print ''; + print ''; } + print '
'; + print '
'; print $moreforfilter; - print '
'; + print ''; print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'valign="middle"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","",$param,'valign="middle"',$sortfield,$sortorder); @@ -140,6 +151,10 @@ if ($resql) print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta_fournisseur","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder); + + $parameters=array(); + $formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook + print "\n"; print ''; @@ -162,6 +177,9 @@ if ($resql) print ''; + $parameters=array(); + $formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + print ''; $var=True; @@ -185,12 +203,19 @@ if ($resql) print ''; print ''; + + $parameters=array('obj' => $obj); + $formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook + print "\n"; $i++; } print "
'; print dol_print_date($db->jdate($obj->datec),'day').''.$thirdpartystatic->getLibStatut(3).'
\n"; print "\n"; $db->free($resql); + + $parameters=array('sql' => $sql); + $formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook } else { From a24034348253b2d2536cf07897acff797e8bce74 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Oct 2012 11:05:55 +0200 Subject: [PATCH 2/9] Fix: add possibility to filter with zipcode (very important) --- htdocs/comm/list.php | 11 ++++++++++- htdocs/comm/prospect/list.php | 12 ++++++++++-- htdocs/fourn/liste.php | 10 ++++++++-- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index 73fb5e06c76..7f461282359 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -47,6 +47,7 @@ if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="s.nom"; $search_nom=GETPOST("search_nom"); +$search_zipcode=GETPOST("search_zipcode"); $search_ville=GETPOST("search_ville"); $search_code=GETPOST("search_code"); $search_compta=GETPOST("search_compta"); @@ -77,6 +78,7 @@ if (GETPOST("button_removefilter_x")) $search_sale=''; $socname=""; $search_nom=""; + $search_zipcode=""; $search_ville=""; $search_idprof1=''; $search_idprof2=''; @@ -96,7 +98,7 @@ $thirdpartystatic=new Societe($db); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ThirdParty"),$help_url); -$sql = "SELECT s.rowid, s.nom as name, s.client, s.ville, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,"; +$sql = "SELECT s.rowid, s.nom as name, s.client, s.cp as zip, s.ville, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,"; $sql.= " s.datec, s.datea, s.canvas"; // We'll need these fields in order to filter by sale (including the case where the user can only see his prospects) if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; @@ -116,6 +118,7 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape(strtolower($search_nom))."%'"; +if ($search_zipcode) $sql.= " AND s.cp LIKE '%".$db->escape(strtolower($search_zipcode))."%'"; if ($search_ville) $sql.= " AND s.ville LIKE '%".$db->escape(strtolower($search_ville))."%'"; if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape(strtolower($search_code))."%'"; if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'"; @@ -176,6 +179,7 @@ if ($result) print ''; print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.cp","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("CustomerCode"),$_SERVER["PHP_SELF"],"s.code_client","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder); @@ -193,6 +197,10 @@ if ($result) print ''; print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; @@ -234,6 +242,7 @@ if ($result) $thirdpartystatic->status=$obj->status; print $thirdpartystatic->getNomUrl(1); print ''; + print ''.$obj->zip.''; print ''.$obj->ville.''; print ''.$obj->code_client.''; print ''.$obj->code_compta.''; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index f30fdcc943d..45efe02addd 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -40,6 +40,7 @@ $action = GETPOST('action','alpha'); $socname = GETPOST("socname",'alpha'); $stcomm = GETPOST("stcomm",'int'); $search_nom = GETPOST("search_nom"); +$search_zipcode = GETPOST("search_zipcode"); $search_ville = GETPOST("search_ville"); $search_departement = GETPOST("search_departement"); $search_datec = GETPOST("search_datec"); @@ -173,7 +174,7 @@ if ($action == 'cstc') $formother=new FormOther($db); -$sql = "SELECT s.rowid, s.nom, s.ville, s.datec, s.datea, s.status as status,"; +$sql = "SELECT s.rowid, s.nom, s.cp as zip, s.ville, s.datec, s.datea, s.status as status,"; $sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,"; $sql.= " d.nom as departement"; // Updated by Matelli @@ -194,6 +195,7 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_nom) $sql .= " AND s.nom LIKE '%".$db->escape(strtolower($search_nom))."%'"; +if ($search_zipcode) $sql .= " AND s.cp LIKE '%".$db->escape(strtolower($search_zipcode))."%'"; if ($search_ville) $sql .= " AND s.ville LIKE '%".$db->escape(strtolower($search_ville))."%'"; if ($search_departement) $sql .= " AND d.nom LIKE '%".$db->escape(strtolower($search_departement))."%'"; if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'"; @@ -293,6 +295,7 @@ if ($resql) print ''; print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.cp","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","",$param,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("State"),$_SERVER["PHP_SELF"],"s.fk_departement","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"s.datec","",$param,'align="center"',$sortfield,$sortorder); @@ -309,7 +312,11 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -386,6 +393,7 @@ if ($resql) $prospectstatic->status=$obj->status; print $prospectstatic->getNomUrl(1,'prospect'); print ''; + print "".$obj->zip." "; print "".$obj->ville." "; print ''.$obj->departement.''; // Creation date diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index f371931c374..6ed18f2392c 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -33,6 +33,7 @@ $langs->load("companies"); $socname = GETPOST("socname"); $search_nom = GETPOST("search_nom"); +$search_zipcode = GETPOST("search_zipcode"); $search_ville = GETPOST("search_ville"); $search_code_fournisseur = GETPOST("search_code_fournisseur"); $search_compta_fournisseur = GETPOST("search_compta_fournisseur"); @@ -78,7 +79,7 @@ $thirdpartystatic=new Societe($db); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ThirdParty"),$help_url); -$sql = "SELECT s.rowid as socid, s.nom, s.ville, s.datec, s.datea, st.libelle as stcomm, s.prefix_comm, s.status as status, "; +$sql = "SELECT s.rowid as socid, s.nom, s.cp as zip, s.ville, s.datec, s.datea, st.libelle as stcomm, s.prefix_comm, s.status as status, "; $sql.= "code_fournisseur, code_compta_fournisseur"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -96,6 +97,7 @@ if ($socname) $sortorder = "ASC"; } if ($search_nom) $sql .= " AND s.nom LIKE '%".$db->escape($search_nom)."%'"; +if ($search_zipcode) $sql .= " AND s.cp LIKE '%".$db->escape($search_zipcode)."%'"; if ($search_ville) $sql .= " AND s.ville LIKE '%".$db->escape($search_ville)."%'"; if ($search_code_fournisseur) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_code_fournisseur)."%'"; if ($search_compta_fournisseur) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_compta_fournisseur)."%'"; @@ -146,6 +148,7 @@ if ($resql) print ''; print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,'valign="middle"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Zip"),$_SERVER["PHP_SELF"],"s.cp","",$param,'valign="middle"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","",$param,'valign="middle"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("SupplierCode"),$_SERVER["PHP_SELF"],"s.code_fournisseur","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta_fournisseur","",$param,'align="left"',$sortfield,$sortorder); @@ -161,6 +164,8 @@ if ($resql) print ''; + print ''; + print ''; print ''; @@ -197,7 +202,8 @@ if ($resql) print ''; print $thirdpartystatic->getNomUrl(1,'supplier'); print "\n"; - print "".$obj->ville."\n"; + print ''.$obj->zip.''."\n"; + print ''.$obj->ville.''."\n"; print ''.$obj->code_fournisseur.' '; print ''.$obj->code_compta_fournisseur.' '; print ''; From 6ef90b169a0b80b95e9c63178960e2df3bcde89a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Oct 2012 11:13:35 +0200 Subject: [PATCH 3/9] Typo error --- build/rpm/dolibarr_fedora.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 7b34a563bdb..714157d1f86 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -242,7 +242,7 @@ then grep -q -c "dolibarr_font_DOL_DEFAULT_TTF_BOLD" $config || echo "" >> $config fi -# Create config for se $seconfig +# Create config for SE Linux echo Add SE Linux permissions for dolibarr # semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)" From 2f15857dab97822139d284b7a6d95b4fcfc5bef0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Oct 2012 11:20:59 +0200 Subject: [PATCH 4/9] Fix: add mobile phone in contact list TODO: Fax is obsolete and not used by several companies --- htdocs/core/lib/company.lib.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index cace19d0c88..004750dc192 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -527,8 +527,11 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print "\n".''."\n"; print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; // TODO Fax is obsolete, not used by several companies + print ''; print ""; if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { @@ -536,7 +539,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') } print ""; - $sql = "SELECT p.rowid, p.name, p.firstname, p.fk_pays, p.poste, p.phone, p.fax, p.email, p.note "; + $sql = "SELECT p.rowid, p.name, p.firstname, p.fk_pays, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.note "; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " WHERE p.fk_soc = ".$object->id; $sql .= " ORDER by p.datec"; @@ -572,7 +575,10 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print dol_print_phone($obj->phone,$country_code,$obj->rowid,$object->id,'AC_TEL'); print ''; print ''; + print ''; print '> global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> '; echo $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); - if ((! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '
'; + echo ''; if (is_object($hookmanager)) { @@ -70,6 +72,8 @@ $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); } + if ((! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '
'; + // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows=ROWS_2; diff --git a/htdocs/core/tpl/objectline_add.tpl.php b/htdocs/core/tpl/objectline_add.tpl.php index b9ec775b592..d9f35ad6971 100644 --- a/htdocs/core/tpl/objectline_add.tpl.php +++ b/htdocs/core/tpl/objectline_add.tpl.php @@ -84,9 +84,9 @@ if (! empty($conf->margin->enabled)) { 'update_textarea' => array( 'product_desc' => 'desc' ), - 'show' => array( - 'price_base_type_area' - ), + //'show' => array( + //'price_base_type_area' + //), 'disabled' => array( 'select_type' ) @@ -236,7 +236,7 @@ $(document).ready(function() { //$('#origin_price_ttc_cache').val(data.price_ttc); $('#origin_tva_tx_cache').val(data.tva_tx); $('#select_type').val(data.type).attr('disabled','disabled').trigger('change'); - $('#price_base_type_area').show(); + //$('#price_base_type_area').show(); if (typeof CKEDITOR == "object" && typeof CKEDITOR.instances != "undefined" && CKEDITOR.instances['product_desc'] != "undefined") { CKEDITOR.instances['product_desc'].setData(data.desc).focus(); diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 71da7fd4e69..4629e2dcb22 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -87,6 +87,8 @@ $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); } + echo '
'; + // editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows=ROWS_2; diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index 3fadf385543..a3dc4f412dc 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -72,8 +72,9 @@ jQuery(document).ready(function() { global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="4"' : ' colspan="3"'); ?>> '; $form->select_produits('','idprod','',$conf->product->limit_size,$buyer->price_level); - print '
'; + echo ''; if (is_object($hookmanager)) { @@ -81,6 +82,8 @@ jQuery(document).ready(function() { $reshook=$hookmanager->executeHooks('formCreateProductOptions',$parameters,$object,$action); } + echo '
'; + // Editor wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows=ROWS_2;
'.$langs->trans("Name").''.$langs->trans("Poste").''.$langs->trans("Tel").''.$langs->trans("Fax").''.$langs->trans("EMail").''.$langs->trans("Poste").''.$langs->trans("PhonePro").''.$langs->trans("PhoneMobile").''.$langs->trans("Fax").''.$langs->trans("EMail").' 
'; - print dol_print_phone($obj->fax,$country_code,$obj->rowid,$object->id,'AC_FAX'); + print dol_print_phone($obj->phone_mobile,$country_code,$obj->rowid,$object->id,'AC_TEL'); + print ''; + print dol_print_phone($obj->fax,$country_code,$obj->rowid,$object->id,'AC_FAX'); // TODO Fax is obsolete, not used by several companies print ''; print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL'); From 58eb02274fcd1d2bc0275f45891ff077480fbe6c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Oct 2012 12:13:24 +0200 Subject: [PATCH 5/9] Fix: We must not use strtolower. Case sensitive search or not must be managed by the LIKE or LIKE BINARY into request (this make code portable on other database with the database driver and this avoid errors of strtolower when using non latin characters). --- htdocs/comm/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index 7f461282359..2572c6391ab 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -117,10 +117,10 @@ if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape(strtolower($search_nom))."%'"; -if ($search_zipcode) $sql.= " AND s.cp LIKE '%".$db->escape(strtolower($search_zipcode))."%'"; -if ($search_ville) $sql.= " AND s.ville LIKE '%".$db->escape(strtolower($search_ville))."%'"; -if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape(strtolower($search_code))."%'"; +if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'"; +if ($search_zipcode) $sql.= " AND s.cp LIKE '%".$db->escape($search_zipcode)."%'"; +if ($search_ville) $sql.= " AND s.ville LIKE '%".$db->escape($search_ville)."%'"; +if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'"; if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'"; // Insert sale filter if ($search_sale) From eaad5f075e6bc6b38bc0e7feee2051b628e18306 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Oct 2012 13:08:55 +0200 Subject: [PATCH 6/9] Fix: Some fix to removed refused controls by distrib package build systems. --- build/makepack-dolibarr.pl | 4 ++++ build/rpm/dolibarr.desktop | 2 +- build/rpm/dolibarr_generic.spec | 20 ++++++++++++++++++-- htdocs/core/modules/modCommissions.class.php | 6 +++--- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 38dad83e70c..5810e42e6e3 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -325,6 +325,10 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/amarok`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/jquery/plugins/templates`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems. + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems. + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/PHPExcel/Shared/PDF`; diff --git a/build/rpm/dolibarr.desktop b/build/rpm/dolibarr.desktop index a0496ce864c..8a2d8adb99c 100755 --- a/build/rpm/dolibarr.desktop +++ b/build/rpm/dolibarr.desktop @@ -21,7 +21,7 @@ Exec=xdg-open http://localhost/dolibarr Icon=dolibarr Terminal=false Type=Application -Categories=Office;Finance +Categories=Office;Finance; StartupNotify=true InitialPreference=5 #NoDisplay=true diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 609fbff49e5..2b284b6afb9 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -140,7 +140,9 @@ cui hai bisogno ed essere facile da usare. %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/pixmaps %{__install} -m 644 doc/images/dolibarr_48x48.png $RPM_BUILD_ROOT%{_datadir}/pixmaps/%{name}.png %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/applications +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} || 0%{?suse_version} #desktop-file-install --delete-original --dir=$RPM_BUILD_ROOT%{_datadir}/applications build/rpm/%{name}.desktop +%endif %{__install} -m 644 build/rpm/dolibarr.desktop $RPM_BUILD_ROOT%{_datadir}/applications/%{name}.desktop %{__mkdir} -p $RPM_BUILD_ROOT%{_datadir}/%{name}/build/rpm @@ -167,11 +169,13 @@ cui hai bisogno ed essere facile da usare. # Lang echo "%defattr(0644, root, root, 0644)" > %{name}.lang +echo "%dir %{_datadir}/%{name}/htdocs/langs" >> %{name}.lang for i in $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs/langs/*_* do lang=$(basename $i) lang1=`expr substr $lang 1 2`; lang2=`expr substr $lang 4 2 | tr "[:upper:]" "[:lower:]"`; + echo "%dir %{_datadir}/%{name}/htdocs/langs/${lang}" >> %{name}.lang if [ "$lang1" = "$lang2" ] ; then echo "%lang(${lang1}) %{_datadir}/%{name}/htdocs/langs/${lang}/*.lang" else @@ -198,6 +202,9 @@ done >>%{name}.lang %files -f %{name}.lang %defattr(0755, root, root, 0755) + +%dir %_datadir/dolibarr + %dir %_datadir/dolibarr/scripts %_datadir/dolibarr/scripts/* @@ -207,6 +214,8 @@ done >>%{name}.lang %_datadir/pixmaps/dolibarr.png %_datadir/applications/dolibarr.desktop +%dir %_datadir/dolibarr/build + %dir %_datadir/dolibarr/build/rpm %_datadir/dolibarr/build/rpm/* @@ -261,6 +270,8 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/*.php %_datadir/dolibarr/htdocs/*.txt +%dir %{_sysconfdir}/dolibarr + %if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} || 0%{?mdkversion} %defattr(0664, root, apache) %else @@ -406,8 +417,13 @@ fi # Create a config link dolibarr.conf if [ ! -L $apachelink ]; then - echo Create dolibarr web server config link $apachelink - ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink + apachelinkdir=`dirname $apachelink` + if [ -d $apachelinkdir ]; then + echo Create dolibarr web server config link from %{_sysconfdir}/dolibarr/apache.conf to $apachelink + ln -fs %{_sysconfdir}/dolibarr/apache.conf $apachelink + else + echo Do not create link $apachelink - web server conf dir $apachelinkdir not found. web server package may not be installed + fi fi echo Set permission to $apacheuser:$apachegroup on /var/lib/dolibarr diff --git a/htdocs/core/modules/modCommissions.class.php b/htdocs/core/modules/modCommissions.class.php index 58b6daeed1b..bffd5907f2a 100644 --- a/htdocs/core/modules/modCommissions.class.php +++ b/htdocs/core/modules/modCommissions.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012 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 @@ -12,8 +13,7 @@ * 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. + * along with this program. If not, see . */ /** From 50113dd5131f6c420f2dac833f349c567025ff0b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Oct 2012 13:17:48 +0200 Subject: [PATCH 7/9] Fix: Bad path --- build/makepack-dolibarr.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 5810e42e6e3..f2a06da1b10 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -325,9 +325,9 @@ if ($nboftargetok) { $ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/amarok`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; - $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/jquery/plugins/templates`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems. - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems. + $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/templates`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems. + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems. $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpexcel/license.txt`; From 07149b548c01c9ef87197054270ec2c649504bef Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Oct 2012 13:40:11 +0200 Subject: [PATCH 8/9] Fix: Another bad dir --- build/makepack-dolibarr.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index f2a06da1b10..a18529821b6 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -326,7 +326,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/theme/amarok`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`; $ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/jqueryFileTree/connectors/jqueryFileTree.pl`; # Avoid errors into rpmlint - $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/templates`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems. + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/template`; # Package not valid for most linux distributions (errors reported into compile.js). Package should be embed by modules to avoid problems. $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/phpmailer`; # Package not valid for most linux distributions (errors reported into file LICENSE). Package should be embed by modules to avoid problems. $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`; From 9bbea4f385a6c22bafde19126992618af02dfc2b Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 22 Oct 2012 17:02:17 +0200 Subject: [PATCH 9/9] Fix: use span is better --- htdocs/core/tpl/freeproductline_create.tpl.php | 6 +++++- htdocs/core/tpl/objectline_add.tpl.php | 8 ++++---- htdocs/core/tpl/objectline_edit.tpl.php | 2 ++ htdocs/core/tpl/predefinedproductline_create.tpl.php | 5 ++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index 722b556fd28..17da725a80d 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -61,8 +61,10 @@