diff --git a/ChangeLog b/ChangeLog index 524229d014a..81849de6771 100644 --- a/ChangeLog +++ b/ChangeLog @@ -141,6 +141,10 @@ parameter. All methods addline in this case were modified to remove this paramet 5) Property ->tel on objects is now ->phone +6) Trigger LINEPROPAL_MODIFY is renamed into LINEPROPAL_UPDATE and + Trigger CONTRACT_LINE_DELETE rnamed into LINECONTRACT_DELETE to match naming rules. + + ***** ChangeLog for 3.4.2 compared to 3.4.1 ***** Fix: field's problem into company's page (RIB) diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 0e04b77bb90..0847af47624 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -285,7 +285,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer) $object->phone_perso = trim($_POST["phone_perso"]); $object->phone_mobile= trim($_POST["phone_mobile"]); $object->email = trim($_POST["email"]); - $object->skype = trim($_POST["skype"]); + $object->skype = trim($_POST["skype"]); $object->birth = $birthdate; $object->typeid = $_POST["typeid"]; @@ -428,7 +428,7 @@ if ($action == 'add' && $user->rights->adherent->creer) $phone=$_POST["phone"]; $phone_perso=$_POST["phone_perso"]; $phone_mobile=$_POST["phone_mobile"]; - $skype=$_POST["member_skype"]; + $skype=$_POST["member_skype"]; $email=$_POST["member_email"]; $login=$_POST["member_login"]; $pass=$_POST["password"]; @@ -453,7 +453,7 @@ if ($action == 'add' && $user->rights->adherent->creer) $object->phone = $phone; $object->phone_perso = $phone_perso; $object->phone_mobile= $phone_mobile; - $object->skype = $skype; + $object->skype = $skype; $object->email = $email; $object->login = $login; $object->pass = $pass; @@ -861,11 +861,11 @@ else // Tel mobile print ''.$langs->trans("PhoneMobile").''; - // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) - { - print ''.$langs->trans("Skype").''; - } + // Skype + if (! empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").''; + } // Birthday print "".$langs->trans("Birthday")."\n"; @@ -1103,11 +1103,11 @@ else // Tel mobile print ''.$langs->trans("PhoneMobile").'phone_mobile).'">'; - // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) - { - print ''.$langs->trans("Skype").'skype).'">'; - } + // Skype + if (! empty($conf->skype->enabled)) + { + print ''.$langs->trans("Skype").'skype).'">'; + } // Birthday print "".$langs->trans("Birthday")."\n"; @@ -1328,7 +1328,7 @@ else /* * Confirm add in spip - */ + */ if ($action == 'add_spip') { print $form->formconfirm("fiche.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip'); @@ -1336,7 +1336,7 @@ else /* * Confirm removed from spip - */ + */ if ($action == 'del_spip') { print $form->formconfirm("fiche.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip'); @@ -1345,6 +1345,7 @@ else $rowspan=17; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; + if (! empty($conf->skype->enabled)) $rowspan++; print ''; @@ -1427,12 +1428,12 @@ else // Tel mobile print ''; - // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) - { - print ''; - } - + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } + // Birthday print ''; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 0b0c9db4f17..7c3b1f6c479 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -159,7 +159,7 @@ foreach ($modulesdir as $dir) if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) $modulequalified=0; // We discard modules according to property disabled if (isset($objMod->hidden) && $objMod->hidden) $modulequalified=false; - + // Define array $categ with categ with at least one qualified module if ($modulequalified) { diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 5dfbdb9f254..bb4b434742d 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -267,11 +267,11 @@ if ($id > 0) // Fax print ''; - // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) - { - print ''; - } + // Skype + if (! empty($conf->skype->enabled)) + { + print ''; + } // Assujeti a TVA ou pas print ''; diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index ebb08916758..ed12edd032a 100644 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -60,6 +60,8 @@ if ($search_status=='') $search_status=1; // always display activ customer first $search_sale = GETPOST("search_sale"); $search_categ = GETPOST("search_categ",'int'); $catid = GETPOST("catid",'int'); +// If the internal user must only see his customers, force searching by him +if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('customerlist')); @@ -104,17 +106,15 @@ llxHeader('',$langs->trans("ThirdParty"),$help_url); $sql = "SELECT s.rowid, s.nom as name, s.client, s.zip, s.town, 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"; +if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; // We need this table joined to the select in order to filter by categ +if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st"; -// We'll need this table joined to the select in order to filter by sale -if ($search_sale || !$user->rights->societe->client->voir) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fk_stcomm = st.id"; $sql.= " AND s.client IN (1, 3)"; $sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; -if (!$user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; +if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= " AND s.rowid = sc.fk_soc"; if ($socid) $sql.= " AND s.rowid = ".$socid; if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; @@ -149,8 +149,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit +1, $offset); -dol_syslog('comm:list.php: sql='.$sql,LOG_DEBUG); - +dol_syslog('comm/list.php: sql='.$sql,LOG_DEBUG); $result = $db->query($sql); if ($result) { diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 6a963c23658..ef37fa534bd 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -701,7 +701,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $price_base_type = (GETPOST('price_base_type', 'alpha')?GETPOST('price_base_type', 'alpha'):'HT'); $db->begin(); - + // Ecrase $pu par celui du produit // Ecrase $desc par celui du produit // Ecrase $txtva par celui du produit @@ -861,7 +861,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- if ($result > 0) { $db->commit(); - + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language @@ -903,7 +903,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- else { $db->rollback(); - + setEventMessage($object->error, 'errors'); } } @@ -984,11 +984,11 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa $error++; } } - + if (! $error) { $db->begin(); - + $result = $object->updateline( GETPOST('lineid'), $pu_ht, @@ -1015,7 +1015,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa if ($result >= 0) { $db->commit(); - + if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { // Define output language @@ -1046,7 +1046,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa else { $db->rollback(); - + setEventMessage($object->error, 'errors'); } } @@ -1980,8 +1980,8 @@ else // Amount HT print ''; - print ''; - print ''; + print ''; + print ''; // Margin Infos if (! empty($conf->margin->enabled)) { @@ -1993,28 +1993,28 @@ else // Amount VAT print ''; - print ''; - print ''; + print ''; + print ''; // Amount Local Taxes if ($mysoc->localtax1_assuj=="1") //Localtax1 { print ''; - print ''; - print ''; + print ''; + print ''; } if ($mysoc->localtax2_assuj=="1") //Localtax2 { print ''; - print ''; - print ''; + print ''; + print ''; } // Amount TTC print ''; - print ''; - print ''; + print ''; + print ''; // Statut print ''; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 7284827e657..18038d3ed44 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -144,7 +144,7 @@ else dol_print_error($db); // Load sale and categ filters $search_sale = GETPOST('search_sale'); $search_categ = GETPOST('search_categ'); -// If the user must only see his prospect, force searching by him +// If the internal user must only see his prospect, force searching by him 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) @@ -180,18 +180,17 @@ $form=new Form($db); $sql = "SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.datea, s.status as status, s.code_client, s.client,"; $sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,"; $sql.= " d.nom as departement"; -// Updated by Matelli -if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) +if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects) $sql .= " FROM ".MAIN_DB_PREFIX."c_stcomm as st"; -if ($search_sale || !$user->rights->societe->client->voir) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale $sql.= ", ".MAIN_DB_PREFIX."societe as s"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d on (d.rowid = s.fk_departement)"; if (! empty($search_categ) || ! empty($catid)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cs ON s.rowid = cs.fk_societe"; // We need this table joined to the select in order to filter by categ +if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale $sql.= " WHERE s.fk_stcomm = st.id"; $sql.= " AND s.client IN (2, 3)"; $sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; -if ($user->societe_id) $sql.= " AND s.rowid = " .$user->societe_id; -if ($search_sale) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale +if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql.= " AND s.rowid = sc.fk_soc"; +if ($socid) $sql.= " AND s.rowid = " .$socid; if (isset($stcomm) && $stcomm != '') $sql.= " AND s.fk_stcomm=".$stcomm; if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; @@ -224,7 +223,6 @@ if ($socname) { $sortfield = "s.nom"; $sortorder = "ASC"; } - // Count total nb of records $nbtotalofrecords = 0; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) @@ -232,9 +230,9 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); } - $sql.= " ORDER BY $sortfield $sortorder, s.nom ASC"; $sql.= $db->plimit($conf->liste_limit+1, $offset); + dol_syslog('comm/prospect/list.php sql='.$sql,LOG_DEBUG); $resql = $db->query($sql); if ($resql) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 461b3606cd6..2ad24721e46 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2908,19 +2908,21 @@ class Facture extends CommonInvoice $sql .= ' (fk_facture, amount, date_demande, fk_user_demande, code_banque, code_guichet, number, cle_rib)'; $sql .= ' VALUES ('.$this->id; $sql .= ",'".price2num($resteapayer)."'"; - $sql .= ",'".$this->db->idate($now)."',"; + $sql .= ",'".$this->db->idate($now)."'"; $sql .= ",".$user->id; $sql .= ",'".$bac->code_banque."'"; $sql .= ",'".$bac->code_guichet."'"; $sql .= ",'".$bac->number."'"; $sql .= ",'".$bac->cle_rib."')"; - if ( $this->db->query($sql)) + + dol_syslog(get_class($this)."::demande_prelevement sql=".$sql); + if ($this->db->query($sql)) { return 1; } else - { - $this->error=$this->db->error(); + { + $this->error=$this->db->lasterror(); dol_syslog(get_class($this).'::demandeprelevement Erreur'); return -1; } diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index c269b886413..54d40b54c8a 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -526,7 +526,7 @@ else print ''; // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) + if (! empty($conf->skype->enabled)) { print ''; } @@ -733,7 +733,7 @@ else print ''; // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) + if (! empty($conf->skype->enabled)) { print ''; } @@ -952,7 +952,7 @@ else print ''; // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) + if (! empty($conf->skype->enabled)) { print ''; } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 6827e2c4f84..5aafde9e40b 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2013 Raphaël Doursenaud * Copyright (C) 2013 Cédric Salvador - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 Alexandre Spangaro * * 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 @@ -274,7 +274,7 @@ if ($result) print $moreforfilter; print ''; } - + if ($sall) { print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname")." ".$langs->trans("or")." ".$langs->trans("EMail")."): ".$sall; @@ -292,7 +292,7 @@ if ($result) print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mob", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder); - if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); } + if (! empty($conf->skype->enabled)) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); } print_liste_field_titre($langs->trans("DateModificationShort"),$_SERVER["PHP_SELF"],"p.tms", $begin, $param, 'align="center"', $sortfield,$sortorder); print_liste_field_titre($langs->trans("ContactVisibility"),$_SERVER["PHP_SELF"],"p.priv", $begin, $param, 'align="center"', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut", $begin, $param, 'align="center"', $sortfield,$sortorder); @@ -328,12 +328,12 @@ if ($result) print ''; - if (! empty($conf->skype->enabled) && $user->rights->skype->view) + if (! empty($conf->skype->enabled)) { print ''; - } + } print ''; print '"; @@ -397,14 +397,14 @@ if ($result) // EMail print ''; // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) { print ''; } - + if (! empty($conf->skype->enabled)) { print ''; } + // Date print ''; // Private/Public print ''; - + // Status print ''; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index b4168ecc3de..61e41356b6b 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1269,7 +1269,7 @@ class Contrat extends CommonObject // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_LINE_DELETE',$this,$user,$langs,$conf); + $result=$interface->run_triggers('LINECONTRACT_DELETE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers @@ -2118,7 +2118,7 @@ class ContratLigne // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('CONTRACT_LINE_MODIFY',$this,$user,$langs,$conf); + $result=$interface->run_triggers('LINECONTRACT_UPDATE',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 83da19cb5db..0ade2ab1b2b 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -6,7 +6,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2013 Alexandre Spangaro * * 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 @@ -524,16 +524,16 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') global $bc; $form= new Form($db); - + $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $search_status = GETPOST("search_status",'int'); if ($search_status=='') $search_status=1; // always display activ customer first $search_name = GETPOST("search_name",'alpha'); - + if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="p.lastname"; - + $i=-1; $contactstatic = new Contact($db); @@ -559,16 +559,16 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print "\n".'
'.$langs->trans("PhoneMobile").''.dol_print_phone($object->phone_mobile,$object->country_code,0,$object->fk_soc,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'.$langs->trans("Birthday").''.dol_print_date($object->birth,'day').'
'.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').'
'.$langs->trans('Skype').''.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'
'.$langs->trans('Skype').''.dol_print_skype($object->skype,0,$object->id,'AC_SKYPE').'
'.$langs->trans('AmountHT').''.price($object->total_ht).''.$langs->trans("Currency".$conf->currency).''.price($object->total_ht,'',$langs,0,-1,-1,$conf->currency).'
'.$langs->trans('AmountVAT').''.price($object->total_tva).''.$langs->trans("Currency".$conf->currency).'
'.price($object->total_tva,'',$langs,0,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1).''.$langs->trans("Currency".$conf->currency).'
'.price($object->total_localtax1,'',$langs,0,-1,-1,$conf->currency).'
'.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2).''.$langs->trans("Currency".$conf->currency).'
'.price($object->total_localtax2,'',$langs,0,-1,-1,$conf->currency).'
'.$langs->trans('AmountTTC').''.price($object->total_ttc).''.$langs->trans("Currency".$conf->currency).'
'.price($object->total_ttc,'',$langs,0,-1,-1,$conf->currency).'
'.$langs->trans('Status').''.$object->getLibStatut(4).'
'.$langs->trans("IM").'jabberid).'">
'.$langs->trans("Skype").'skype).'">
'.$langs->trans("Skype").'skype).'">
'.$langs->trans("Skype").''.dol_print_skype($object->skype,0,$object->fk_soc,1).'
'; print ''; print ''; print ''; print ' '; $selectarray=array('0'=>$langs->trans("ContactPublic"),'1'=>$langs->trans("ContactPrivate")); @@ -353,7 +353,7 @@ if ($result) while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); - + $var=!$var; print "
'.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).''.dol_print_skype($obj->skype,$obj->cidp,$obj->socid,'AC_SKYPE',18).''.dol_print_skype($obj->skype,$obj->cidp,$obj->socid,'AC_SKYPE',18).''.dol_print_date($db->jdate($obj->tms),"day").''.$contactstatic->LibPubPriv($obj->priv).''.$contactstatic->getLibStatut(3).'
'."\n"; - + $param="socid=".$object->id; if ($search_status != '') $param.='&search_status='.$search_status; if ($search_name != '') $param.='&search_name='.urlencode($search_name); - + print ''; print ''; print ''; print ''; - + $colspan=8; print ''; print_liste_field_titre($langs->trans("Name"),$_SERVER["PHP_SELF"],"p.lastname","",$param,'',$sortfield,$sortorder); @@ -577,10 +577,10 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mobile","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax","",$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email","",$param,'',$sortfield,$sortorder); - if (! empty($conf->skype->enabled) && $user->rights->skype->view) - { - $colspan++; - print ''; + if (! empty($conf->skype->enabled)) + { + $colspan++; + print ''; } print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$param,'',$sortfield,$sortorder); print ""; @@ -595,44 +595,44 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; } print ""; - - + + print ''; print ''; - + print ''; print ''; - + print ''; - + print ''; - + print ''; - if (! empty($conf->skype->enabled) && $user->rights->skype->view) - { - $colspan++; - print ''; + if (! empty($conf->skype->enabled)) + { + $colspan++; + print ''; } print ''; - + print ""; if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { $colspan++; print ''; } - - + + print ''; - + print ""; - + $sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays, p.poste, p.phone, p.phone_mobile, p.fax, p.email, p.skype, p.statut "; $sql .= ", p.civilite, p.address, p.zip, p.town"; @@ -682,12 +682,12 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''; - if (! empty($conf->skype->enabled) && $user->rights->skype->view) + if (! empty($conf->skype->enabled)) { print ''; - } + } print ''; diff --git a/htdocs/core/modules/modSkype.class.php b/htdocs/core/modules/modSkype.class.php index 3102ba97777..6f7da0d3e73 100644 --- a/htdocs/core/modules/modSkype.class.php +++ b/htdocs/core/modules/modSkype.class.php @@ -83,18 +83,6 @@ class modSkype extends DolibarrModules //------ $this->boxes = array(); - // Permissions - //------------ - $this->rights = array(); // Permission array used by this module - $this->rights_class = 'skype'; - $r=0; - - $this->rights[$r][0] = 3101; - $this->rights[$r][1] = 'View skype link'; - $this->rights[$r][3] = 1; - $this->rights[$r][4] = 'view'; - $r++; - // Main menu entries //------------------ $this->menu = array(); diff --git a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN index 7f40302ef2d..e3257e2bda8 100644 --- a/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN +++ b/htdocs/core/triggers/interface_90_all_Demo.class.php-NORUN @@ -243,6 +243,10 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } + elseif ($action == 'LINEORDER_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } elseif ($action == 'LINEORDER_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); @@ -265,6 +269,18 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } + elseif ($action == 'LINEORDER_SUPPLIER_DISPATCH') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEORDER_SUPPLIER_CREATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEORDER_SUPPLIER_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } // Proposals elseif ($action == 'PROPAL_CREATE') @@ -307,7 +323,7 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } - elseif ($action == 'LINEPROPAL_MODIFY') + elseif ($action == 'LINEPROPAL_UPDATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } @@ -337,6 +353,14 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } + elseif ($action == 'LINECONTRACT_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINECONTRACT_DELETE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } // Bills elseif ($action == 'BILL_CREATE') @@ -378,12 +402,28 @@ class InterfaceDemo elseif ($action == 'LINEBILL_INSERT') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEBILL_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } elseif ($action == 'LINEBILL_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } - + elseif ($action == 'LINEBILL_SUPPLIER_CREATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEBILL_SUPPLIER_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEBILL_SUPPLIER_DELETE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + // Payments elseif ($action == 'PAYMENT_CUSTOMER_CREATE') { @@ -419,7 +459,19 @@ class InterfaceDemo { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); } - + elseif ($action == 'LINEFICHINTER_CREATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEFICHINTER_UPDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + elseif ($action == 'LINEFICHINTER_DELETE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + } + // Members elseif ($action == 'MEMBER_CREATE') { diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index beea21996d9..bd1306b0cf6 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -251,7 +251,7 @@ class Fichinter extends CommonObject // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $result=$interface->run_triggers('FICHINTER_UPDATE',$this,$user,$langs,$conf); + $result=$interface->run_triggers('FICHINTER_MODIFY',$this,$user,$langs,$conf); if ($result < 0) { $error++; $this->errors=$interface->errors; } @@ -1148,7 +1148,7 @@ class FichinterLigne // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $resulttrigger=$interface->run_triggers('FICHINTERDET_CREATE',$this,$user,$langs,$conf); + $resulttrigger=$interface->run_triggers('LINEFICHINTER_CREATE',$this,$user,$langs,$conf); if ($resulttrigger < 0) { $error++; $this->errors=$interface->errors; } @@ -1210,7 +1210,7 @@ class FichinterLigne // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $resulttrigger=$interface->run_triggers('FICHINTERDET_UPDATE',$this,$user,$langs,$conf); + $resulttrigger=$interface->run_triggers('LINEFICHINTER_UPDATE',$this,$user,$langs,$conf); if ($resulttrigger < 0) { $error++; $this->errors=$interface->errors; } @@ -1324,7 +1324,7 @@ class FichinterLigne // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); - $resulttrigger=$interface->run_triggers('FICHINTERDET_DELETE',$this,$user,$langs,$conf); + $resulttrigger=$interface->run_triggers('LINEFICHINTER_DELETE',$this,$user,$langs,$conf); if ($resulttrigger < 0) { $error++; $this->errors=$interface->errors; } diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index 78668103606..f59e692fb87 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -87,7 +87,7 @@ $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fk_stcomm = st.id AND s.fournisseur = 1"; $sql.= " AND s.entity IN (".getEntity('societe', 1).")"; -if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; +if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc"; if ($socid) $sql .= " AND s.rowid = ".$socid; if ($socname) { $sql .= natural_search('s.nom', $socname); @@ -118,6 +118,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit+1, $offset); +dol_syslog('fourn/liste.php: sql='.$sql,LOG_DEBUG); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index abd03df051b..7b553e0fcb2 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -410,6 +410,5 @@ PDFCrabeDescription=Invoice PDF template Crabe. A complete invoice template (rec PDFOursinDescription=Invoice PDF template Oursin. A complete invoice template (alternative Template) # NumRef Modules TerreNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 -MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 - +MarsNumRefModelDesc1=Return number with format %syymm-nnnn for standard invoices, %syymm-nnnn for replacement invoices, %syymm-nnnn for credit notes and %syymm-nnnn for credit notes where yy is year, mm is month and nnnn is a sequence with no break and no return to 0 TerreNumRefModelError=A bill starting with $syymm already exists and is not compatible with this model of sequence. Remove it or rename it to activate this module. diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 9605106aec6..1928ba914a0 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -33,7 +33,7 @@ $action = GETPOST('action'); $langs->load("companies"); // Security check -$id = GETPOST('id','int'); +$id = GETPOST('id')?GETPOST('id','int'):GETPOST('socid','int'); if ($user->societe_id) $id=$user->societe_id; $result = restrictedArea($user, 'societe', $id, '&societe'); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 4dabc045353..2fae97baa4f 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -878,7 +878,7 @@ else print ''; // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) + if (! empty($conf->skype->enabled)) { print ''; } @@ -1302,7 +1302,7 @@ else print ''; // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) + if (! empty($conf->skype->enabled)) { print ''; } @@ -1616,7 +1616,7 @@ else print ''; // Skype - if (! empty($conf->skype->enabled) && $user->rights->skype->view) + if (! empty($conf->skype->enabled)) { print ''; diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 0301333f481..f0c6539ea8d 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -243,6 +243,10 @@ class FactureTest extends PHPUnit_Framework_TestCase print __METHOD__." localobject->date_creation=".$localobject->date_creation."\n"; $this->assertNotEquals($localobject->date_creation, ''); + $result=$localobject->demande_prelevement($user); + print __METHOD__." result=".$result."\n"; + $this->assertLessThan($result, 0); + return $localobject->id; }
'.$langs->trans("Skype").''.$langs->trans("Skype").'  
'; print ''; print '       '; print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print '  '; print ''; print '
'; print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL'); print ''; print dol_print_skype($obj->skype,$obj->rowid,$object->id,'AC_SKYPE'); print ''.$contactstatic->getLibStatut(5).'
'.$langs->trans('Web').'
'.$langs->trans('Skype').'
'.$langs->trans('Web').'
'.$langs->trans('Skype').'
'.$langs->trans('Skype').''; print dol_print_skype($object->skype,0,$object->id,'AC_SKYPE'); @@ -1737,7 +1737,7 @@ else // Capital print '
'.$langs->trans('Capital').''; - if ($object->capital) print $object->capital.' '.$langs->trans("Currency".$conf->currency); + if ($object->capital) print price($object->capital,'',$langs,0,-1,-1, $conf->currency); else print ' '; print '