From ded69bf57dd9430db02330e464673b06cc7fcd4a Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 9 Mar 2018 18:59:06 +0100 Subject: [PATCH 01/53] New : link users to company like a tag --- htdocs/core/class/html.form.class.php | 5 +- htdocs/societe/card.php | 31 +- htdocs/societe/class/societe.class.php | 67 ++++ htdocs/societe/commerciaux.php | 300 ------------------ .../tpl/linesalesrepresentative.tpl.php | 34 +- 5 files changed, 102 insertions(+), 335 deletions(-) delete mode 100644 htdocs/societe/commerciaux.php diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 70274040fd3..77f13357ac4 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1463,7 +1463,7 @@ class Form * @return string HTML select string * @see select_dolgroups */ - function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0) + function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0, $outputmode=0) { global $conf,$user,$langs; @@ -1489,6 +1489,7 @@ class Form } $out=''; + $outarray = array(); // Forge request to select users $sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.statut, u.login, u.admin, u.entity"; @@ -1617,6 +1618,7 @@ class Form $out.=' - '.$disableline; // This is text from $enableonlytext parameter } $out.= ''; + $outarray[$userstatic->id] = $userstatic->getFullName($langs, $fullNameMode, -1, $maxlength); $i++; } @@ -1633,6 +1635,7 @@ class Form dol_print_error($this->db); } + if ($outputmode) return $outarray; return $out; } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index aafea674bcf..46595790c67 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -534,6 +534,15 @@ if (empty($reshook)) $error++; } } + + // Links with users + $salesreps = GETPOST('commercial', 'array'); + $result = $object->setSalesRep($salesreps); + if ($result < 0) + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } // Customer categories association $custcats = GETPOST('custcats', 'array'); @@ -663,6 +672,15 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); $error++; } + + // Links with users + $salesreps = GETPOST('commercial', 'array'); + $result = $object->setSalesRep($salesreps); + if ($result < 0) + { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } // Prevent thirdparty's emptying if a user hasn't rights $user->rights->categorie->lire (in such a case, post of 'custcats' is not defined) if (! $error && !empty($user->rights->categorie->lire)) @@ -1356,7 +1374,8 @@ else print ''; print ''.fieldLabel('AllocateCommercial','commercial_id').''; print ''; - print $form->select_dolusers((! empty($object->commercial_id)?$object->commercial_id:$user->id),'commercial_id',1); // Add current user by default + $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); + print $form->multiselectarray('commercial', $userlist, GETPOST('commercial', 'array'), null, null, null, null, "90%"); print ''; } @@ -1926,6 +1945,16 @@ else // Capital print ''.fieldLabel('Capital','capital').''; print ' '.$langs->trans("Currency".$conf->currency).''; + + // Assign a Name + print ''; + print ''.fieldLabel('AllocateCommercial','commercial_id').''; + print ''; + $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); + $arrayselected = GETPOST('commercial', 'array'); + if(empty($arrayselected)) $arrayselected = $object->get_users(); + print $form->multiselectarray('commercial', $userlist, $arrayselected, null, null, null, null, "90%"); + print ''; // Default language if (! empty($conf->global->MAIN_MULTILANGS)) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index dbf3015ba1e..587665eb0b1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3895,6 +3895,73 @@ class Societe extends CommonObject return $error ? -1 : 1; } + /** + * Sets company to supplied users. + * + * @param int[]|int $users User ID or array of user IDs + * @return int <0 if KO, >0 if OK + */ + public function setSalesRep($salesrep) + { + global $user; + + // Handle single user + if (!is_array($salesrep)) { + $salesrep = array($salesrep); + } + + // Get current users + $existing = $this->get_users(); + + // Diff + if (is_array($existing)) { + $to_del = array_diff($existing, $salesrep); + $to_add = array_diff($salesrep, $existing); + } else { + $to_del = array(); // Nothing to delete + $to_add = $salesrep; + } + + $error = 0; + + // Process + foreach ($to_del as $del) { + $this->del_commercial($user, $del); + } + foreach ($to_add as $add) { + $result = $this->add_commercial($user, $add); + if ($result < 0) + { + $error++; + $this->error = $c->error; + $this->errors = $c->errors; + break; + } + } + + return $error ? -1 : 1; + } + + /** + * Get all linked user to company + * + * @return Array + */ + public function get_users() { + $sql = 'SELECT fk_user FROM '.MAIN_DB_PREFIX.'societe_commerciaux '; + $sql.= 'WHERE fk_soc = '.$this->id; + + $resql = $this->db->query($sql); + + $users = array(); + + while ($obj = $this->db->fetch_object($resql)) { + $users[] = $obj->fk_user; + } + + return $users; + } + /** * Function used to replace a thirdparty id with another one. diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php deleted file mode 100644 index d6add5eacd5..00000000000 --- a/htdocs/societe/commerciaux.php +++ /dev/null @@ -1,300 +0,0 @@ - - * Copyright (C) 2010 Laurent Destailleur - * Copyright (C) 2010-2011 Regis Houssin - * - * 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 3 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, see . - */ - -/** - * \file htdocs/societe/commerciaux.php - * \ingroup societe - * \brief Page of links to sales representatives - */ - -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - -$langs->load("companies"); -$langs->load("commercial"); -$langs->load("customers"); -$langs->load("suppliers"); -$langs->load("banks"); - -// Security check -$socid = GETPOST('socid', 'int'); -if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'societe','',''); - -$hookmanager->initHooks(array('salesrepresentativescard','globalcard')); - -/* - * Actions - */ - -if (! empty($socid) && $_GET["commid"]) -{ - $action = 'add'; - - if ($user->rights->societe->creer) - { - $object = new Societe($db); - $object->fetch($socid); - - $parameters=array('id'=>$_GET["commid"]); - $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - - if (empty($reshook)) $object->add_commercial($user, $_GET["commid"]); - - header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$object->id); - exit; - } - else - { - header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); - exit; - } -} - -if (! empty($socid) && $_GET["delcommid"]) -{ - $action = 'delete'; - - if ($user->rights->societe->creer) - { - $object = new Societe($db); - $object->fetch($socid); - - $parameters=array('id'=>$_GET["delcommid"]); - $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - - if (empty($reshook)) $object->del_commercial($user, $_GET["delcommid"]); - - header("Location: commerciaux.php?socid=".$object->id); - exit; - } - else - { - header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); - exit; - } -} - - -/* - * View - */ - -$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; -llxHeader('',$langs->trans("ThirdParty"),$help_url); - -$form = new Form($db); - -if (! empty($socid)) -{ - $object = new Societe($db); - $result=$object->fetch($socid); - - $action='view'; - - $head=societe_prepare_head2($object); - - dol_fiche_head($head, 'salesrepresentative', $langs->trans("ThirdParty"), -1, 'company'); - - $linkback = ''.$langs->trans("BackToList").''; - - dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); - - print '
'; - - print '
'; - print ''; - - print ''; - print 'global->SOCIETE_USEPREFIX)?' colspan="3"':'').'>'; - print $object->code_client; - if ($object->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); - print ''; - if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field - { - print ''; - } - print ''; - print ''; - - // Liste les commerciaux - print ''; - print '"; - - print '
'.$langs->trans('CustomerCode').''.$langs->trans('Prefix').''.$object->prefix_comm.'
'.$langs->trans("SalesRepresentatives").''; - - $sql = "SELECT DISTINCT u.rowid, u.login, u.fk_soc, u.lastname, u.firstname, u.statut, u.entity, u.photo"; - $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; - $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) - { - $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; - } - $sql .= " WHERE sc.fk_soc =".$object->id; - $sql .= " AND sc.fk_user = u.rowid"; - if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) - { - $sql.= " AND ((ug.fk_user = sc.fk_user"; - $sql.= " AND ug.entity = ".$conf->entity.")"; - $sql.= " OR u.admin = 1)"; - } - else - $sql.= " AND u.entity IN (0,".$conf->entity.")"; - - $sql .= " ORDER BY u.lastname ASC "; - - dol_syslog('societe/commerciaux.php::list salesman sql = '.$sql,LOG_DEBUG); - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - - $tmpuser = new User($db); - - while ($i < $num) - { - $obj = $db->fetch_object($resql); - - $parameters=array('socid'=>$object->id); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$obj,$action); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - - $tmpuser->id = $obj->rowid; - $tmpuser->firstname = $obj->firstname; - $tmpuser->lastname = $obj->lastname; - $tmpuser->statut = $obj->statut; - $tmpuser->login = $obj->login; - $tmpuser->entity = $obj->entity; - $tmpuser->societe_id = $obj->fk_soc; - $tmpuser->photo = $obj->photo; - print $tmpuser->getNomUrl(-1); - - /*print ''; - print img_object($langs->trans("ShowUser"),"user").' '; - print dolGetFirstLastname($obj->firstname, $obj->lastname)."\n"; - print '';*/ - print ' '; - if ($user->rights->societe->creer) - { - print ''; - print img_delete(); - print ''; - } - print '
'; - $i++; - } - - $db->free($resql); - } - else - { - dol_print_error($db); - } - if($i == 0) { print $langs->trans("NoSalesRepresentativeAffected"); } - - print "
'; - print "
\n"; - - dol_fiche_end(); - - - if ($user->rights->societe->creer && $user->rights->societe->client->voir) - { - /* - * Liste - * - */ - - $langs->load("users"); - $title=$langs->trans("ListOfUsers"); - - $sql = "SELECT DISTINCT u.rowid, u.lastname, u.firstname, u.login, u.email, u.statut, u.fk_soc, u.photo"; - $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; - if (! empty($conf->multicompany->enabled) && ! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) - { - $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE ((ug.fk_user = u.rowid"; - $sql.= " AND ug.entity = ".$conf->entity.")"; - $sql.= " OR u.admin = 1)"; - } - else - $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; - if (! empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND u.statut<>0 "; - $sql.= " ORDER BY u.lastname ASC "; - - $resql = $db->query($sql); - if ($resql) - { - $num = $db->num_rows($resql); - $i = 0; - - print load_fiche_titre($title); - - // Lignes des titres - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - - $var=True; - $tmpuser=new User($db); - - while ($i < $num) - { - $obj = $db->fetch_object($resql); - - print "'; - print ''; - print ''; - print ''; - - print ''."\n"; - $i++; - } - - print "
'.$langs->trans("Name").''.$langs->trans("Login").''.$langs->trans("Status").' 
"; - $tmpuser->id=$obj->rowid; - $tmpuser->firstname=$obj->firstname; - $tmpuser->lastname=$obj->lastname; - $tmpuser->statut=$obj->statut; - $tmpuser->login=$obj->login; - $tmpuser->email=$obj->email; - $tmpuser->societe_id=$obj->fk_soc; - $tmpuser->photo=$obj->photo; - print $tmpuser->getNomUrl(-1); - print ''.$obj->login.''.$tmpuser->getLibStatut(2).''.$langs->trans("Add").'
"; - $db->free($resql); - } - else - { - dol_print_error($db); - } - } - -} - -llxFooter(); -$db->close(); diff --git a/htdocs/societe/tpl/linesalesrepresentative.tpl.php b/htdocs/societe/tpl/linesalesrepresentative.tpl.php index 0714a547f22..2f325f3001f 100644 --- a/htdocs/societe/tpl/linesalesrepresentative.tpl.php +++ b/htdocs/societe/tpl/linesalesrepresentative.tpl.php @@ -24,18 +24,7 @@ if (empty($conf) || ! is_object($conf)) // Sale representative print ''; -print '
'; print $langs->trans('SalesRepresentatives'); -print ''; -if ($user->rights->societe->creer && $user->rights->societe->client->voir) -{ - print ''.img_edit('',1).''; -} -else -{ - print ' '; -} -print '
'; print ''; print ''; @@ -44,7 +33,6 @@ $nbofsalesrepresentative=count($listsalesrepresentatives); if ($nbofsalesrepresentative > 0) { $userstatic=new User($db); - $i=0; foreach($listsalesrepresentatives as $val) { $userstatic->id=$val['id']; @@ -56,27 +44,7 @@ if ($nbofsalesrepresentative > 0) $userstatic->email=$val['email']; $userstatic->entity=$val['entity']; print $userstatic->getNomUrl(-1); - $i++; - if ($i < $nbofsalesrepresentative) - { - print ' '; - if ($i >= 3) // We print only number - { - $userstatic->id=0; - $userstatic->login=''; - $userstatic->lastname=''; - $userstatic->firstname=''; - $userstatic->statut=0; - $userstatic->photo=''; - $userstatic->email=''; - $userstatic->entity=0; - print ''; - print $userstatic->getNomUrl(-1, 'nolink', 0, 1); - print '+'.($nbofsalesrepresentative - $i); - print ''; - break; - } - } + print ' '; } } else print ''.$langs->trans("NoSalesRepresentativeAffected").''; From 4e222d3d9220f31c4ead1ddd5cd452ba8ff00d26 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 9 Mar 2018 19:09:16 +0100 Subject: [PATCH 02/53] Comment for travis --- htdocs/core/class/html.form.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 77f13357ac4..1c75f1ab4a5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1460,6 +1460,7 @@ class Form * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. * @param string $morecss More css * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). + * @param int $outputmode 0=HTML select string, 1=Array * @return string HTML select string * @see select_dolgroups */ From a2b9dbfbe396459bddfb94867398302a3dd7c2c1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Mar 2018 11:13:28 +0100 Subject: [PATCH 03/53] Fix list must show only employee --- htdocs/holiday/define_holiday.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 8f0cb2862a7..2d4c7504a30 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -220,6 +220,7 @@ if (!empty($search_name)) { $filters.=natural_search(array('u.firstname','u.lastname'), $search_name); } if ($search_supervisor > 0) $filters.=natural_search(array('u.fk_user'), $search_supervisor, 2); +$filters.= ' AND employee = 1'; // Only employee users are visible $listUsers = $holiday->fetchUsers(false, true, $filters); if (is_numeric($listUsers) && $listUsers < 0) @@ -356,8 +357,10 @@ else print ''; if ($canedit) print ''; print ''; + + // Button modify print ''; - if (! empty($user->rights->holiday->define_holiday)) + if (! empty($user->rights->holiday->define_holiday)) // Allowed to set the balance of any user { print ''; } From cad7bdc74be379faff4f72beb1e00e6cc9c93654 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Wed, 21 Mar 2018 11:54:25 +0100 Subject: [PATCH 04/53] Fix documents are lost if we rename contrat ref --- htdocs/contrat/card.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 2409056cb1f..6e9d5d1bff0 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -872,12 +872,26 @@ if (empty($reshook)) if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } - + + $old_ref = $object->ref; $result = $object->setValueFrom('ref', GETPOST('ref','alpha'), '', null, 'text', '', $user, 'CONTRACT_MODIFY'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $action = 'editref'; } else { + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + $old_filedir = $conf->contrat->dir_output . '/' . dol_sanitizeFileName($old_ref); + $new_filedir = $conf->contrat->dir_output . '/' . dol_sanitizeFileName($object->ref); + + $files = dol_dir_list($old_filedir); + if (!empty($files)) + { + foreach ($files as $file) + { + dol_move($file['fullname'], $new_filedir.'/'.$file['name']); + } + } + header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id); exit; } From 2094c48b7fbe6edb6969e7e55ebfe6a172461aa6 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Wed, 21 Mar 2018 12:14:04 +0100 Subject: [PATCH 05/53] Fix missing folder with multientity --- htdocs/contrat/card.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 6e9d5d1bff0..ccd21eecccd 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -886,6 +886,7 @@ if (empty($reshook)) $files = dol_dir_list($old_filedir); if (!empty($files)) { + if (!is_dir($new_filedir)) dol_mkdir($new_filedir); foreach ($files as $file) { dol_move($file['fullname'], $new_filedir.'/'.$file['name']); From b3bb6d88e6713e9c20dbded65b9fd41427e42acb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Mar 2018 19:17:42 +0100 Subject: [PATCH 06/53] Fix list of leave not complete for a manager --- htdocs/holiday/class/holiday.class.php | 228 ++++++++++++------------- htdocs/holiday/list.php | 11 +- 2 files changed, 120 insertions(+), 119 deletions(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index c3c541bb8ce..950c297fb3b 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -50,7 +50,7 @@ class Holiday extends CommonObject var $date_fin=''; // Date end in PHP server TZ var $date_debut_gmt=''; // Date start in GMT var $date_fin_gmt=''; // Date end in GMT - var $halfday=''; + var $halfday=''; // 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning var $statut=''; // 1=draft, 2=validated, 3=approved var $fk_validator; var $date_valid=''; @@ -276,12 +276,12 @@ class Holiday extends CommonObject } /** - * List holidays for a particular user + * List holidays for a particular user or list of users * - * @param int $user_id ID of user to list - * @param string $order Sort order - * @param string $filter SQL Filter - * @return int -1 if KO, 1 if OK, 2 if no result + * @param int|string $user_id ID of user to list, or comma separated list of IDs of users to list + * @param string $order Sort order + * @param string $filter SQL Filter + * @return int -1 if KO, 1 if OK, 2 if no result */ function fetchByUser($user_id, $order='', $filter='') { @@ -321,8 +321,8 @@ class Holiday extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp, ".MAIN_DB_PREFIX."user as uu, ".MAIN_DB_PREFIX."user as ua"; $sql.= " WHERE cp.entity IN (".getEntity('holiday').")"; - $sql.= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau - $sql.= " AND cp.fk_user = ".$user_id; + $sql.= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid"; // Hack pour la recherche sur le tableau + $sql.= " AND cp.fk_user IN (".$user_id.")"; // Filtre de séléction if(!empty($filter)) { @@ -553,7 +553,7 @@ class Holiday extends CommonObject } else { $error++; } - $sql.= " halfday = ".$this->halfday.","; + $sql.= " halfday = ".$this->halfday.","; if(!empty($this->statut) && is_numeric($this->statut)) { $sql.= " statut = ".$this->statut.","; } else { @@ -714,10 +714,10 @@ class Holiday extends CommonObject if ($infos_CP['statut'] == 4) continue; // ignore not validated holidays if ($infos_CP['statut'] == 5) continue; // ignore not validated holidays /* - var_dump("--"); - var_dump("old: ".dol_print_date($infos_CP['date_debut'],'dayhour').' '.dol_print_date($infos_CP['date_fin'],'dayhour').' '.$infos_CP['halfday']); - var_dump("new: ".dol_print_date($dateStart,'dayhour').' '.dol_print_date($dateEnd,'dayhour').' '.$halfday); - */ + var_dump("--"); + var_dump("old: ".dol_print_date($infos_CP['date_debut'],'dayhour').' '.dol_print_date($infos_CP['date_fin'],'dayhour').' '.$infos_CP['halfday']); + var_dump("new: ".dol_print_date($dateStart,'dayhour').' '.dol_print_date($dateEnd,'dayhour').' '.$halfday); + */ if ($halfday == 0) { @@ -797,7 +797,7 @@ class Holiday extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp"; $sql.= " WHERE cp.entity IN (".getEntity('holiday').")"; $sql.= " AND cp.fk_user = ".(int) $fk_user; - $sql.= " AND date_debut <= '".$this->db->idate($timestamp)."' AND date_fin >= '".$this->db->idate($timestamp)."'"; + $sql.= " AND date_debut <= '".$this->db->idate($timestamp)."' AND date_fin >= '".$this->db->idate($timestamp)."'"; $resql = $this->db->query($sql); if ($resql) @@ -837,7 +837,7 @@ class Holiday extends CommonObject } else dol_print_error($this->db); - return array('morning'=>$isavailablemorning, 'afternoon'=>$isavailableafternoon); + return array('morning'=>$isavailablemorning, 'afternoon'=>$isavailableafternoon); } @@ -860,10 +860,10 @@ class Holiday extends CommonObject //if ($option != 'nolink') //{ - // Add param to save lastsearch_values or not - $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); - if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; - if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; //} $linkstart = ''; @@ -1147,15 +1147,15 @@ class Holiday extends CommonObject } if ($result) - { + { $this->db->commit(); return 1; - } - else - { - $this->db->rollback(); + } + else + { + $this->db->rollback(); return -1; - } + } } return 0; @@ -1210,7 +1210,7 @@ class Holiday extends CommonObject return 1; } else - { + { return -1; } } @@ -1395,7 +1395,7 @@ class Holiday extends CommonObject } else { - // We want only list of vacation balance for user ids + // We want only list of vacation balance for user ids $sql = "SELECT DISTINCT cpu.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday_users as cpu, ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE cpu.fk_user = u.user"; @@ -1427,7 +1427,7 @@ class Holiday extends CommonObject return $stringlist; } else - { + { // Erreur SQL $this->error="Error ".$this->db->lasterror(); return -1; @@ -1454,46 +1454,46 @@ class Holiday extends CommonObject else $sql.= " WHERE u.entity IN (0,".$conf->entity.")"; - $sql.= " AND u.statut > 0"; - if ($filters) $sql.=$filters; + $sql.= " AND u.statut > 0"; + if ($filters) $sql.=$filters; - $resql=$this->db->query($sql); + $resql=$this->db->query($sql); - // Si pas d'erreur SQL - if ($resql) - { - $i = 0; - $tab_result = $this->holiday; - $num = $this->db->num_rows($resql); + // Si pas d'erreur SQL + if ($resql) + { + $i = 0; + $tab_result = $this->holiday; + $num = $this->db->num_rows($resql); - // Boucles du listage des utilisateurs - while($i < $num) { + // Boucles du listage des utilisateurs + while($i < $num) { - $obj = $this->db->fetch_object($resql); + $obj = $this->db->fetch_object($resql); - $tab_result[$i]['rowid'] = $obj->rowid; - $tab_result[$i]['name'] = $obj->lastname; // deprecated - $tab_result[$i]['lastname'] = $obj->lastname; - $tab_result[$i]['firstname'] = $obj->firstname; - $tab_result[$i]['gender'] = $obj->gender; - $tab_result[$i]['status'] = $obj->statut; - $tab_result[$i]['employee'] = $obj->employee; - $tab_result[$i]['photo'] = $obj->photo; - $tab_result[$i]['fk_user'] = $obj->fk_user; - //$tab_result[$i]['type'] = $obj->type; - //$tab_result[$i]['nb_holiday'] = $obj->nb_holiday; + $tab_result[$i]['rowid'] = $obj->rowid; + $tab_result[$i]['name'] = $obj->lastname; // deprecated + $tab_result[$i]['lastname'] = $obj->lastname; + $tab_result[$i]['firstname'] = $obj->firstname; + $tab_result[$i]['gender'] = $obj->gender; + $tab_result[$i]['status'] = $obj->statut; + $tab_result[$i]['employee'] = $obj->employee; + $tab_result[$i]['photo'] = $obj->photo; + $tab_result[$i]['fk_user'] = $obj->fk_user; + //$tab_result[$i]['type'] = $obj->type; + //$tab_result[$i]['nb_holiday'] = $obj->nb_holiday; - $i++; + $i++; + } + // Retoune le tableau des utilisateurs + return $tab_result; + } + else + { + // Erreur SQL + $this->errors[]="Error ".$this->db->lasterror(); + return -1; } - // Retoune le tableau des utilisateurs - return $tab_result; - } - else - { - // Erreur SQL - $this->errors[]="Error ".$this->db->lasterror(); - return -1; - } } else { @@ -1637,32 +1637,32 @@ class Holiday extends CommonObject $sql.= ")"; $resql=$this->db->query($sql); - if (! $resql) - { - $error++; $this->errors[]="Error ".$this->db->lasterror(); - } + if (! $resql) + { + $error++; $this->errors[]="Error ".$this->db->lasterror(); + } - if (! $error) - { - $this->optRowid = $this->db->last_insert_id(MAIN_DB_PREFIX."holiday_logs"); - } + if (! $error) + { + $this->optRowid = $this->db->last_insert_id(MAIN_DB_PREFIX."holiday_logs"); + } - // Commit or rollback - if ($error) - { - foreach($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::addLogCP ".$errmsg, LOG_ERR); - $this->error.=($this->error?', '.$errmsg:$errmsg); - } - $this->db->rollback(); - return -1*$error; - } - else - { - $this->db->commit(); + // Commit or rollback + if ($error) + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::addLogCP ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + else + { + $this->db->commit(); return $this->optRowid; - } + } } /** @@ -1702,43 +1702,43 @@ class Holiday extends CommonObject $resql=$this->db->query($sql); // Si pas d'erreur SQL - if ($resql) { + if ($resql) { - $i = 0; - $tab_result = $this->logs; - $num = $this->db->num_rows($resql); + $i = 0; + $tab_result = $this->logs; + $num = $this->db->num_rows($resql); - // Si pas d'enregistrement - if(!$num) { + // Si pas d'enregistrement + if(!$num) { return 2; - } + } - // On liste les résultats et on les ajoutent dans le tableau - while($i < $num) { + // On liste les résultats et on les ajoutent dans le tableau + while($i < $num) { - $obj = $this->db->fetch_object($resql); + $obj = $this->db->fetch_object($resql); - $tab_result[$i]['rowid'] = $obj->rowid; - $tab_result[$i]['date_action'] = $obj->date_action; - $tab_result[$i]['fk_user_action'] = $obj->fk_user_action; - $tab_result[$i]['fk_user_update'] = $obj->fk_user_update; - $tab_result[$i]['type_action'] = $obj->type_action; - $tab_result[$i]['prev_solde'] = $obj->prev_solde; - $tab_result[$i]['new_solde'] = $obj->new_solde; - $tab_result[$i]['fk_type'] = $obj->fk_type; + $tab_result[$i]['rowid'] = $obj->rowid; + $tab_result[$i]['date_action'] = $obj->date_action; + $tab_result[$i]['fk_user_action'] = $obj->fk_user_action; + $tab_result[$i]['fk_user_update'] = $obj->fk_user_update; + $tab_result[$i]['type_action'] = $obj->type_action; + $tab_result[$i]['prev_solde'] = $obj->prev_solde; + $tab_result[$i]['new_solde'] = $obj->new_solde; + $tab_result[$i]['fk_type'] = $obj->fk_type; - $i++; - } - // Retourne 1 et ajoute le tableau à la variable - $this->logs = $tab_result; - return 1; - } - else - { - // Erreur SQL - $this->error="Error ".$this->db->lasterror(); - return -1; - } + $i++; + } + // Retourne 1 et ajoute le tableau à la variable + $this->logs = $tab_result; + return 1; + } + else + { + // Erreur SQL + $this->error="Error ".$this->db->lasterror(); + return -1; + } } diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 63d9527c132..c7227e16472 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -48,7 +48,7 @@ $contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectl $backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print') -$childis = $user->getAllChildIds(1); +$childids = $user->getAllChildIds(1); // Security check $socid=0; @@ -107,7 +107,6 @@ $fieldstosearchall = array( 'uu.firstname'=>'EmployeeFirstname' ); -$childids = $user->getAllChildIds(1); /* @@ -275,14 +274,16 @@ if ($id > 0) $search_employee = $user_id; } -// Récupération des congés payés de l'utilisateur ou de tous les users +// Récupération des congés payés de l'utilisateur ou de tous les users de sa hierarchy +// Load array $holiday->holiday if (empty($user->rights->holiday->read_all) || $id > 0) { - $result = $holiday->fetchByUser($user_id,$order,$filter); // Load array $holiday->holiday + if ($id > 0) $result = $holiday->fetchByUser($id, $order, $filter); + else $result = $holiday->fetchByUser(join(',',$childids), $order, $filter); } else { - $result = $holiday->fetchAll($order,$filter); // Load array $holiday->holiday + $result = $holiday->fetchAll($order, $filter); } // Si erreur SQL if ($result == '-1') From 1feb22ea9c0f22ca663d7a6b109baa6b8a58953c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 21 Mar 2018 22:24:11 +0100 Subject: [PATCH 07/53] fix user right on modRessource --- htdocs/core/modules/modResource.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 7ab7afc1e4b..0f6ac3635b3 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -231,7 +231,7 @@ class modResource extends DolibarrModules 'langs'=> 'resource', 'position'=> 101, 'enabled'=> '1', - 'perms'=> '$user->rights->resource->read', + 'perms'=> '$user->rights->resource->write', 'target'=> '', 'user'=> 0 ); @@ -255,7 +255,7 @@ class modResource extends DolibarrModules // Exports //-------- $r=0; - + $r++; $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="ResourceSingular"; // Translation key (used only if key ExportDataset_xxx_z not found) @@ -265,19 +265,19 @@ class modResource extends DolibarrModules $this->export_entities_array[$r]=array('r.rowid'=>'resource','r.ref'=>'resource','c.code'=>'resource','c.label'=>'resource','r.description'=>'resource','r.note_private'=>"resource",'r.resource'=>"resource",'r.asset_number'=>'resource','r.datec'=>"resource",'r.tms'=>"resource"); $keyforselect='resource'; $keyforelement='resource'; $keyforaliasextra='extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - + $this->export_dependencies_array[$r]=array('resource'=>array('r.rowid')); // We must keep this until the aggregate_array is used. To add unique key if we ask a field of a child to avoid the DISTINCT to discard them. $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'resource as r '; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_resource as c ON c.rowid=r.fk_code_type_resource'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'resource_extrafields as extra ON extra.fk_object = c.rowid'; $this->export_sql_end[$r] .=' AND r.entity IN ('.getEntity('resource').')'; - + // Imports //-------- $r=0; - + // Import list of third parties and attributes $r++; $this->import_code[$r]=$this->rights_class.'_'.$r; @@ -307,7 +307,7 @@ class modResource extends DolibarrModules $this->import_regex_array[$r]=array('s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$'); $this->import_examplevalues_array[$r]=array('r.ref'=>"REF1",'r.fk_code_type_resource'=>"Code from dictionary resource type",'r.datec'=>"2017-01-01 or 2017-01-01 12:30:00"); $this->import_updatekeys_array[$r]=array('r.rf'=>'ResourceFormLabel_ref'); - + } /** From 227b830aa2c1d73e4bd5e9b1901c0c7e528709e1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 09:41:30 +0100 Subject: [PATCH 08/53] Fix visible rounding of abandonned amount --- htdocs/compta/facture/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 37f38b732fe..56b7adc01d5 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4048,7 +4048,7 @@ else if ($id > 0 || ! empty($ref)) if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'discount_vat') { print ''; print $form->textwithpicto($langs->trans("Discount") . ':', $langs->trans("HelpEscompte"), - 1); - print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; + print '' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . ' '; $resteapayeraffiche = 0; $cssforamountpaymentcomplete = ''; } @@ -4056,7 +4056,7 @@ else if ($id > 0 || ! empty($ref)) if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'badcustomer') { print ''; print $form->textwithpicto($langs->trans("Abandoned") . ':', $langs->trans("HelpAbandonBadCustomer"), - 1); - print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; + print '' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . ' '; // $resteapayeraffiche=0; $cssforamountpaymentcomplete = ''; } @@ -4064,7 +4064,7 @@ else if ($id > 0 || ! empty($ref)) if (($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED) && $object->close_code == 'product_returned') { print ''; print $form->textwithpicto($langs->trans("ProductReturned") . ':', $langs->trans("HelpAbandonProductReturned"), - 1); - print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; + print '' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . ' '; $resteapayeraffiche = 0; $cssforamountpaymentcomplete = ''; } @@ -4075,7 +4075,7 @@ else if ($id > 0 || ! empty($ref)) if ($object->close_note) $text .= '

' . $langs->trans("Reason") . ':' . $object->close_note; print $form->textwithpicto($langs->trans("Abandoned") . ':', $text, - 1); - print '' . price($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye) . ' '; + print '' . price(price2num($object->total_ttc - $creditnoteamount - $depositamount - $totalpaye, 'MT')) . ' '; $resteapayeraffiche = 0; $cssforamountpaymentcomplete = ''; } From 3b55049895d41b7ea43b37877be6ff332d5c9a37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 10:23:25 +0100 Subject: [PATCH 09/53] Dolibarrize module ticket --- htdocs/commande/card.php | 22 +- .../modulebuilder/template/myobject_card.php | 24 +- htdocs/ticketsup/card.php | 291 +++++++++--------- .../class/actions_ticketsup.class.php | 120 ++++---- .../ticketsup/class/api_ticketsups.class.php | 4 +- htdocs/ticketsup/class/ticketsup.class.php | 199 ++++++------ htdocs/ticketsup/contact.php | 8 +- htdocs/ticketsup/document.php | 2 +- htdocs/ticketsup/history.php | 4 +- 9 files changed, 363 insertions(+), 311 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 44375df6dc8..c4f1acfb58d 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1980,17 +1980,17 @@ if ($action == 'create' && $user->rights->commande->creer) { if ($action != 'classify') $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
'; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.='
'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } } else { if (! empty($object->fk_project)) { $proj = new Project($db); diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 2474345edb9..470825a6a61 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -284,22 +284,20 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->mymodule->creer) + if ($user->rights->mymodule->write) { if ($action != 'classify') - { $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
'; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.='
'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (! empty($object->fk_project)) { diff --git a/htdocs/ticketsup/card.php b/htdocs/ticketsup/card.php index 55ebed62c7d..0a8d57e7a7b 100644 --- a/htdocs/ticketsup/card.php +++ b/htdocs/ticketsup/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2016 Christophe Battarel +/* Copyright (C) 2013-2016 Jean-François FERRY + * Copyright (C) 2016 Christophe Battarel * * 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 @@ -17,9 +17,8 @@ */ /** - * Card of ticket - * - * @package ticketsup + * Card of ticket + * @ingroup ticketsup */ require '../main.inc.php'; @@ -71,7 +70,7 @@ if (GETPOST('modelselected')) { $url_page_current = DOL_URL_ROOT.'/ticketsup/card.php'; if ($id || $track_id || $ref) { - $res = $object->fetch($id, $track_id, $ref); + $res = $object->fetch($id, $ref, $track_id); } // Security check @@ -99,6 +98,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be inc $userstat = new User($db); $form = new Form($db); $formticket = new FormTicketsup($db); +$formproject = new FormProjets($db); if ($action == 'view' || $action == 'add_message' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen' || $action == 'editsubject' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') { @@ -234,6 +234,40 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti $morehtmlref .= '
' . $langs->trans("CreatedBy") . ' '; $morehtmlref .= $object->origin_email . ' (' . $langs->trans("TicketEmailOriginIssuer") . ')'; } + + // Project + if (! empty($conf->projet->enabled)) + { + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' '; + if ($user->rights->ticketsup->write) + { + if ($action != 'classify') + $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; + if ($action == 'classify') { + //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); + $morehtmlref.='
'; + $morehtmlref.=''; + $morehtmlref.=''; + $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref.=''; + $morehtmlref.='
'; + } else { + $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + } + } else { + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } + } + } + $morehtmlref.=''; $linkback = '' . $langs->trans("BackToList") . ' '; @@ -308,27 +342,6 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti } print ''; - // Project - if (!empty($conf->projet->enabled)) { - $langs->load('projects'); - print ''; - print ''; - if ($action != 'classify' && $user->rights->ticketsup->write) { - print ''; - } - - print '
'; - print $langs->trans('Project'); - print '' . img_edit($langs->trans('SetProject')) . '
'; - print ''; - if ($action == 'classify') { - $form->form_project($url_page_current . '?track_id=' . $object->track_id, $object->socid, $object->fk_project, 'projectid'); - } else { - $form->form_project($url_page_current . '?track_id=' . $object->track_id, $object->socid, $object->fk_project, 'none'); - } - print ''; - } - // User assigned print '' . $langs->trans("UserAssignedTo") . ''; if ($object->fk_user_assign > 0) { @@ -339,17 +352,17 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti } // Show user list to assignate one if status is "read" - if (GETPOST('set') == "assign_ticket" && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticketsup->write) { + if (GETPOST('set','alpha') == "assign_ticket" && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticketsup->write) { print '
'; print ''; print ''; print ''; print ' '; - print $form->select_dolusers($user->id, 'fk_user_assign', 0); + print $form->select_dolusers($user->id, 'fk_user_assign', 1); print ' '; print '
'; } - if ($object->fk_statut < 8 && GETPOST('set') != "assign_ticket" && $user->rights->ticketsup->manage) { + if ($object->fk_statut < 8 && GETPOST('set','alpha') != "assign_ticket" && $user->rights->ticketsup->manage) { print '' . img_picto('', 'edit') . ' ' . $langs->trans('Modify') . ''; } print ''; @@ -425,13 +438,14 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti print ''; - // View Original message - $actionobject->viewTicketOriginalMessage($user, $action); - - // Fin colonne gauche et début colonne droite print '
'; + + // View Original message + $actionobject->viewTicketOriginalMessage($user, $action, $object); + + /*************************************************** * * Classification and actions on ticket @@ -440,7 +454,8 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti /* * Ticket properties */ - print ''; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print '
'; print ''; print ''; // Category print ''; // Severity print ''; } print '
'; print $langs->trans('Properties'); @@ -496,31 +511,32 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti // Type print '
' . $langs->trans("Type") . ''; print $object->type_label; - if ($user->admin && !$noadmininfo) { + /*if ($user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); - } + }*/ print '
' . $langs->trans("Category") . ''; print $object->category_label; - if ($user->admin && !$noadmininfo) { + /*if ($user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); - } + }*/ print '
' . $langs->trans("TicketSeverity") . ''; print $object->severity_label; - if ($user->admin && !$noadmininfo) { + /*if ($user->admin && !$noadmininfo) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); - } + }*/ print '
'; // End table actions + print '
'; // Display navbar with links to change ticket status print ''; @@ -529,117 +545,120 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti } - print load_fiche_titre($langs->trans('Contacts'), '', 'title_companies.png'); + if (! empty($conf->global->TICKETSUP_SHOW_CONTACT_ON_MAIN_TAB)) + { + print load_fiche_titre($langs->trans('Contacts'), '', 'title_companies.png'); - print '
'; - print '
'; - print '
'; + print '
'; + print '
'; - print '
' . $langs->trans("Source") . '
-
' . $langs->trans("Company") . '
-
' . $langs->trans("Contacts") . '
-
' . $langs->trans("ContactType") . '
-
' . $langs->trans("Phone") . '
-
' . $langs->trans("Status") . '
'; - print '
'; + print '
'; + print '
' . $langs->trans("Source") . '
+
' . $langs->trans("Company") . '
+
' . $langs->trans("Contacts") . '
+
' . $langs->trans("ContactType") . '
+
' . $langs->trans("Phone") . '
+
' . $langs->trans("Status") . '
'; + print '
'; - // Contact list - $companystatic = new Societe($db); - $contactstatic = new Contact($db); - $userstatic = new User($db); - foreach (array('internal', 'external') as $source) { - $tmpobject = $object; - $tab = $tmpobject->listeContact(-1, $source); - $num = count($tab); - $i = 0; - while ($i < $num) { - $var = !$var; - print '
'; + // Contact list + $companystatic = new Societe($db); + $contactstatic = new Contact($db); + $userstatic = new User($db); + foreach (array('internal', 'external') as $source) { + $tmpobject = $object; + $tab = $tmpobject->listeContact(-1, $source); + $num = count($tab); + $i = 0; + while ($i < $num) { + $var = !$var; + print '
'; - print '
'; - if ($tab[$i]['source'] == 'internal') { - echo $langs->trans("User"); - } + print '
'; + if ($tab[$i]['source'] == 'internal') { + echo $langs->trans("User"); + } - if ($tab[$i]['source'] == 'external') { - echo $langs->trans("ThirdPartyContact"); - } + if ($tab[$i]['source'] == 'external') { + echo $langs->trans("ThirdPartyContact"); + } - print '
'; - print '
'; + print '
'; + print '
'; - if ($tab[$i]['socid'] > 0) { - $companystatic->fetch($tab[$i]['socid']); - echo $companystatic->getNomUrl(1); - } - if ($tab[$i]['socid'] < 0) { - echo $conf->global->MAIN_INFO_SOCIETE_NOM; - } - if (!$tab[$i]['socid']) { - echo ' '; - } - print '
'; + if ($tab[$i]['socid'] > 0) { + $companystatic->fetch($tab[$i]['socid']); + echo $companystatic->getNomUrl(1); + } + if ($tab[$i]['socid'] < 0) { + echo $conf->global->MAIN_INFO_SOCIETE_NOM; + } + if (!$tab[$i]['socid']) { + echo ' '; + } + print '
'; - print '
'; - if ($tab[$i]['source'] == 'internal') { - if ($userstatic->fetch($tab[$i]['id'])) { - print $userstatic->getNomUrl(1); - } - } - if ($tab[$i]['source'] == 'external') { - if ($contactstatic->fetch($tab[$i]['id'])) { - print $contactstatic->getNomUrl(1); - } - } - print '
-
' . $tab[$i]['libelle'] . '
'; + print '
'; + if ($tab[$i]['source'] == 'internal') { + if ($userstatic->fetch($tab[$i]['id'])) { + print $userstatic->getNomUrl(1); + } + } + if ($tab[$i]['source'] == 'external') { + if ($contactstatic->fetch($tab[$i]['id'])) { + print $contactstatic->getNomUrl(1); + } + } + print '
+
' . $tab[$i]['libelle'] . '
'; - print '
'; + print '
'; - print dol_print_phone($tab[$i]['phone'], '', '', '', AC_TEL).'
'; + print dol_print_phone($tab[$i]['phone'], '', '', '', AC_TEL).'
'; - if (! empty($tab[$i]['phone_perso'])) { - //print img_picto($langs->trans('PhonePerso'),'object_phoning.png','',0,0,0).' '; - print '
'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', AC_TEL).'
'; - } - if (! empty($tab[$i]['phone_mobile'])) { - //print img_picto($langs->trans('PhoneMobile'),'object_phoning.png','',0,0,0).' '; - print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', AC_TEL).'
'; - } - print '
'; + if (! empty($tab[$i]['phone_perso'])) { + //print img_picto($langs->trans('PhonePerso'),'object_phoning.png','',0,0,0).' '; + print '
'.dol_print_phone($tab[$i]['phone_perso'], '', '', '', AC_TEL).'
'; + } + if (! empty($tab[$i]['phone_mobile'])) { + //print img_picto($langs->trans('PhoneMobile'),'object_phoning.png','',0,0,0).' '; + print dol_print_phone($tab[$i]['phone_mobile'], '', '', '', AC_TEL).'
'; + } + print '
'; - print '
'; - if ($object->statut >= 0) { - echo ''; - } + print '
'; + if ($object->statut >= 0) { + echo ''; + } - if ($tab[$i]['source'] == 'internal') { - $userstatic->id = $tab[$i]['id']; - $userstatic->lastname = $tab[$i]['lastname']; - $userstatic->firstname = $tab[$i]['firstname']; - echo $userstatic->LibStatut($tab[$i]['statuscontact'], 3); - } - if ($tab[$i]['source'] == 'external') { - $contactstatic->id = $tab[$i]['id']; - $contactstatic->lastname = $tab[$i]['lastname']; - $contactstatic->firstname = $tab[$i]['firstname']; - echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3); - } - if ($object->statut >= 0) { - echo ''; - } + if ($tab[$i]['source'] == 'internal') { + $userstatic->id = $tab[$i]['id']; + $userstatic->lastname = $tab[$i]['lastname']; + $userstatic->firstname = $tab[$i]['firstname']; + echo $userstatic->LibStatut($tab[$i]['statuscontact'], 3); + } + if ($tab[$i]['source'] == 'external') { + $contactstatic->id = $tab[$i]['id']; + $contactstatic->lastname = $tab[$i]['lastname']; + $contactstatic->firstname = $tab[$i]['firstname']; + echo $contactstatic->LibStatut($tab[$i]['statuscontact'], 3); + } + if ($object->statut >= 0) { + echo ''; + } - print '
'; + print '
'; - print '
'; + print '
'; - $i++; - } + $i++; + } + } + + print '
'; + print '
'; } - print '
'; - print '
'; - // Contract if ($action == 'sel_contract') { if (!empty($conf->contrat->enabled)) { @@ -706,8 +725,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti print '
'; if ($action == 'view' || $action == 'edit_message_init') { - print '
' - . '
'; + print '
'; //print '
'; // Message list @@ -716,7 +734,6 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti $actionobject->viewTicketTimelineMessages($show_private_message, true, $object); print '
'; - print '
'; print '
'; } elseif ($action == 'add_message') { diff --git a/htdocs/ticketsup/class/actions_ticketsup.class.php b/htdocs/ticketsup/class/actions_ticketsup.class.php index 08c28ad3085..9a978e2e066 100644 --- a/htdocs/ticketsup/class/actions_ticketsup.class.php +++ b/htdocs/ticketsup/class/actions_ticketsup.class.php @@ -92,7 +92,7 @@ class ActionsTicketsup if (GETPOST('addfile')) { // altairis : allow files from public interface if (GETPOST('track_id')) { - $res = $object->fetch('', GETPOST('track_id','alpha')); + $res = $object->fetch('', '', GETPOST('track_id','alpha')); } ////if($res > 0) @@ -116,7 +116,7 @@ class ActionsTicketsup if (GETPOST('removedfile')) { // altairis : allow files from public interface if (GETPOST('track_id')) { - $res = $object->fetch('', GETPOST('track_id')); + $res = $object->fetch('', '', GETPOST('track_id','alpha')); } ////if($res > 0) @@ -309,7 +309,7 @@ class ActionsTicketsup } if ($action == "mark_ticket_read" && $user->rights->ticketsup->write) { - $object->fetch('', GETPOST("track_id")); + $object->fetch('', '', GETPOST("track_id",'alpha')); if ($object->markAsRead($user) > 0) { // Log action in ticket logs table @@ -328,22 +328,26 @@ class ActionsTicketsup $action = 'view'; } - if ($action == "assign_user" && GETPOST('btn_assign_user') && $user->rights->ticketsup->write) { - $object->fetch('', GETPOST("track_id")); - + if ($action == "assign_user" && GETPOST('btn_assign_user','aplha') && $user->rights->ticketsup->write) { + $object->fetch('', '', GETPOST("track_id",'alpha')); $useroriginassign = $object->fk_user_assign; - $usertoassign = GETPOST('fk_user_assign'); - if (!$usertoassign) { + $usertoassign = GETPOST('fk_user_assign','int'); + + /*if (! ($usertoassign > 0)) { $error++; array_push($this->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("UserAssignedTo"))); $action = 'view'; + }*/ + + if (!$error) + { + $ret = $object->assignUser($user, $usertoassign); + if ($ret < 0) $error++; } - if (!$error) { - $ret = $object->assignUser($user, $usertoassign); - - if ($ret) { - // Si déjà un user assigné on le supprime des contacts + if (! $error) // Update list of contacts + { + // Si déjà un user assigné on le supprime des contacts if ($useroriginassign > 0) { $internal_contacts = $object->listeContact(-1, 'internal'); @@ -356,9 +360,12 @@ class ActionsTicketsup } } } - $object->add_contact($usertoassign, "SUPPORTTEC", 'internal', $notrigger = 0); - } + if ($usertoassign > 0) $object->add_contact($usertoassign, "SUPPORTTEC", 'internal', $notrigger = 0); + } + + if (! $error) + { // Log action in ticket logs table $object->fetch_user($usertoassign); $log_action = $langs->trans('TicketLogAssignedTo', $object->user->getFullName($langs)); @@ -377,7 +384,7 @@ class ActionsTicketsup } if ($action == "change_property" && GETPOST('btn_update_ticket_prop') && $user->rights->ticketsup->write) { - $this->fetch('', GETPOST('track_id')); + $this->fetch('', '', GETPOST('track_id','alpha')); $fieldtomodify = GETPOST('property') . '_code'; $fieldtomodify_label = GETPOST('property') . '_label'; @@ -423,7 +430,7 @@ class ActionsTicketsup } if ($action == "confirm_close" && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticketsup->write) { - $this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')); + $this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); if ($object->close()) { // Log action in ticket logs table $log_action = $langs->trans('TicketLogClosedBy', $user->getFullName($langs)); @@ -442,7 +449,7 @@ class ActionsTicketsup } if ($action == "confirm_public_close" && GETPOST('confirm', 'alpha') == 'yes') { - $this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')); + $this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')); if (($_SESSION['email_customer'] == $object->origin_email || $_SESSION['email_customer'] == $object->thirdparty->email) && $object->close()) { // Log action in ticket logs table $log_action = $langs->trans('TicketLogClosedBy', $_SESSION['email_customer']); @@ -461,7 +468,7 @@ class ActionsTicketsup } if ($action == 'confirm_delete_ticket' && GETPOST('confirm', 'alpha') == "yes" && $user->rights->ticketsup->delete) { - if ($this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { + if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { if ($object->delete($user) > 0) { setEventMessages('
' . $langs->trans('TicketDeletedSuccess') . '
', null, 'mesgs'); Header("Location: ".DOL_URL_ROOT."/ticketsup/list.php"); @@ -476,7 +483,7 @@ class ActionsTicketsup // Set parent company if ($action == 'set_thirdparty' && $user->rights->societe->creer) { - if ($this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { + if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { $result = $object->setCustomer(GETPOST('editcustomer', 'int')); $url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha'); header("Location: " . $url); @@ -485,7 +492,7 @@ class ActionsTicketsup } if ($action == 'set_progression' && $user->rights->ticketsup->write) { - if ($this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { + if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { $result = $object->setProgression(GETPOST('progress')); // Log action in ticket logs table $log_action = $langs->trans('TicketLogProgressSetTo', GETPOST('progress')); @@ -517,7 +524,7 @@ class ActionsTicketsup } if ($action == "set_extrafields" && GETPOST('btn_edit_extrafields') && $user->rights->ticketsup->write && !GETPOST('cancel')) { - $res = $this->fetch('', GETPOST('track_id')); + $res = $this->fetch('', '', GETPOST('track_id','alpha')); $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); @@ -534,7 +541,7 @@ class ActionsTicketsup $action = 'view'; } // Reopen ticket elseif ($action == 'confirm_reopen' && $user->rights->ticketsup->manage && !GETPOST('cancel')) { - if ($this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { + if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { // prevent browser refresh from reopening ticket several times if ($object->fk_statut == 8) { $res = $object->setStatut(4); @@ -550,7 +557,7 @@ class ActionsTicketsup } } // Categorisation dans projet elseif ($action == 'classin' && $user->rights->ticketsup->write) { - if ($this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { + if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { $object->setProject(GETPOST('projectid')); $url = 'card.php?action=view&track_id=' . $object->track_id; header("Location: " . $url); @@ -558,7 +565,7 @@ class ActionsTicketsup } } // Categorisation dans contrat elseif ($action == 'setcontract' && $user->rights->ticketsup->write) { - if ($this->fetch(GETPOST('id', 'int'), GETPOST('track_id', 'alpha')) >= 0) { + if ($this->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { $object->setContract(GETPOST('contractid')); $url = 'card.php?action=view&track_id=' . $object->track_id; header("Location: " . $url); @@ -567,7 +574,7 @@ class ActionsTicketsup } elseif ($action == "set_message" && $user->rights->ticketsup->manage) { // altairis: manage cancel button if (!GETPOST('cancel')) { - $this->fetch('', GETPOST('track_id')); + $this->fetch('', '', GETPOST('track_id','alpha')); $oldvalue_message = $object->message; $fieldtomodify = GETPOST('message_initial'); @@ -627,7 +634,7 @@ class ActionsTicketsup $error = 0; $object = new Ticketsup($this->db); - $ret = $object->fetch('', GETPOST('track_id')); + $ret = $object->fetch('', '', GETPOST('track_id','alpha')); $object->socid = $object->fk_soc; $object->fetch_thirdparty(); if ($ret < 0) { @@ -833,7 +840,7 @@ class ActionsTicketsup global $mysoc, $conf, $langs; $error = 0; - $ret = $object->fetch('', GETPOST('track_id')); + $ret = $object->fetch('', '', GETPOST('track_id','alpha')); $object->socid = $object->fk_soc; $object->fetch_thirdparty(); if ($ret < 0) { @@ -969,14 +976,14 @@ class ActionsTicketsup * Fetch object * * @param int $id ID of ticket - * @param int $track_id Track ID of ticket (for public area) * @param string $ref Reference of ticket + * @param string $track_id Track ID of ticket (for public area) * @return void */ - public function fetch($id = 0, $track_id = 0, $ref = '') + public function fetch($id = 0, $ref = '', $track_id = '') { $this->getInstanceDao(); - return $this->dao->fetch($id, $track_id, $ref); + return $this->dao->fetch($id, $ref, $track_id); } /** @@ -1000,7 +1007,7 @@ class ActionsTicketsup public function getInfo($id) { $this->getInstanceDao(); - $this->dao->fetch($id, $track_id); + $this->dao->fetch($id, '', $track_id); $this->label = $this->dao->label; $this->description = $this->dao->description; @@ -1140,10 +1147,12 @@ class ActionsTicketsup /** * Show ticket original message * - * @param User $user $user wich display - * @param string $action Action mode + * @param User $user User wich display + * @param string $action Action mode + * @param TicketSup $object Object ticket + * @return void */ - public function viewTicketOriginalMessage($user, $action = '') + public function viewTicketOriginalMessage($user, $action, $object) { global $langs; if (!empty($user->rights->ticketsup->manage) && $action == 'edit_message_init') { @@ -1151,16 +1160,18 @@ class ActionsTicketsup print '
'; print ''; - print ''; + print ''; print ''; } // Initial message - print ''; + print '
'; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table + print '
'; print ''; @@ -1169,20 +1180,20 @@ class ActionsTicketsup print ''; print ''; @@ -1202,14 +1213,15 @@ class ActionsTicketsup public function viewTicketMessages($show_private, $show_user = true) { global $conf, $langs, $user, $bc; + global $object; // Load logs in cache - $ret = $this->dao->loadCacheMsgsTicket(); + $ret = $object->loadCacheMsgsTicket(); $action = GETPOST('action'); $this->viewTicketOriginalMessage($user, $action); - if (is_array($this->dao->cache_msgs_ticket) && count($this->dao->cache_msgs_ticket) > 0) { + if (is_array($object->cache_msgs_ticket) && count($object->cache_msgs_ticket) > 0) { print_titre($langs->trans('TicketMailExchanges')); print '
'; print '' . $langs->trans("InitialMessage") . ' '; if ($user->rights->ticketsup->manage) { - print '' . img_edit($langs->trans('Modify')) . ' ' . $langs->trans('Modify') . ''; + print '' . img_edit($langs->trans('Modify')) . ' ' . $langs->trans('Modify') . ''; } print '
'; if (!empty($user->rights->ticketsup->manage) && $action == 'edit_message_init') { // MESSAGE - $msg = GETPOST('message_initial', 'alpha') ? GETPOST('message_initial', 'alpha') : $this->dao->message; + $msg = GETPOST('message_initial', 'alpha') ? GETPOST('message_initial', 'alpha') : $object->message; include_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; $uselocalbrowser = true; $doleditor = new DolEditor('message_initial', $msg, '100%', 250, 'dolibarr_details', 'In', true, $uselocalbrowser); $doleditor->Create(); } else { // Deal with format differences (text / HTML) - if (dol_textishtml($this->dao->message)) { - print $this->dao->message; + if (dol_textishtml($object->message)) { + print $object->message; } else { - print dol_nl2br($this->dao->message); + print dol_nl2br($object->message); } - //print '
' . $this->dao->message . '
'; + //print '
' . $object->message . '
'; } print '
'; @@ -1226,7 +1238,7 @@ class ActionsTicketsup print ''; } - foreach ($this->dao->cache_msgs_ticket as $id => $arraymsgs) { + foreach ($object->cache_msgs_ticket as $id => $arraymsgs) { if (!$arraymsgs['private'] || ($arraymsgs['private'] == "1" && $show_private) ) { @@ -1331,7 +1343,7 @@ class ActionsTicketsup function load_previous_next_ref($filter, $fieldid) { $this->getInstanceDao(); - return $this->dao->load_previous_next_ref($filter, $fieldid); + return $object->load_previous_next_ref($filter, $fieldid); } /** @@ -1361,8 +1373,8 @@ class ActionsTicketsup // If no receiver defined, load all ticket linked contacts if (!is_array($array_receiver) || !count($array_receiver) > 0) { - $array_receiver = $this->dao->getInfosTicketInternalContact(); - $array_receiver = array_merge($array_receiver, $this->dao->getInfosTicketExternalContact()); + $array_receiver = $object->getInfosTicketInternalContact(); + $array_receiver = array_merge($array_receiver, $object->getInfosTicketExternalContact()); } if ($send_internal_cc) { @@ -1424,7 +1436,7 @@ class ActionsTicketsup */ public function copyFilesForTicket() { - global $conf; + global $conf, $object; // Create form object include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; @@ -1444,7 +1456,7 @@ class ActionsTicketsup $mimetype = $attachedfiles['mimes']; // Copy files into ticket directory - $destdir = $conf->ticketsup->dir_output . '/' . $this->dao->track_id; + $destdir = $conf->ticketsup->dir_output . '/' . $object->track_id; if (!dol_is_dir($destdir)) { dol_mkdir($destdir); @@ -1492,8 +1504,10 @@ class ActionsTicketsup if (!in_array($status, $exclude_status)) { print '
'; - if ($object->fk_statut == Ticketsup::STATUS_READ || $status == Ticketsup::STATUS_READ|| empty($object->date_read)) $urlforbutton = $_SERVER['PHP_SELF'] . '?track_id=' . $object->track_id . '&action=mark_ticket_read'; // To set as read, we use a dedicated action - else $urlforbutton = $_SERVER['PHP_SELF'] . '?track_id=' . $object->track_id . '&action=set_status&new_status=' . $status; + if ($status == 1) + $urlforbutton = $_SERVER['PHP_SELF'] . '?track_id=' . $object->track_id . '&action=mark_ticket_read'; // To set as read, we use a dedicated action + else + $urlforbutton = $_SERVER['PHP_SELF'] . '?track_id=' . $object->track_id . '&action=set_status&new_status=' . $status; print ''; print img_picto($langs->trans($object->statuts_short[$status]), 'statut' . $status . '.png@ticketsup') . ' ' . $langs->trans($object->statuts_short[$status]); diff --git a/htdocs/ticketsup/class/api_ticketsups.class.php b/htdocs/ticketsup/class/api_ticketsups.class.php index bda05dd589c..ee696b34505 100644 --- a/htdocs/ticketsup/class/api_ticketsups.class.php +++ b/htdocs/ticketsup/class/api_ticketsups.class.php @@ -90,7 +90,7 @@ class Ticketsups extends DolibarrApi throw new RestException(401, 'Wrong parameters'); } - $result = $this->ticketsup->fetch($id, $track_id, $ref); + $result = $this->ticketsup->fetch($id, $ref, $track_id); if (! $result) { throw new RestException(404, 'Ticketsup not found'); } @@ -344,7 +344,7 @@ class Ticketsups extends DolibarrApi $this->ticketsup->$field = $value; } $ticketMessageText = $this->ticketsup->message; - $result = $this->ticketsup->fetch('', $this->ticketsup->track_id); + $result = $this->ticketsup->fetch('', '', $this->ticketsup->track_id); if (! $result) { throw new RestException(404, 'Ticketsup not found'); } diff --git a/htdocs/ticketsup/class/ticketsup.class.php b/htdocs/ticketsup/class/ticketsup.class.php index 584f9508f6d..ced9ad3ff73 100644 --- a/htdocs/ticketsup/class/ticketsup.class.php +++ b/htdocs/ticketsup/class/ticketsup.class.php @@ -174,9 +174,9 @@ class Ticketsup extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-2, 'enabled'=>0, 'position'=>20, 'notnull'=>1, 'index'=>1), 'track_id' => array('type'=>'varchar(255)', 'label'=>'TrackID', 'visible'=>0, 'enabled'=>1, 'position'=>30, 'notnull'=>-1, 'searchall'=>1, 'help'=>"Help text"), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty"), + 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>1, 'enabled'=>1, 'position'=>49, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), + 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty"), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToProject"), - 'origin_email' => array('type'=>'mail', 'label'=>'OriginEmail', 'visible'=>1, 'enabled'=>1, 'position'=>11, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object"), 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>510, 'notnull'=>1), 'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AuthorAssign', 'visible'=>1, 'enabled'=>1, 'position'=>510, 'notnull'=>1), 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>12, 'notnull'=>-1, 'searchall'=>1, 'help'=>""), @@ -427,12 +427,12 @@ class Ticketsup extends CommonObject /** * Load object in memory from the database * - * @param int $id Id object - * @return int <0 if KO, >0 if OK + * @param int $id Id object + * @param string $ref Ref + * @param string $track_id Track id, a hash like ref + * @return int <0 if KO, >0 if OK */ - - // possible to change the order of value, standard welcome is = id, ref, track_id ??? - public function fetch($id = '', $track_id = '', $ref = '') + public function fetch($id = '', $ref = '', $track_id = '') { global $langs; @@ -524,15 +524,7 @@ class Ticketsup extends CommonObject $this->date_close = $this->db->jdate($obj->date_close); $this->tms = $this->db->jdate($obj->tms); - if (!class_exists('ExtraFields')) { - include_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; - } - - $extrafields = new ExtraFields($this->db); - $extralabels = $extrafields->fetch_name_optionals_label($this->table_element, true); - if (count($extralabels) > 0) { - $this->fetch_optionals($this->id, $extralabels); - } + $this->fetch_optionals(); } $this->db->free($resql); @@ -1318,43 +1310,71 @@ class Ticketsup extends CommonObject } } + /** - * Return clickable link to object + * Return a link to the object card (with optionaly the picto) * - * @param int $withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul - * @param string $option Sur quoi pointe le lien - * @return string Chaine avec URL + * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto) + * @param string $option On what the link point to ('nolink', ...) + * @param int $notooltip 1=Disable tooltip + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @return string String with URL */ - public function getNomUrl($withpicto = 0, $option = '') + function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1) { - global $langs; + global $db, $conf, $langs; + global $dolibarr_main_authentication, $dolibarr_main_demo; + global $menumanager; - $result = ''; + if (! empty($conf->dol_no_mouse_hover)) $notooltip=1; // Force disable tooltips - $lien = ''; - $lienfin = ''; + $result = ''; + $companylink = ''; - $picto = 'ticketsup'; - if (!$this->public) { - $picto = 'ticketsup'; - } + $label = '' . $langs->trans("ShowTicket") . ''; + $label.= '
'; + $label.= '' . $langs->trans('Ref') . ': ' . $this->ref.'
'; + $label.= '' . $langs->trans('TrackID') . ': ' . $this->track_id.'
'; + $label.= '' . $langs->trans('Subject') . ': ' . $this->subject; - $label = $langs->trans("ShowTicket") . ': ' . $this->ref . ' - ' . $this->subject; - if ($withpicto) { - $result .= ($lien . img_object($label, $picto) . $lienfin); - } + $url = dol_buildpath('/ticketsup/card.php',1).'?id='.$this->id; - if ($withpicto && $withpicto != 2) { - $result .= ' '; - } + if ($option != 'nolink') + { + // Add param to save lastsearch_values or not + $add_save_lastsearch_values=($save_lastsearch_value == 1 ? 1 : 0); + if ($save_lastsearch_value == -1 && preg_match('/list\.php/',$_SERVER["PHP_SELF"])) $add_save_lastsearch_values=1; + if ($add_save_lastsearch_values) $url.='&save_lastsearch_values=1'; + } - if ($withpicto != 2) { - $result .= $lien . $this->ref . ' - ' . dol_trunc($this->subject) . $lienfin; - } + $linkclose=''; + if (empty($notooltip)) + { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowTicket"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.=' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.=' class="classfortooltip'.($morecss?' '.$morecss:'').'"'; + } + else $linkclose = ($morecss?' class="'.$morecss.'"':''); - return $result; + $linkstart = ''; + $linkend=''; + + $result .= $linkstart; + if ($withpicto) $result.=img_object(($notooltip?'':$label), ($this->picto?$this->picto:'generic'), ($notooltip?(($withpicto != 2) ? 'class="paddingright"' : ''):'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip?0:1); + if ($withpicto != 2) $result.= $this->ref; + $result .= $linkend; + //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : ''); + + return $result; } + /** * Mark a message as read * @@ -1404,60 +1424,63 @@ class Ticketsup extends CommonObject } } - /** - * Mark a message as read - * - * @param User $user Object user - * @param int $id_assign_user ID of user assigned - * @param int $notrigger Disable trigger - * @return int <0 if KO, 0=Nothing done, >0 if OK - */ - public function assignUser($user, $id_assign_user, $notrigger = 0) - { - global $conf, $langs; + /** + * Mark a message as read + * + * @param User $user Object user + * @param int $id_assign_user ID of user assigned + * @param int $notrigger Disable trigger + * @return int <0 if KO, 0=Nothing done, >0 if OK + */ + public function assignUser($user, $id_assign_user, $notrigger = 0) + { + global $conf, $langs; - if ($id_assign_user > 0) { - $this->db->begin(); + $this->db->begin(); - $sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup"; - $sql .= " SET fk_user_assign=" . $id_assign_user; - $sql .= " , fk_statut=4"; - $sql .= " WHERE rowid = " . $this->id; + $sql = "UPDATE " . MAIN_DB_PREFIX . "ticketsup"; + if ($id_assign_user > 0) + { + $sql .= " SET fk_user_assign=".$id_assign_user.", fk_statut=4"; + } + else + { + $sql .= " SET fk_user_assign=null, fk_statut=1"; + } + $sql .= " WHERE rowid = " . $this->id; - dol_syslog(get_class($this) . "::assignUser sql=" . $sql); - $resql = $this->db->query($sql); - if ($resql) - { - $this->fk_user_assign = $id_assign_user; // May be used by trigger + dol_syslog(get_class($this) . "::assignUser sql=" . $sql); + $resql = $this->db->query($sql); + if ($resql) { + $this->fk_user_assign = $id_assign_user; // May be used by trigger - if (!$notrigger) { - // Call trigger - $result=$this->call_trigger('TICKET_ASSIGNED', $user); - if ($result < 0) { - $error++; - } - // End call triggers - } + if (! $notrigger) { + // Call trigger + $result = $this->call_trigger('TICKET_ASSIGNED', $user); + if ($result < 0) { + $error ++; + } + // End call triggers + } - if (!$error) { - $this->db->commit(); - return 1; - } else { - $this->db->rollback(); - $this->error = join(',', $this->errors); - dol_syslog(get_class($this) . "::assignUser " . $this->error, LOG_ERR); - return -1; - } - } else { - $this->db->rollback(); - $this->error = $this->db->lasterror(); - dol_syslog(get_class($this) . "::assignUser " . $this->error, LOG_ERR); - return -1; - } - } + if (! $error) { + $this->db->commit(); + return 1; + } else { + $this->db->rollback(); + $this->error = join(',', $this->errors); + dol_syslog(get_class($this) . "::assignUser " . $this->error, LOG_ERR); + return - 1; + } + } else { + $this->db->rollback(); + $this->error = $this->db->lasterror(); + dol_syslog(get_class($this) . "::assignUser " . $this->error, LOG_ERR); + return - 1; + } - return 0; - } + return 0; + } /** * Create log for the ticket diff --git a/htdocs/ticketsup/contact.php b/htdocs/ticketsup/contact.php index 5dceabe9476..8199b6c84a5 100644 --- a/htdocs/ticketsup/contact.php +++ b/htdocs/ticketsup/contact.php @@ -70,7 +70,7 @@ $object = new Ticketsup($db); */ if ($action == 'addcontact' && $user->rights->ticketsup->write) { - $result = $object->fetch($id, $track_id); + $result = $object->fetch($id, '', $track_id); if ($result > 0 && ($id > 0 || (!empty($track_id)))) { $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); @@ -92,7 +92,7 @@ if ($action == 'addcontact' && $user->rights->ticketsup->write) { // bascule du statut d'un contact if ($action == 'swapstatut' && $user->rights->ticketsup->write) { - if ($object->fetch($id, $track_id)) { + if ($object->fetch($id, '', $track_id)) { $result = $object->swapContactStatus($ligne); } else { dol_print_error($db, $object->error); @@ -101,7 +101,7 @@ if ($action == 'swapstatut' && $user->rights->ticketsup->write) { // Efface un contact if ($action == 'deletecontact' && $user->rights->ticketsup->write) { - if ($object->fetch($id, $track_id)) { + if ($object->fetch($id, '', $track_id)) { $result = $object->delete_contact($lineid); if ($result >= 0) { @@ -129,7 +129,7 @@ $userstatic = new User($db); /* *************************************************************************** */ if ($id > 0 || !empty($track_id) || !empty($ref)) { - if ($object->fetch($id, $track_id, $ref) > 0) + if ($object->fetch($id, $ref, $track_id) > 0) { if ($socid > 0) { $object->fetch_thirdparty(); diff --git a/htdocs/ticketsup/document.php b/htdocs/ticketsup/document.php index 94348e1054c..cadb6731bfd 100644 --- a/htdocs/ticketsup/document.php +++ b/htdocs/ticketsup/document.php @@ -64,7 +64,7 @@ if (!$sortfield) { } $object = new Ticketsup($db); -$result = $object->fetch($id, $track_id, $ref); +$result = $object->fetch($id, $ref, $track_id); // to match document rules and compatibility $old_ref = $object->ref; diff --git a/htdocs/ticketsup/history.php b/htdocs/ticketsup/history.php index 56f8e95fe0b..4dda4c919e8 100644 --- a/htdocs/ticketsup/history.php +++ b/htdocs/ticketsup/history.php @@ -57,7 +57,7 @@ if (!$action) { } $object = new Ticketsup($db); -$object->fetch($id, $track_id, $ref); +$object->fetch($id, $ref, $track_id); /* @@ -83,7 +83,7 @@ $form = new Form($db); $formticket = new FormTicketsup($db); if ($action == 'view') { - $res = $object->fetch($id, $track_id, $ref); + $res = $object->fetch($id, $ref, $track_id); if ($res > 0) { // restrict access for externals users From 6e52c896f2b245aacdf8cc4635a36c525c10bf1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 10:46:42 +0100 Subject: [PATCH 10/53] Dolibarrize module ticket --- htdocs/comm/action/list.php | 42 +++++++++++++++---------------- htdocs/core/lib/company.lib.php | 35 +++++++++++++++----------- htdocs/core/lib/ticketsup.lib.php | 2 +- htdocs/ticketsup/card.php | 2 +- 4 files changed, 44 insertions(+), 37 deletions(-) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 6f938f3d6bd..9a4e3dcdb36 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -32,10 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; -$langs->load("users"); -$langs->load("companies"); -$langs->load("agenda"); -$langs->load("commercial"); +$langs->loadLangs(array("users","companies","agenda","commercial")); $action=GETPOST('action','alpha'); $resourceid=GETPOST("resourceid","int"); @@ -57,6 +54,7 @@ else $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } if ($actioncode == '' && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); +$search_id=GETPOST('search_id','alpha'); $search_title=GETPOST('search_title','alpha'); $dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth','int'), GETPOST('dateselectday','int'), GETPOST('dateselectyear','int')); @@ -170,7 +168,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers { //$actioncode=''; - $search_title=''; + $search_id=''; + $search_title=''; $datestart=''; $dateend=''; $status=''; @@ -199,24 +198,25 @@ llxHeader('',$langs->trans("Agenda"),$help_url); $listofextcals=array(); $param=''; -if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; -if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit); if ($actioncode != '') { if(is_array($actioncode)) { - foreach($actioncode as $str_action) $param.="&actioncode[]=".$str_action; - } else $param.="&actioncode=".$actioncode; + foreach($actioncode as $str_action) $param.="&actioncode[]=".urlencode($str_action); + } else $param.="&actioncode=".urlencode($actioncode); } -if ($resourceid > 0) $param.="&resourceid=".$resourceid; -if ($status != '' && $status > -1) $param.="&status=".$status; -if ($filter) $param.="&filter=".$filter; -if ($filtert) $param.="&filtert=".$filtert; -if ($socid) $param.="&socid=".$socid; +if ($resourceid > 0) $param.="&resourceid=".urlencode($resourceid); +if ($status != '' && $status > -1) $param.="&status=".urlencode($status); +if ($filter) $param.="&filter=".urlencode($filter); +if ($filtert) $param.="&filtert=".urlencode($filtert); +if ($socid) $param.="&socid=".urlencode($socid); if ($showbirthday) $param.="&showbirthday=1"; -if ($pid) $param.="&projectid=".$pid; -if ($type) $param.="&type=".$type; -if ($usergroup) $param.="&usergroup=".$usergroup; -if ($optioncss != '') $param.='&optioncss='.$optioncss; -if ($search_title != '') $param.='&search_title='.$search_title; +if ($pid) $param.="&projectid=".urlencode($pid); +if ($type) $param.="&type=".urlencode($type); +if ($usergroup) $param.="&usergroup=".urlencode($usergroup); +if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); +if ($search_id != '') $param.='&search_title='.urlencode($search_id); +if ($search_title != '') $param.='&search_title='.urlencode($search_title); if (GETPOST('datestartday','int')) $param.='&datestartday='.GETPOST('datestartday','int'); if (GETPOST('datestartmonth','int')) $param.='&datestartmonth='.GETPOST('datestartmonth','int'); if (GETPOST('datestartyear','int')) $param.='&datestartyear='.GETPOST('datestartyear','int'); @@ -293,6 +293,7 @@ if ($status == '50') { $sql.= " AND (a.percent > 0 AND a.percent < 100)"; } // R if ($status == '100') { $sql.= " AND a.percent = 100"; } if ($status == 'done' || $status == '100') { $sql.= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))"; } if ($status == 'todo') { $sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))"; } +if ($search_id) $sql.=natural_search("a.id", $search_id, 1); if ($search_title) $sql.=natural_search("a.label", $search_title); // We must filter on assignement table if ($filtert > 0 || $usergroup > 0) @@ -421,7 +422,7 @@ if ($resql) print '
'."\n"; print ''; - if (! empty($arrayfields['a.id']['checked'])) print ''; + if (! empty($arrayfields['a.id']['checked'])) print ''; if (! empty($arrayfields['owner']['checked'])) print ''; if (! empty($arrayfields['c.libelle']['checked'])) print ''; if (! empty($arrayfields['a.label']['checked'])) print ''; @@ -492,7 +493,6 @@ if ($resql) $caction=new CActionComm($db); $arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1); - $var=true; while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 6e056971c0d..e00a63d195e 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1530,10 +1530,17 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'maxwidthsearch '); $out.=''; + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; + $caction=new CActionComm($db); + $arraylist=$caction->liste_array(1, 'code', '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), '', 1); + foreach ($histo as $key=>$value) { $actionstatic->fetch($histo[$key]['id']); // TODO Do we need this, we already have a lot of data of line into $histo + $actionstatic->type_picto=$histo[$key]['apicto']; + $actionstatic->type_code=$histo[$key]['acode']; + $out.=''; // Done or todo @@ -1564,26 +1571,26 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $out.=''; // Title $out.=''; print ''; } + $i = 0; while ($i < $num && $i < $MAXLIST) { - $contrat=new Contrat($db); - $objp = $db->fetch_object($resql); + $contrat->id=$objp->id; + $contrat->ref=$objp->ref?$objp->ref:$objp->id; + $contrat->ref_customer=$objp->refcus; + $contrat->ref_supplier=$objp->refsup; + print ''; print '\n"; print '\n"; @@ -946,12 +947,11 @@ if ($object->id > 0) $sql.= " AND f.entity = ".$conf->entity; $sql.= " ORDER BY f.tms DESC"; - $fichinter_static=new Fichinter($db); - $resql=$db->query($sql); if ($resql) { - $var=true; + $fichinter_static=new Fichinter($db); + $num = $db->num_rows($resql); if ($num > 0) { @@ -962,8 +962,8 @@ if ($object->id > 0) print ''; print '
'; if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { - if ($histo[$key]['apicto']) $out.=img_picto('', $histo[$key]['apicto']); + if ($actionstatic->type_picto) print img_picto('', $actionstatic->type_picto); else { - if ($histo[$key]['acode'] == 'AC_TEL') $out.=img_picto('', 'object_phoning').' '; - if ($histo[$key]['acode'] == 'AC_FAX') $out.=img_picto('', 'object_phoning_fax').' '; - if ($histo[$key]['acode'] == 'AC_EMAIL') $out.=img_picto('', 'object_email').' '; + if ($actionstatic->type_code == 'AC_RDV') $out.= img_picto('', 'object_group', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actionstatic->type_code == 'AC_TEL') $out.= img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actionstatic->type_code == 'AC_FAX') $out.= img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actionstatic->type_code == 'AC_EMAIL') $out.= img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright').' '; + elseif ($actionstatic->type_code == 'AC_INT') $out.= img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright').' '; + elseif (! preg_match('/_AUTO/', $actionstatic->type_code)) $out.= img_picto('', 'object_action', '', false, 0, 0, '', 'paddingright').' '; } - $out.=$actionstatic->type; - } - else { - $typelabel = $actionstatic->type; - if ($histo[$key]['acode'] != 'AC_OTH_AUTO') $typelabel = $langs->trans("ActionAC_MANUAL"); - $out.=$typelabel; } + $labeltype=$actionstatic->type_code; + if (empty($conf->global->AGENDA_USE_EVENT_TYPE) && empty($arraylist[$labeltype])) $labeltype='AC_OTH'; + if (! empty($arraylist[$labeltype])) $labeltype=$arraylist[$labeltype]; + $out.= dol_trunc($labeltype,28); $out.=''; if (isset($histo[$key]['type']) && $histo[$key]['type']=='action') { - $actionstatic->type_code=$histo[$key]['acode']; $transcode=$langs->trans("Action".$histo[$key]['acode']); $libelle=($transcode!="Action".$histo[$key]['acode']?$transcode:$histo[$key]['alabel']); //$actionstatic->libelle=$libelle; @@ -1635,7 +1642,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $propalstatic->type=$histo[$key]['ftype']; $out.=$propalstatic->getNomUrl(1); } else { - $out.= $langs->trans("ProposalDeleted"); + //$out.= ''.$langs->trans("ProposalDeleted").''; } } elseif (($histo[$key]['elementtype'] == 'order' || $histo[$key]['elementtype'] == 'commande') && ! empty($conf->commande->enabled)) @@ -1646,7 +1653,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $orderstatic->type=$histo[$key]['ftype']; $out.=$orderstatic->getNomUrl(1); } else { - $out.= $langs->trans("OrderDeleted"); + //$out.= ''.$langs->trans("OrderDeleted").''; } } elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled)) @@ -1657,7 +1664,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $facturestatic->type=$histo[$key]['ftype']; $out.=$facturestatic->getNomUrl(1,'compta'); } else { - $out.= $langs->trans("InvoiceDeleted"); + //$out.= ''.$langs->trans("InvoiceDeleted").''; } } else $out.=' '; diff --git a/htdocs/core/lib/ticketsup.lib.php b/htdocs/core/lib/ticketsup.lib.php index 68f8d820116..040dad6c656 100644 --- a/htdocs/core/lib/ticketsup.lib.php +++ b/htdocs/core/lib/ticketsup.lib.php @@ -104,7 +104,7 @@ function ticketsup_prepare_head($object) // History $head[$h][0] = DOL_URL_ROOT.'/ticketsup/history.php?track_id=' . $object->track_id; - $head[$h][1] = $langs->trans('TicketHistory'); + $head[$h][1] = $langs->trans('Events'); $head[$h][2] = 'tabTicketLogs'; $h++; diff --git a/htdocs/ticketsup/card.php b/htdocs/ticketsup/card.php index 0a8d57e7a7b..556ab3da79d 100644 --- a/htdocs/ticketsup/card.php +++ b/htdocs/ticketsup/card.php @@ -545,7 +545,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti } - if (! empty($conf->global->TICKETSUP_SHOW_CONTACT_ON_MAIN_TAB)) + if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { print load_fiche_titre($langs->trans('Contacts'), '', 'title_companies.png'); From 9e4a66b1a9c53863d1ffdf2c507184dcbee5b264 Mon Sep 17 00:00:00 2001 From: fappels Date: Thu, 22 Mar 2018 10:46:54 +0100 Subject: [PATCH 11/53] Fix hidden oprion PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION --- htdocs/product/class/product.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ec831b91458..e36d5970e8f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1225,7 +1225,7 @@ class Product extends CommonObject $sql2.= " SET "; $sql2.= " label='".$this->db->escape($this->label)."',"; $sql2.= " description='".$this->db->escape($this->description)."'"; - if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", note='".$this->db->escape($this->note)."'"; + if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", note='".$this->db->escape($this->other)."'"; $sql2.= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'"; } else @@ -1235,7 +1235,7 @@ class Product extends CommonObject $sql2.= ")"; $sql2.= " VALUES(".$this->id.",'".$this->db->escape($key)."','". $this->db->escape($this->label)."',"; $sql2.= " '".$this->db->escape($this->description)."'"; - if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", '".$this->db->escape($this->note)."'"; + if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", '".$this->db->escape($this->other)."'"; $sql2.= ")"; } dol_syslog(get_class($this).'::setMultiLangs key = current_lang = '.$key); @@ -1260,7 +1260,7 @@ class Product extends CommonObject $sql2.= " SET "; $sql2.= " label='".$this->db->escape($this->multilangs["$key"]["label"])."',"; $sql2.= " description='".$this->db->escape($this->multilangs["$key"]["description"])."'"; - if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", note='".$this->db->escape($this->multilangs["$key"]["note"])."'"; + if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", note='".$this->db->escape($this->multilangs["$key"]["other"])."'"; $sql2.= " WHERE fk_product=".$this->id." AND lang='".$this->db->escape($key)."'"; } else @@ -1270,7 +1270,7 @@ class Product extends CommonObject $sql2.= ")"; $sql2.= " VALUES(".$this->id.",'".$this->db->escape($key)."','". $this->db->escape($this->multilangs["$key"]["label"])."',"; $sql2.= " '".$this->db->escape($this->multilangs["$key"]["description"])."'"; - if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", '".$this->db->escape($this->note)."'"; + if (! empty($conf->global->PRODUCT_USE_OTHER_FIELD_IN_TRANSLATION)) $sql2.= ", '".$this->db->escape($this->multilangs["$key"]["other"])."'"; $sql2.= ")"; } From 3765bc4775b4dc5a1d4397ae644d210ec514b1e2 Mon Sep 17 00:00:00 2001 From: fappels Date: Thu, 22 Mar 2018 10:48:03 +0100 Subject: [PATCH 12/53] Fix html escape for edit label --- htdocs/product/traduction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index fd13aee1ea2..d0740f7cd71 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -251,7 +251,7 @@ if ($action == 'edit') print '
'; print ''; - print ''; + print ''; print ''; // User assigned - print ''; print ''; - + // Assign a Name print ''; print ''; print ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 931ee953a86..62834b1271c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1819,9 +1819,10 @@ class Societe extends CommonObject * Return array of sales representatives * * @param User $user Object user + * @param int $mode 0=Array with properties, 1=Array of id. * @return array Array of sales representatives of third party */ - function getSalesRepresentatives(User $user) + function getSalesRepresentatives(User $user, $mode=0) { global $conf; @@ -1849,14 +1850,22 @@ class Societe extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $reparray[$i]['id']=$obj->rowid; - $reparray[$i]['lastname']=$obj->lastname; - $reparray[$i]['firstname']=$obj->firstname; - $reparray[$i]['email']=$obj->email; - $reparray[$i]['statut']=$obj->statut; - $reparray[$i]['entity']=$obj->entity; - $reparray[$i]['login']=$obj->login; - $reparray[$i]['photo']=$obj->photo; + + if (empty($mode)) + { + $reparray[$i]['id']=$obj->rowid; + $reparray[$i]['lastname']=$obj->lastname; + $reparray[$i]['firstname']=$obj->firstname; + $reparray[$i]['email']=$obj->email; + $reparray[$i]['statut']=$obj->statut; + $reparray[$i]['entity']=$obj->entity; + $reparray[$i]['login']=$obj->login; + $reparray[$i]['photo']=$obj->photo; + } + else + { + $reparray[]=$obj->rowid; + } $i++; } return $reparray; @@ -3921,22 +3930,22 @@ class Societe extends CommonObject } /** - * Sets company to supplied users. + * Sets sales representatives of the thirdparty * - * @param int[]|int $users User ID or array of user IDs + * @param int[]|int $salesrep User ID or array of user IDs * @return int <0 if KO, >0 if OK */ public function setSalesRep($salesrep) { global $user; - + // Handle single user if (!is_array($salesrep)) { $salesrep = array($salesrep); } // Get current users - $existing = $this->get_users(); + $existing = $this->getSalesRepresentatives($user, 1); // Diff if (is_array($existing)) { @@ -3966,26 +3975,6 @@ class Societe extends CommonObject return $error ? -1 : 1; } - - /** - * Get all linked user to company - * - * @return Array - */ - public function get_users() { - $sql = 'SELECT fk_user FROM '.MAIN_DB_PREFIX.'societe_commerciaux '; - $sql.= 'WHERE fk_soc = '.$this->id; - - $resql = $this->db->query($sql); - - $users = array(); - - while ($obj = $this->db->fetch_object($resql)) { - $users[] = $obj->fk_user; - } - - return $users; - } /** From b5f37301a5a10933b34390766ef003f9a5473ed3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 22 Mar 2018 16:18:11 +0100 Subject: [PATCH 23/53] Fix: uniformize getEntity('intervention') --- .../class/api_interventions.class.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 23 ++++++++----------- htdocs/fichinter/index.php | 16 ++++++------- htdocs/fichinter/list.php | 4 ++-- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 2cfe14c7197..d840b13ec58 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -124,7 +124,7 @@ class Interventions extends DolibarrApi if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale - $sql.= ' WHERE t.entity IN ('.getEntity('fichinter').')'; + $sql.= ' WHERE t.entity IN ('.getEntity('intervention').')'; if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc"; if ($socids) $sql.= " AND t.fk_soc IN (".$socids.")"; if ($search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 6ee279d2015..4dee1f94f24 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -128,7 +128,7 @@ class Fichinter extends CommonObject $sql.= " WHERE sc.fk_user = " .$user->id; $clause = "AND"; } - $sql.= " ".$clause." fi.entity IN (".getEntity($this->element).")"; + $sql.= " ".$clause." fi.entity IN (".getEntity('intervention').")"; $resql=$this->db->query($sql); if ($resql) @@ -348,7 +348,10 @@ class Fichinter extends CommonObject $sql.= " f.tms as datem,"; $sql.= " f.duree, f.fk_projet, f.note_public, f.note_private, f.model_pdf, f.extraparams, fk_contrat"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; - if ($ref) $sql.= " WHERE f.ref='".$this->db->escape($ref)."'"; + if ($ref) { + $sql.= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql.= " AND f.ref='".$this->db->escape($ref)."'"; + } else $sql.= " WHERE f.rowid=".$rowid; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); @@ -783,7 +786,6 @@ class Fichinter extends CommonObject $sql.= " f.fk_user_valid"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= " WHERE f.rowid = ".$id; - $sql.= " AND f.entity = ".$conf->entity; $resql = $this->db->query($sql); if ($resql) @@ -887,7 +889,6 @@ class Fichinter extends CommonObject // Delete object $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinter"; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; dol_syslog("Fichinter::delete", LOG_DEBUG); $resql = $this->db->query($sql); @@ -951,7 +952,6 @@ class Fichinter extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter "; $sql.= " SET datei = '".$this->db->idate($date_delivery)."'"; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; $sql.= " AND fk_statut = 0"; if ($this->db->query($sql)) @@ -985,7 +985,6 @@ class Fichinter extends CommonObject $sql.= " SET description = '".$this->db->escape($description)."',"; $sql.= " fk_user_modif = ".$user->id; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; if ($this->db->query($sql)) { @@ -1018,7 +1017,6 @@ class Fichinter extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."fichinter "; $sql.= " SET fk_contrat = '".$contractid."'"; $sql.= " WHERE rowid = ".$this->id; - $sql.= " AND entity = ".$conf->entity; if ($this->db->query($sql)) { @@ -1401,7 +1399,7 @@ class FichinterLigne extends CommonObjectLine if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $this->id=$this->rowid; + $this->id=$this->id; $result=$this->insertExtraFields(); if ($result < 0) { @@ -1463,7 +1461,7 @@ class FichinterLigne extends CommonObjectLine $sql.= ",date='".$this->db->idate($this->datei)."'"; $sql.= ",duree=".$this->duration; $sql.= ",rang='".$this->db->escape($this->rang)."'"; - $sql.= " WHERE rowid = ".$this->rowid; + $sql.= " WHERE rowid = ".$this->id; dol_syslog("FichinterLigne::update", LOG_DEBUG); $resql=$this->db->query($sql); @@ -1472,7 +1470,7 @@ class FichinterLigne extends CommonObjectLine if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used { - $this->id=$this->rowid; + $this->id=$this->id; $result=$this->insertExtraFields(); if ($result < 0) { @@ -1541,7 +1539,6 @@ class FichinterLigne extends CommonObjectLine $sql.= " , dateo = ".(! empty($obj->dateo)?"'".$this->db->idate($obj->dateo)."'":"null"); $sql.= " , datee = ".(! empty($obj->datee)?"'".$this->db->idate($obj->datee)."'":"null"); $sql.= " WHERE rowid = ".$this->fk_fichinter; - $sql.= " AND entity = ".$conf->entity; dol_syslog("FichinterLigne::update_total", LOG_DEBUG); $resql=$this->db->query($sql); @@ -1580,10 +1577,10 @@ class FichinterLigne extends CommonObjectLine if ($this->statut == 0) { - dol_syslog(get_class($this)."::deleteline lineid=".$this->rowid); + dol_syslog(get_class($this)."::deleteline lineid=".$this->id); $this->db->begin(); - $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->rowid; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet WHERE rowid = ".$this->id; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index d7cae075eb1..1a4068f5911 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -81,8 +81,8 @@ $sql = "SELECT count(f.rowid), f.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."fichinter as f"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= " AND f.entity IN (".getEntity('societe').")"; +$sql.= " WHERE f.entity IN (".getEntity('intervention').")"; +$sql.= " AND f.fk_soc = s.rowid"; if ($user->societe_id) $sql.=' AND f.fk_soc = '.$user->societe_id; if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " GROUP BY f.fk_statut"; @@ -180,8 +180,8 @@ if (! empty($conf->ficheinter->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity IN (".getEntity('intervention').")"; + $sql.= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.fk_statut = 0"; if ($socid) $sql.= " AND f.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -228,8 +228,8 @@ $sql.= " s.nom as name, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f,"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; -$sql.= " WHERE f.fk_soc = s.rowid"; -$sql.= " AND f.entity IN (".getEntity('commande').")"; +$sql.= " WHERE f.entity IN (".getEntity('intervention').")"; +$sql.= " AND f.fk_soc = s.rowid"; //$sql.= " AND c.fk_statut > 2"; if ($socid) $sql .= " AND f.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; @@ -299,8 +299,8 @@ if (! empty($conf->ficheinter->enabled)) $sql.=" FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE f.fk_soc = s.rowid"; - $sql.= " AND f.entity IN (".getEntity('intervention').")"; + $sql.= " WHERE f.entity IN (".getEntity('intervention').")"; + $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.fk_statut = 1"; if ($socid) $sql.= " AND f.fk_soc = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 49cb1837d35..d9f2097a5bf 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -194,8 +194,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; -$sql.= " WHERE f.fk_soc = s.rowid "; -$sql.= " AND f.entity = ".$conf->entity; +$sql.= " WHERE f.entity IN (".getEntity('intervention').")"; +$sql.= " AND f.fk_soc = s.rowid"; if ($search_ref) { $sql .= natural_search('f.ref', $search_ref); } From 9cf66e53f671c8d3ebeb28fc743ace7e78de9b63 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 22 Mar 2018 16:39:47 +0100 Subject: [PATCH 24/53] Fix: wrong module name --- htdocs/core/lib/company.lib.php | 2 +- htdocs/user/param_ihm.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 3f7c45dda52..c7b75521a59 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -167,7 +167,7 @@ function societe_prepare_head(Societe $object) } // Related items - if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->fichinter->enabled) || ! empty($conf->fournisseur->enabled)) + if (! empty($conf->commande->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->fournisseur->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; $head[$h][1] = $langs->trans("Referers"); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 81e8996aff2..64913683276 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -162,7 +162,7 @@ if (! empty($conf->societe->enabled)) $tmparray['societe/index.php?mainmenu=comp if (! empty($conf->projet->enabled)) $tmparray['projet/index.php?mainmenu=project&leftmenu=']='ProjectsArea'; if (! empty($conf->holiday->enabled) || ! empty($conf->expensereport->enabled)) $tmparray['hrm/index.php?mainmenu=hrm&leftmenu=']='HRMArea'; // TODO Complete list with first level of menus if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) $tmparray['product/index.php?mainmenu=products&leftmenu=']='ProductsAndServicesArea'; -if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->fichinter->enabled) || ! empty($conf->contrat->enabled)) $tmparray['comm/index.php?mainmenu=commercial&leftmenu=']='CommercialArea'; +if (! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) || ! empty($conf->ficheinter->enabled) || ! empty($conf->contrat->enabled)) $tmparray['comm/index.php?mainmenu=commercial&leftmenu=']='CommercialArea'; if (! empty($conf->compta->enabled) || ! empty($conf->accounting->enabled)) $tmparray['compta/index.php?mainmenu=compta&leftmenu=']='AccountancyTreasuryArea'; if (! empty($conf->adherent->enabled)) $tmparray['adherents/index.php?mainmenu=members&leftmenu=']='MembersArea'; if (! empty($conf->agenda->enabled)) $tmparray['comm/action/index.php?mainmenu=agenda&leftmenu=']='Agenda'; From 72cedcf9f3f7d854ad76d19930077734cd92e2e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 18:01:06 +0100 Subject: [PATCH 25/53] Removed method fetch_prods() and get_each_prod() not used, keep only get_arbo_each_prod() that is better. --- ChangeLog | 2 +- htdocs/commande/class/commande.class.php | 4 +-- htdocs/product/class/product.class.php | 44 ++---------------------- 3 files changed, 5 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index bfa1f0d3d5e..10c0c98c625 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,7 +17,7 @@ Following changes may create regressions for some external modules, but were nec * PHP 5.3 is no more supported. Minimum PHP is now 5.4+ * Remove the old deprecated code of doActions and getInstanceDao in canvas. The doActions of standard hooks are already available and are better. - +* Removed method fetch_prods() and get_each_prod() not used, keep only get_arbo_each_prod() that is better. ***** ChangeLog for 7.0.1 compared to 7.0.0 ***** diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 15c4a9d94de..dd0e41ee836 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1530,8 +1530,8 @@ class Commande extends CommonOrder { $prod = new Product($this->db); $prod->fetch($idproduct); - $prod -> get_sousproduits_arbo (); - $prods_arbo = $prod->get_each_prod(); + $prod -> get_sousproduits_arbo(); + $prods_arbo = $prod->get_arbo_each_prod(); if(count($prods_arbo) > 0) { foreach($prods_arbo as $key => $value) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 403b9b7e6ca..6dbf49f69ef 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3303,28 +3303,8 @@ class Product extends CommonObject } /** - * fonction recursive uniquement utilisee par get_each_prod, ajoute chaque sousproduits dans le tableau res - * - * @param array $prod Products array - * @return void - */ - function fetch_prods($prod) - { - $this->res; - foreach($prod as $nom_pere => $desc_pere) - { - // on est dans une sous-categorie - if(is_array($desc_pere)) - $this->res[]= array($desc_pere[1],$desc_pere[0]); - if(count($desc_pere) >1) - { - $this->fetch_prods($desc_pere); - } - } - } - - /** - * reconstruit l'arborescence des produits sous la forme d'un tableau + * Build the tree of subproducts into an array + * this->sousprods is loaded by this->get_sousproduits_arbo() * * @param int $multiply Because each sublevel must be multiplicated by parent nb * @return array $this->res @@ -3343,26 +3323,6 @@ class Product extends CommonObject return $this->res; } - /** - * Renvoie tous les sousproduits dans le tableau res, chaque ligne de res contient : id -> qty - * - * @return array $this->res - */ - function get_each_prod() - { - $this->res = array(); - if (is_array($this->sousprods)) - { - foreach($this->sousprods as $nom_pere => $desc_pere) - { - if (count($desc_pere) >1) $this->fetch_prods($desc_pere); - } - sort($this->res); - } - return $this->res; - } - - /** * Return all parent products for current product (first level only) * From 171ad5dce2c4fc1bb9883455c79db9c2334ebb25 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 21:42:19 +0100 Subject: [PATCH 26/53] Enhance code for template invoices --- .../facture/class/facture-rec.class.php | 72 ++++++++++++++----- htdocs/core/class/commonobject.class.php | 22 +++--- 2 files changed, 66 insertions(+), 28 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 630433324c4..8759f2eebf3 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -68,6 +68,13 @@ class FactureRec extends CommonInvoice var $usenewprice=0; + var $suspended; // status + + const STATUS_NOTSUSPENDED = 0; + const STATUS_SUSPENDED = 1; + + + /** * Constructor * @@ -95,6 +102,7 @@ class FactureRec extends CommonInvoice // Clean parameters $this->titre=trim($this->titre); $this->usenewprice=empty($this->usenewprice)?0:$this->usenewprice; + if (empty($this->suspended)) $this->suspended=0; // No frequency defined then no next date to execution if (empty($this->frequency)) @@ -147,6 +155,7 @@ class FactureRec extends CommonInvoice $sql.= ", fk_multicurrency"; $sql.= ", multicurrency_code"; $sql.= ", multicurrency_tx"; + $sql.= ", suspended"; $sql.= ") VALUES ("; $sql.= "'".$this->db->escape($this->titre)."'"; $sql.= ", ".$facsrc->socid; @@ -167,13 +176,14 @@ class FactureRec extends CommonInvoice $sql.= ", '".$this->db->escape($this->unit_frequency)."'"; $sql.= ", ".(!empty($this->date_when)?"'".$this->db->idate($this->date_when)."'":'NULL'); $sql.= ", ".(!empty($this->date_last_gen)?"'".$this->db->idate($this->date_last_gen)."'":'NULL'); - $sql.= ", ".$this->nb_gen_done; - $sql.= ", ".$this->nb_gen_max; - $sql.= ", ".$this->auto_validate; - $sql.= ", ".$this->generate_pdf; - $sql.= ", ".$facsrc->fk_multicurrency; - $sql.= ", '".$facsrc->multicurrency_code."'"; - $sql.= ", ".$facsrc->multicurrency_tx; + $sql.= ", ".$this->db->escape($this->nb_gen_done); + $sql.= ", ".$this->db->escape($this->nb_gen_max); + $sql.= ", ".$this->db->escape($this->auto_validate); + $sql.= ", ".$this->db->escape($this->generate_pdf); + $sql.= ", ".$this->db->escape($facsrc->fk_multicurrency); + $sql.= ", '".$this->db->escape($facsrc->multicurrency_code)."'"; + $sql.= ", ".$this->db->escape($facsrc->multicurrency_tx); + $sql.= ", ".$this->db->escape($this->suspended); $sql.= ")"; if ($this->db->query($sql)) @@ -1149,49 +1159,69 @@ class FactureRec extends CommonInvoice $prefix=''; if ($recur) { - if ($status == 1) return $langs->trans('Disabled'); // credit note + if ($status == self::STATUS_SUSPENDED) return $langs->trans('Disabled'); else return $langs->trans('Active'); } - else return $langs->trans("Draft"); + else + { + if ($status == self::STATUS_SUSPENDED) return $langs->trans('Disabled'); + else return $langs->trans("Draft"); + } } if ($mode == 1) { $prefix='Short'; if ($recur) { - if ($status == 1) return $langs->trans('Disabled'); + if ($status == self::STATUS_SUSPENDED) return $langs->trans('Disabled'); else return $langs->trans('Active'); } - else return $langs->trans("Draft"); + else + { + if ($status == self::STATUS_SUSPENDED) return $langs->trans('Disabled'); + else return $langs->trans("Draft"); + } } if ($mode == 2) { if ($recur) { - if ($status == 1) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled'); + if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled'); else return img_picto($langs->trans('Active'),'statut4').' '.$langs->trans('Active'); } - else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft'); + else + { + if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled'); + else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft'); + } } if ($mode == 3) { if ($recur) { $prefix='Short'; - if ($status == 1) return img_picto($langs->trans('Disabled'),'statut6'); + if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6'); else return img_picto($langs->trans('Active'),'statut4'); } - else return img_picto($langs->trans('Draft'),'statut0'); + else + { + if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6'); + else return img_picto($langs->trans('Draft'),'statut0'); + } } if ($mode == 4) { $prefix=''; if ($recur) { - if ($status == 1) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled'); + if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled'); else return img_picto($langs->trans('Active'),'statut4').' '.$langs->trans('Active'); } - else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft'); + else + { + if ($status == self::STATUS_SUSPENDED) return img_picto($langs->trans('Disabled'),'statut6').' '.$langs->trans('Disabled'); + else return img_picto($langs->trans('Draft'),'statut0').' '.$langs->trans('Draft'); + } } if ($mode == 5 || $mode == 6) { @@ -1199,10 +1229,14 @@ class FactureRec extends CommonInvoice if ($mode == 5) $prefix='Short'; if ($recur) { - if ($status == 1) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut6'); + if ($status == self::STATUS_SUSPENDED) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut6'); else return ''.$langs->trans('Active').' '.img_picto($langs->trans('Active'),'statut4'); } - else return $langs->trans('Draft').' '.img_picto($langs->trans('Active'),'statut0'); + else + { + if ($status == self::STATUS_SUSPENDED) return ''.$langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut6'); + else return $langs->trans('Draft').' '.img_picto($langs->trans('Active'),'statut0'); + } } } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index d80c67a8aeb..f92b80570b6 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2841,7 +2841,6 @@ abstract class CommonObject $sql.= " ".$clause." (fk_target = ".$targetid." AND targettype = '".$targettype."')"; } $sql .= ' ORDER BY sourcetype'; - //print $sql; dol_syslog(get_class($this)."::fetchObjectLink", LOG_DEBUG); $resql = $this->db->query($sql); @@ -3086,9 +3085,10 @@ abstract class CommonObject * @param int $status Status to set * @param int $elementId Id of element to force (use this->id by default) * @param string $elementType Type of element to force (use this->table_element by default) + * @param string $trigkey Trigger key to use for trigger * @return int <0 if KO, >0 if OK */ - function setStatut($status,$elementId=null,$elementType='') + function setStatut($status, $elementId=null, $elementType='', $trigkey='') { global $user,$langs,$conf; @@ -3100,6 +3100,7 @@ abstract class CommonObject $this->db->begin(); $fieldstatus="fk_statut"; + if ($elementTable == 'facture_rec') $fieldstatus="suspended"; if ($elementTable == 'mailing') $fieldstatus="statut"; if ($elementTable == 'cronjob') $fieldstatus="status"; if ($elementTable == 'user') $fieldstatus="statut"; @@ -3117,13 +3118,16 @@ abstract class CommonObject { $error = 0; - $trigkey=''; - if ($this->element == 'supplier_proposal' && $status == 2) $trigkey='SUPPLIER_PROPOSAL_SIGN'; // 2 = SupplierProposal::STATUS_SIGNED. Can't use constant into this generic class - if ($this->element == 'supplier_proposal' && $status == 3) $trigkey='SUPPLIER_PROPOSAL_REFUSE'; // 3 = SupplierProposal::STATUS_REFUSED. Can't use constant into this generic class - if ($this->element == 'supplier_proposal' && $status == 4) $trigkey='SUPPLIER_PROPOSAL_CLOSE'; // 4 = SupplierProposal::STATUS_CLOSED. Can't use constant into this generic class - if ($this->element == 'fichinter' && $status == 3) $trigkey='FICHINTER_CLASSIFY_DONE'; - if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED'; - if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED'; + // Try autoset of trigkey + if (empty($trigkey)) + { + if ($this->element == 'supplier_proposal' && $status == 2) $trigkey='SUPPLIER_PROPOSAL_SIGN'; // 2 = SupplierProposal::STATUS_SIGNED. Can't use constant into this generic class + if ($this->element == 'supplier_proposal' && $status == 3) $trigkey='SUPPLIER_PROPOSAL_REFUSE'; // 3 = SupplierProposal::STATUS_REFUSED. Can't use constant into this generic class + if ($this->element == 'supplier_proposal' && $status == 4) $trigkey='SUPPLIER_PROPOSAL_CLOSE'; // 4 = SupplierProposal::STATUS_CLOSED. Can't use constant into this generic class + if ($this->element == 'fichinter' && $status == 3) $trigkey='FICHINTER_CLASSIFY_DONE'; + if ($this->element == 'fichinter' && $status == 2) $trigkey='FICHINTER_CLASSIFY_BILLED'; + if ($this->element == 'fichinter' && $status == 1) $trigkey='FICHINTER_CLASSIFY_UNBILLED'; + } if ($trigkey) { From 9f67bb0aa3b42048a3c58ba6a247f51bdbe317c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 21:58:24 +0100 Subject: [PATCH 27/53] Start 6.0.7 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 660e81e7ee6..7f5b0f5e746 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.6'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','6.0.7'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From 46d2b4d62dcd84884d2eb6caaf7db2118f1abb0c Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 22 Mar 2018 23:25:54 +0100 Subject: [PATCH 28/53] fix security check on fourn card --- htdocs/fourn/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index d99df78c27c..9a9cdd190a9 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -50,7 +50,7 @@ $cancelbutton = GETPOST('cancel'); // Security check $id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int')); if ($user->societe_id) $id=$user->societe_id; -$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe'); +$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe', '', 'rowid'); $object = new Fournisseur($db); $extrafields = new ExtraFields($db); @@ -107,7 +107,7 @@ if (empty($reshook)) // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); - + if ($ret < 0) $error++; if (! $error) { From 715852569b94aaff981239c296131b5b9405af71 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 23 Mar 2018 10:42:36 +0100 Subject: [PATCH 29/53] NEW add printUserListWhere hook --- htdocs/user/class/user.class.php | 13 +++++++++++-- htdocs/user/home.php | 13 +++++++++++-- htdocs/user/index.php | 7 ++++++- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index f3c8f03329f..a32ec07b648 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2744,7 +2744,11 @@ class User extends CommonObject */ function get_full_tree($deleteafterid=0, $filter='') { - global $conf,$user; + global $conf, $user; + global $hookmanager; + + // Actions hooked (by external module) + $hookmanager->initHooks(array('userdao')); $this->users = array(); @@ -2754,7 +2758,11 @@ class User extends CommonObject // Init $this->users array $sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.admin, u.statut, u.photo, u.entity"; // Distinct reduce pb with old tables with duplicates $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; - // TODO add hook + // Add fields from hooks + $parameters=array(); + $reshook=$hookmanager->executeHooks('printUserListWhere',$parameters); // Note that $action and $object may have been modified by hook + $sql.=$hookmanager->resPrint; + /* if (! empty($conf->multicompany->enabled)) { if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { if (! empty($user->admin) && empty($user->entity)) { @@ -2774,6 +2782,7 @@ class User extends CommonObject } else { $sql.= " WHERE u.entity IN (".getEntity('user').")"; } + */ if ($filter) $sql.=" AND ".$filter; dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG); diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 0a4cb253c0f..d8659a5e93c 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -46,6 +46,10 @@ if ($user->societe_id > 0) $socid = $user->societe_id; $companystatic = new Societe($db); $fuserstatic = new User($db); +// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array +$contextpage=array('userhome'); +$hookmanager->initHooks($contextpage); + /* * View @@ -101,7 +105,11 @@ $sql.= ", s.code_client"; $sql.= ", s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; -// TODO add hook +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printUserListWhere',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; +/* if (! empty($conf->multicompany->enabled)) { if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { if (! empty($user->admin) && empty($user->entity)) { @@ -121,6 +129,7 @@ if (! empty($conf->multicompany->enabled)) { } else { $sql.= " WHERE u.entity IN (".getEntity('user').")"; } +*/ if (!empty($socid)) $sql.= " AND u.fk_soc = ".$socid; $sql.= $db->order("u.datec","DESC"); $sql.= $db->plimit($max); @@ -225,7 +234,7 @@ if ($canreadperms) $sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec"; $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g"; - if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && ! $user->entity))) + if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && ! $user->entity))) { $sql.= " WHERE g.entity IS NOT NULL"; } diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 704c04d2593..4cf5969668e 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -191,7 +191,11 @@ $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user_extrafields as ef on (u.rowid = ef.fk_object)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; -// TODO add hook +// Add fields from hooks +$parameters=array(); +$reshook=$hookmanager->executeHooks('printUserListWhere',$parameters); // Note that $action and $object may have been modified by hook +$sql.=$hookmanager->resPrint; +/* if (! empty($conf->multicompany->enabled)) { if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { if (! empty($user->admin) && empty($user->entity)) { @@ -211,6 +215,7 @@ if (! empty($conf->multicompany->enabled)) { } else { $sql.= " WHERE u.entity IN (".getEntity('user').")"; } +*/ if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid; //if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); if ($search_supervisor > 0) $sql.= " AND u.fk_user IN (".$db->escape($search_supervisor).")"; From f330c5ad3263bb16094c9f3dc68a84e5c5517355 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 23 Mar 2018 10:52:10 +0100 Subject: [PATCH 30/53] Fix: better compatibility --- htdocs/user/class/user.class.php | 21 ++------------------- htdocs/user/home.php | 21 ++------------------- htdocs/user/index.php | 21 ++------------------- 3 files changed, 6 insertions(+), 57 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a32ec07b648..bf9ff370e11 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2761,28 +2761,11 @@ class User extends CommonObject // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printUserListWhere',$parameters); // Note that $action and $object may have been modified by hook - $sql.=$hookmanager->resPrint; - /* - if (! empty($conf->multicompany->enabled)) { - if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - if (! empty($user->admin) && empty($user->entity)) { - if ($conf->entity == 1) { - $sql.= " WHERE u.entity IS NOT NULL"; - } else { - $sql.= " WHERE u.entity IN (".getEntity('user').")"; - } - } else { - $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE ug.fk_user = u.rowid"; - $sql.= " AND ug.entity IN (".getEntity('user').")"; - } - } else { - $sql.= " WHERE u.entity IN (".getEntity('user').")"; - } + if ($reshook > 0) { + $sql.=$hookmanager->resPrint; } else { $sql.= " WHERE u.entity IN (".getEntity('user').")"; } - */ if ($filter) $sql.=" AND ".$filter; dol_syslog(get_class($this)."::get_full_tree get user list", LOG_DEBUG); diff --git a/htdocs/user/home.php b/htdocs/user/home.php index d8659a5e93c..ac14f6b0243 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -108,28 +108,11 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_soc = s.rowid"; // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printUserListWhere',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -/* -if (! empty($conf->multicompany->enabled)) { - if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - if (! empty($user->admin) && empty($user->entity)) { - if ($conf->entity == 1) { - $sql.= " WHERE u.entity IS NOT NULL"; - } else { - $sql.= " WHERE u.entity IN (".getEntity('user').")"; - } - } else { - $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE ug.fk_user = u.rowid"; - $sql.= " AND ug.entity IN (".getEntity('user').")"; - } - } else { - $sql.= " WHERE u.entity IN (".getEntity('user').")"; - } +if ($reshook > 0) { + $sql.=$hookmanager->resPrint; } else { $sql.= " WHERE u.entity IN (".getEntity('user').")"; } -*/ if (!empty($socid)) $sql.= " AND u.fk_soc = ".$socid; $sql.= $db->order("u.datec","DESC"); $sql.= $db->plimit($max); diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 4cf5969668e..4d83903d0aa 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -194,28 +194,11 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid"; // Add fields from hooks $parameters=array(); $reshook=$hookmanager->executeHooks('printUserListWhere',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -/* -if (! empty($conf->multicompany->enabled)) { - if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) { - if (! empty($user->admin) && empty($user->entity)) { - if ($conf->entity == 1) { - $sql.= " WHERE u.entity IS NOT NULL"; - } else { - $sql.= " WHERE u.entity IN (".getEntity('user').")"; - } - } else { - $sql.= ",".MAIN_DB_PREFIX."usergroup_user as ug"; - $sql.= " WHERE ug.fk_user = u.rowid"; - $sql.= " AND ug.entity IN (".getEntity('user').")"; - } - } else { - $sql.= " WHERE u.entity IN (".getEntity('user').")"; - } +if ($reshook > 0) { + $sql.=$hookmanager->resPrint; } else { $sql.= " WHERE u.entity IN (".getEntity('user').")"; } -*/ if ($socid > 0) $sql.= " AND u.fk_soc = ".$socid; //if ($search_user != '') $sql.=natural_search(array('u.login', 'u.lastname', 'u.firstname'), $search_user); if ($search_supervisor > 0) $sql.= " AND u.fk_user IN (".$db->escape($search_supervisor).")"; From 2fb0fc39a50b0243db5893f375ae1f97f4409b3e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 23 Mar 2018 11:07:35 +0100 Subject: [PATCH 31/53] Fix: Parameter must be an array or an object that implements Countable --- htdocs/ticketsup/class/ticketsup.class.php | 6 +++--- htdocs/ticketsup/index.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/ticketsup/class/ticketsup.class.php b/htdocs/ticketsup/class/ticketsup.class.php index e201f1ab5bd..60edf6471ad 100644 --- a/htdocs/ticketsup/class/ticketsup.class.php +++ b/htdocs/ticketsup/class/ticketsup.class.php @@ -1038,7 +1038,7 @@ class Ticketsup extends CommonObject { global $langs; - if (count($this->cache_types_tickets)) { + if (! empty($this->cache_types_tickets) && count($this->cache_types_tickets)) { return 0; } // Cache deja charge @@ -1078,7 +1078,7 @@ class Ticketsup extends CommonObject { global $langs; - if (count($this->cache_category_tickets)) { + if (! empty($this->cache_types_tickets) && count($this->cache_category_tickets)) { return 0; } // Cache deja charge @@ -1118,7 +1118,7 @@ class Ticketsup extends CommonObject { global $langs; - if (count($this->cache_severity_tickets)) { + if (! empty($this->cache_types_tickets) && count($this->cache_severity_tickets)) { return 0; } // Cache deja charge diff --git a/htdocs/ticketsup/index.php b/htdocs/ticketsup/index.php index 8881b8c3ad2..b98a81f204e 100644 --- a/htdocs/ticketsup/index.php +++ b/htdocs/ticketsup/index.php @@ -215,7 +215,7 @@ print ''; if (empty($strictw3c)) print ''; print "\n"; - $var=true; $listofparam=array(); - foreach($tableau as $const) // Loop on each param + foreach($tableau as $key => $const) // Loop on each param { + // $const is a const key like 'MYMODULE_ABC' + if (is_numeric($key)) { + $type = 'string'; + } + else + { + $type = $const; + $const = $key; + } + $sql = "SELECT "; $sql.= "rowid"; $sql.= ", ".$db->decrypt('name')." as name"; @@ -1355,7 +1365,7 @@ function form_constantes($tableau, $strictw3c=0, $helptext='') $sql.= ", type"; $sql.= ", note"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; - $sql.= " WHERE ".$db->decrypt('name')." = '".$const."'"; + $sql.= " WHERE ".$db->decrypt('name')." = '".$db->escape($const)."'"; $sql.= " AND entity IN (0, ".$conf->entity.")"; $sql.= " ORDER BY name ASC, entity DESC"; $result = $db->query($sql); @@ -1365,23 +1375,26 @@ function form_constantes($tableau, $strictw3c=0, $helptext='') { $obj = $db->fetch_object($result); // Take first result of select - - // For avoid warning in strict mode - if (empty($obj)) { - $obj = (object) array('rowid'=>'','name'=>'','value'=>'','type'=>'','note'=>''); + if (empty($obj)) // If not yet into table + { + $obj = (object) array('rowid'=>'','name'=>$const,'value'=>'','type'=>$type,'note'=>''); } - if (empty($strictw3c)) print "\n".''; + if (empty($strictw3c)) + { + print "\n".''; + print ''; + } print ''; // Show constant print ''; } else { print ''; } diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index f3369d58582..0ffe195fb6d 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -83,34 +83,7 @@ class modAdherent extends DolibarrModules $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "ADHERENT_MAIL_RESIL"; - $this->const[$r][1] = "texte"; - $this->const[$r][2] = "Votre adhésion vient d'être résiliée.\r\nNous espérons vous revoir très bientôt"; - $this->const[$r][3] = "Mail de résiliation"; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "ADHERENT_MAIL_VALID"; - $this->const[$r][1] = "texte"; - $this->const[$r][2] = "Votre adhésion vient d'être validée. \r\nVoici le rappel de vos coordonnées (toute information erronée entrainera la non validation de votre inscription) :\r\n\r\n__INFOS__\r\n\r\n"; - $this->const[$r][3] = "Mail de validation"; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "ADHERENT_MAIL_VALID_SUBJECT"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "Votre adhésion a été validée"; - $this->const[$r][3] = "Sujet du mail de validation"; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "ADHERENT_MAIL_RESIL_SUBJECT"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "Résiliation de votre adhésion"; - $this->const[$r][3] = "Sujet du mail de résiliation"; - $this->const[$r][4] = 0; - $r++; - + // For emails $this->const[$r][0] = "ADHERENT_MAIL_FROM"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = ""; @@ -118,20 +91,35 @@ class modAdherent extends DolibarrModules $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "ADHERENT_MAIL_COTIS"; - $this->const[$r][1] = "texte"; - $this->const[$r][2] = "Bonjour __FIRSTNAME__,\r\nCet email confirme que votre cotisation a été reçue\r\net enregistrée"; - $this->const[$r][3] = "Mail de validation de cotisation"; + $this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER"; + $this->const[$r][1] = "emailtemplate:member"; + $this->const[$r][2] = "(SendingEmailOnAutoSubscription)"; + $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "ADHERENT_MAIL_COTIS_SUBJECT"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "Reçu de votre cotisation"; - $this->const[$r][3] = "Sujet du mail de validation de cotisation"; + $this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION"; + $this->const[$r][1] = "emailtemplate:member"; + $this->const[$r][2] = "(SendingEmailOnNewSubscription)"; + $this->const[$r][3] = ""; $this->const[$r][4] = 0; $r++; + $this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION"; + $this->const[$r][1] = "emailtemplate:member"; + $this->const[$r][2] = "(SendingReminderForExpiredSubscription)"; + $this->const[$r][3] = ""; + $this->const[$r][4] = 0; + $r++; + + $this->const[$r][0] = "ADHERENT_EMAIL_TEMPLATE_CANCELATION"; + $this->const[$r][1] = "emailtemplate:member"; + $this->const[$r][2] = "(SendingEmailOnCancelation)"; + $this->const[$r][3] = ""; + $this->const[$r][4] = 0; + $r++; + + // For cards $this->const[$r][0] = "ADHERENT_CARD_HEADER_TEXT"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "__YEAR__"; @@ -160,20 +148,6 @@ class modAdherent extends DolibarrModules $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "ADHERENT_BANK_ACCOUNT"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = ""; - $this->const[$r][3] = "ID du Compte banquaire utilise"; - $this->const[$r][4] = 0; - $r++; - - $this->const[$r][0] = "ADHERENT_BANK_CATEGORIE"; - $this->const[$r][1] = "chaine"; - $this->const[$r][2] = ""; - $this->const[$r][3] = "ID de la catégorie bancaire des cotisations"; - $this->const[$r][4] = 0; - $r++; - $this->const[$r][0] = "ADHERENT_ETIQUETTE_TYPE"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "L7163"; @@ -188,6 +162,22 @@ class modAdherent extends DolibarrModules $this->const[$r][4] = 0; $r++; + // For subscriptions + $this->const[$r][0] = "ADHERENT_BANK_ACCOUNT"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = ""; + $this->const[$r][3] = "ID of bank account to use"; + $this->const[$r][4] = 0; + $r++; + + $this->const[$r][0] = "ADHERENT_BANK_CATEGORIE"; + $this->const[$r][1] = "chaine"; + $this->const[$r][2] = ""; + $this->const[$r][3] = "ID of bank transaction category to use"; + $this->const[$r][4] = 0; + $r++; + + // Boxes //------- $this->boxes = array(0=>array('file'=>'box_members.php','enabledbydefaulton'=>'Home')); diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index ad8d8ffd199..0f6c76cb1b1 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -20,9 +20,13 @@ -- de l'install et tous les sigles '--' sont supprimés. -- -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__','__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendReminderForExpiredSubscriptionTitle)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null); - INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,1,0,'__(YourSEPAMandate)__','__(Hello)__,

\n\n__(FindYourSEPAMandate)__ :
\n__MYCOMPANY_NAME__
\n__MYCOMPANY_FULLADDRESS__

\n__(Sincerely)__
\n__USER_SIGNATURE__',null); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__INFOS__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); + diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index e6296bb8eae..c19530acd01 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -197,7 +197,7 @@ ALTER TABLE llx_c_email_templates ADD COLUMN enabled varchar(255) DEFAULT '1'; ALTER TABLE llx_c_email_templates ADD COLUMN joinfiles varchar(255) DEFAULT '1'; ALTER TABLE llx_c_email_templates MODIFY COLUMN content mediumtext; -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'__(CardContent)__','__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)',1,1,1,'__(CardContent)__','__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'banque','thirdparty','',0,null,null,'(YourSEPAMandate)',1,1,0,'__(YourSEPAMandate)__','__(Hello)__,

\n\n__(FindYourSEPAMandate)__ :
\n__MYCOMPANY_NAME__
\n__MYCOMPANY_FULLADDRESS__

\n__(Sincerely)__
\n__USER_SIGNATURE__',null); INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VENTES', 'Income of products/services', 'Exemple: 7xxxxx', 0, 0, '', '10', 1, 1); diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index c1d7e59cbed..89a704679a3 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -286,6 +286,16 @@ CREATE TABLE llx_societe_account( -- VMYSQL4.3 ALTER TABLE llx_societe_account MODIFY COLUMN pass_encoding varchar(24) NULL; +ALTER TABLE llx_const MODIFY type varchar(64) DEFAULT 'string'; + +UPDATE llx_const set type = 'text' where type = 'texte'; +UPDATE llx_const set type = 'html' where name in ('ADHERENT_AUTOREGISTER_NOTIF_MAIL','ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'); + +--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_AUTOREGISTER_MAIL' AND type != 'emailtemplate:member'; +--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_VALID' AND type != 'emailtemplate:member'; +--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_COTIS' AND type != 'emailtemplate:member'; +--UPDATE llx_const SET value = '', type = 'emailtemplate:member' WHERE name = 'ADHERENT_MAIL_RESIL' AND type != 'emailtemplate:member'; + ALTER TABLE llx_societe_account ADD COLUMN key_account varchar(128); ALTER TABLE llx_societe_account ADD INDEX idx_societe_account_rowid (rowid); @@ -303,10 +313,11 @@ ALTER TABLE llx_societe_account ADD CONSTRAINT llx_societe_account_fk_societe FO ALTER TABLE llx_societe_rib MODIFY COLUMN max_total_amount_of_all_payments double(24,8); ALTER TABLE llx_societe_rib MODIFY COLUMN total_amount_of_all_payments double(24,8); - - - -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendAnEMailToMember)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__','__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines) VALUES (0,'adherent','member','',0,null,null,'(SendReminderForExpiredSubscriptionTitle)',1,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); diff --git a/htdocs/install/mysql/tables/llx_const.sql b/htdocs/install/mysql/tables/llx_const.sql index 22e552213aa..806a3337291 100644 --- a/htdocs/install/mysql/tables/llx_const.sql +++ b/htdocs/install/mysql/tables/llx_const.sql @@ -28,8 +28,8 @@ create table llx_const rowid integer AUTO_INCREMENT PRIMARY KEY, name varchar(180) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id - value text NOT NULL, -- max 65535 caracteres - type varchar(6), + value text NOT NULL, -- max 65535 caracteres + type varchar(64) DEFAULT 'string', visible tinyint DEFAULT 1 NOT NULL, note text, tms timestamp diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3a7e8a7d14a..ac3e27a7166 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1775,6 +1775,7 @@ MAIN_PDF_MARGIN_TOP=Top margin on PDF MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups EnterCalculationRuleIfPreviousFieldIsYes=Enter calculcation rule if previous field was set to Yes (For example 'CODEGRP1+CODEGRP2') +SeveralLangugeVariatFound=Several language variants found ##### Resource #### ResourceSetup=Configuration du module Resource UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list). diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index befb763d60c..8a8346aac4a 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -13,8 +13,6 @@ ListOfValidatedPublicMembers=List of validated public members ErrorThisMemberIsNotPublic=This member is not public ErrorMemberIsAlreadyLinkedToThisThirdParty=Another member (name: %s, login: %s) is already linked to a third party %s. Remove this link first because a third party can't be linked to only a member (and vice versa). ErrorUserPermissionAllowsToLinksToItselfOnly=For security reasons, you must be granted permissions to edit all users to be able to link a member to a user that is not yours. -ThisIsContentOfYourCard=Hi.

This is a remind of the information we get about you. Feel free to contact us if something looks wrong.

-CardContent=Content of your member card SetLinkToUser=Link to a Dolibarr user SetLinkToThirdParty=Link to a Dolibarr third party MembersCards=Members business cards @@ -108,17 +106,33 @@ PublicMemberCard=Member public card SubscriptionNotRecorded=Subscription not recorded AddSubscription=Create subscription ShowSubscription=Show subscription -SendAnEMailToMember=Send information email to member +# Label of email templates +SendingAnEMailToMember=Sending information email to member +SendingEmailOnAutoSubscription=Sending email on auto registration +SendingEmailOnMemberValidation=Sending email on new member validation +SendingEmailOnNewSubscription=Sending email on new subscription +SendingReminderForExpiredSubscription=Sending reminder for expired subscription +SendingEmailOnCancelation=Sending email on cancelation +# Topic of email templates +YourMembershipRequestWasReceived=Your membership was received. +YourMembershipWasValidated=Your membership was validated +YourSubscriptionWasRecorded=Your new subscription was recorded +SubscriptionReminderEmail=Subscription reminder +YourMembershipWasCanceled=You membership was canceled +CardContent=Content of your member card +# Text of email templates +ThisIsContentOfYourMembershipRequestWasReceived=We want to let you know that your membership request was received.

+ThisIsContentOfYourMembershipWasValidated=We want to let you know that your membership was validated with the following information:

+ThisIsContentOfYourSubscriptionWasRecorded=We want to let you know that your new subscription was recorded.

+ThisIsContentOfSubscriptionReminderEmail=We want to let you know thet your subscription is about to expire. We hope you can make a renewal of it.

+ThisIsContentOfYourCard=This is a remind of the information we get about you. Feel free to contact us if something looks wrong.

DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Subject of the e-mail received in case of auto-inscription of a guest DescADHERENT_AUTOREGISTER_NOTIF_MAIL=E-mail received in case of auto-inscription of a guest -DescADHERENT_AUTOREGISTER_MAIL_SUBJECT=EMail subject for member autosubscription -DescADHERENT_AUTOREGISTER_MAIL=EMail for member autosubscription -DescADHERENT_MAIL_VALID_SUBJECT=EMail subject for member validation -DescADHERENT_MAIL_VALID=EMail for member validation -DescADHERENT_MAIL_COTIS_SUBJECT=EMail subject for subscription -DescADHERENT_MAIL_COTIS=EMail for subscription -DescADHERENT_MAIL_RESIL_SUBJECT=EMail subject for member resiliation -DescADHERENT_MAIL_RESIL=EMail for member resiliation +DescADHERENT_EMAIL_TEMPLATE_AUTOREGISTER=Template Email to use to send email to a member on member autosubscription +DescADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION=Template EMail to use to send email to a member on member validation +DescADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION=Template Email to use to send email to a member on new subscription recording +DescADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION=Template Email to use to send email remind when subscription is about to expire +DescADHERENT_EMAIL_TEMPLATE_CANCELATION=Template Email to use to send email to a member on member cancelation DescADHERENT_MAIL_FROM=Sender EMail for automatic emails DescADHERENT_ETIQUETTE_TYPE=Format of labels page DescADHERENT_ETIQUETTE_TEXT=Text printed on member address sheets @@ -182,5 +196,3 @@ NoEmailSentToMember=No email sent to member EmailSentToMember=Email sent to member at %s SendReminderForExpiredSubscriptionTitle=Send reminder by email for expired subscription SendReminderForExpiredSubscription=Send reminder by email to members when subscription is about to expire (parameter is number of days before end of subscription to send the remind) -YourSubscriptionHasExpired=Your subscription has expired -ThisIsContentOfSubscriptionReminderEmail=This is an email to remind you that your subscription is about to expire. From c12469860aa2564f59626ab512c72d1584ba37a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 16:17:10 +0100 Subject: [PATCH 34/53] Update lang --- htdocs/langs/en_NZ/companies.lang | 3 +++ htdocs/langs/en_NZ/compta.lang | 3 +++ htdocs/langs/en_NZ/main.lang | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/htdocs/langs/en_NZ/companies.lang b/htdocs/langs/en_NZ/companies.lang index fd92c40825e..afa8538da3b 100644 --- a/htdocs/langs/en_NZ/companies.lang +++ b/htdocs/langs/en_NZ/companies.lang @@ -3,3 +3,6 @@ VATIsUsed=GST is used VATIsNotUsed=GST is not used VATIntra=GST number VATIntraShort=GST number +VATIntraVeryShort=GST +VATIntraSyntaxIsValid=Syntax is valid +VATIntraValueIsValid=Value is valid diff --git a/htdocs/langs/en_NZ/compta.lang b/htdocs/langs/en_NZ/compta.lang index 90936c6ccf4..7b85434bb5c 100644 --- a/htdocs/langs/en_NZ/compta.lang +++ b/htdocs/langs/en_NZ/compta.lang @@ -9,3 +9,6 @@ VATPaid=GST paid VATCollected=GST collected VATPayment=GST Payment VATPayments=GST Payments +NewVATPayment=New GST payment +TotalToPay=Total to pay +TotalVATReceived=Total GST received \ No newline at end of file diff --git a/htdocs/langs/en_NZ/main.lang b/htdocs/langs/en_NZ/main.lang index 45235b7bf39..2af1b36ceb0 100644 --- a/htdocs/langs/en_NZ/main.lang +++ b/htdocs/langs/en_NZ/main.lang @@ -19,11 +19,16 @@ FormatDateHourShort=%d/%m/%Y %H:%M FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p FormatDateHourTextShort=%d %b %Y %H:%M FormatDateHourText=%d %B %Y %H:%M +UnitPrice=Unit price UnitPriceHT=Unit price (excl GST) +UnitPriceTTC=Unit price AmountHT=Amount (excl GST) AmountTTC=Amount (incl GST) AmountVAT=Amount GST +PriceQtyHT=Price for this quantity excl GST PriceQtyMinHT=Price quantity min. excl GST +PriceQtyTTC=Price for this quantity incl GST +PriceQtyMinTTC=Price quantity min. incl GST TotalHT=Total (excl GST) TotalTTC=Total (incl GST) TotalTTCToYourCredit=Total (incl GST) to your credit From a15abb2dedfb6e49245b36937558c481792e4ff6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 16:17:28 +0100 Subject: [PATCH 35/53] Update lang --- htdocs/langs/en_NZ/sendings.lang | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 htdocs/langs/en_NZ/sendings.lang diff --git a/htdocs/langs/en_NZ/sendings.lang b/htdocs/langs/en_NZ/sendings.lang new file mode 100644 index 00000000000..ceb733e140f --- /dev/null +++ b/htdocs/langs/en_NZ/sendings.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - en_NZ - main +# This file contains only line that must differs from en_US file +SendingSheet=Packing Slip \ No newline at end of file From 83b6dd4cb95adf57035a57321628933e8e26686b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 16:17:56 +0100 Subject: [PATCH 36/53] Prepare 7.0.2 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 3fc57df1967..fd2afa56fd1 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -31,7 +31,7 @@ */ if (! defined('DOL_APPLICATION_TITLE')) define('DOL_APPLICATION_TITLE','Dolibarr'); -if (! defined('DOL_VERSION')) define('DOL_VERSION','7.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c +if (! defined('DOL_VERSION')) define('DOL_VERSION','7.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c if (! defined('EURO')) define('EURO',chr(128)); From caa43ae2f63ce10d75a917f43854520b1bb09289 Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 23 Mar 2018 17:35:46 +0100 Subject: [PATCH 37/53] Make helper methods available for derived classes. Use-case: a module build with modulebuilder can make it's own fetch method using the helper methods. --- htdocs/core/class/commonobject.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 63788a32569..8d08b828fd1 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6111,7 +6111,7 @@ abstract class CommonObject * * @return array */ - private function set_save_query() + protected function set_save_query() { global $conf; @@ -6165,7 +6165,7 @@ abstract class CommonObject * * @param stdClass $obj Contain data of object from database */ - private function setVarsFromFetchObj(&$obj) + protected function setVarsFromFetchObj(&$obj) { foreach ($this->fields as $field => $info) { @@ -6210,7 +6210,7 @@ abstract class CommonObject * * @return string */ - private function get_field_list() + protected function get_field_list() { $keys = array_keys($this->fields); return implode(',', $keys); From 6e32e9961f1393de53376a8a2cc4e107a56474a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 17:56:35 +0100 Subject: [PATCH 38/53] Syn transifex --- htdocs/core/class/html.formmail.class.php | 1 + htdocs/core/lib/functions.lib.php | 4 +- .../mysql/data/llx_c_email_templates.sql | 2 +- .../install/mysql/migration/7.0.0-8.0.0.sql | 2 +- htdocs/langs/de_AT/members.lang | 2 - htdocs/langs/de_CH/members.lang | 1 - htdocs/langs/en_GB/accountancy.lang | 2 - htdocs/langs/en_US/paypal.lang | 2 +- htdocs/langs/es_CL/accountancy.lang | 1 - htdocs/langs/es_CL/admin.lang | 1 - htdocs/langs/es_CL/members.lang | 9 --- htdocs/langs/es_EC/admin.lang | 1 - htdocs/langs/fr_CA/members.lang | 9 --- htdocs/langs/fr_FR/admin.lang | 61 +++++++++++-------- htdocs/langs/fr_FR/paypal.lang | 5 +- htdocs/langs/pt_BR/accountancy.lang | 1 - htdocs/langs/pt_BR/admin.lang | 1 - htdocs/langs/pt_BR/members.lang | 2 - 18 files changed, 45 insertions(+), 62 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 2a93a3dc2b6..4625e6ea0ee 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -883,6 +883,7 @@ class FormMail extends Form $url=getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']); $paymenturl=$url; } + $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']=($paymenturl?$langs->trans("PredefinedMailContentLink", $paymenturl):''); $this->substit['__ONLINE_PAYMENT_URL__']=$paymenturl; //Add lines substitution key from each line diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6d57f7c34c3..d71d41019c4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5804,7 +5804,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service'; $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATETIME__'] = 'Lowest date and hour for planned expiration of service'; - $substitutionarray['__ONLINE_PAYMENT_URL__'] = 'LinkToPayOnlineIfApplicable'; + $substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable'; + $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = 'TextAndUrlToPayOnlineIfApplicable'; $substitutionarray['__SECUREKEYPAYMENT__'] = 'Security key (if key is not unique per record)'; $substitutionarray['__SECUREKEYPAYMENT_MEMBER__'] = 'Security key for payment on a member subscription (one key per member)'; $substitutionarray['__SECUREKEYPAYMENT_ORDER__'] = 'Security key for payment on an order'; @@ -5920,6 +5921,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $paymenturl=$url; } + $substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__']=($paymenturl?$outputlangs->trans("PredefinedMailContentLink", $paymenturl):''); $substitutionarray['__ONLINE_PAYMENT_URL__']=$paymenturl; } } diff --git a/htdocs/install/mysql/data/llx_c_email_templates.sql b/htdocs/install/mysql/data/llx_c_email_templates.sql index 0f6c76cb1b1..b913fca13f3 100644 --- a/htdocs/install/mysql/data/llx_c_email_templates.sql +++ b/htdocs/install/mysql/data/llx_c_email_templates.sql @@ -26,7 +26,7 @@ INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_u INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
__INFOS__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index 89a704679a3..b1b8b9d06b9 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -318,6 +318,6 @@ ALTER TABLE llx_societe_rib MODIFY COLUMN total_amount_of_all_payments double(24 INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnAutoSubscription)' ,10,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipRequestWasReceived)__','__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipRequestWasReceived)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnMemberValidation)' ,20,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasValidated)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourMembershipWasValidated)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnNewSubscription)' ,30,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionWasRecorded)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfYourSubscriptionWasRecorded)__
\n\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); -INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourSubscriptionHasExpired)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); +INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingReminderForExpiredSubscription)',40,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(SubscriptionReminderEmail)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(ThisIsContentOfSubscriptionReminderEmail)__
\n
__ONLINE_PAYMENT_TEXT_AND_URL__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingEmailOnCancelation)' ,50,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourMembershipWasCanceled)__', '__(Hello)__ __MEMBER_FULLNAME__,

\n\n__(YourMembershipWasCanceled)__
\n

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,enabled,active,topic,content,content_lines,joinfiles) VALUES (0,'adherent','member','',0,null,null,'(SendingAnEMailToMember)' ,60,1,1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(CardContent)__', '__(Hello)__,

\n\n__(ThisIsContentOfYourCard)__
\n__(ID)__ : __ID__
\n__(Civiliyty)__ : __MEMBER_CIVILITY__
\n__(Firstname)__ : __MEMBER_FIRSTNAME__
\n__(Lastname)__ : __MEMBER_LASTNAME__
\n__(Fullname)__ : __MEMBER_FULLNAME__
\n__(Company)__ : __MEMBER_COMPANY__
\n__(Address)__ : __MEMBER_ADDRESS__
\n__(Zip)__ : __MEMBER_ZIP__
\n__(Town)__ : __MEMBER_TOWN__
\n__(Country)__ : __MEMBER_COUNTRY__
\n__(Email)__ : __MEMBER_EMAIL__
\n__(Birthday)__ : __MEMBER_BIRTH__
\n__(Photo)__ : __MEMBER_PHOTO__
\n__(Login)__ : __MEMBER_LOGIN__
\n__(Password)__ : __MEMBER_PASSWORD__
\n__(Phone)__ : __MEMBER_PHONE__
\n__(PhonePerso)__ : __MEMBER_PHONEPRO__
\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__

\n__(Sincerely)__
__USER_SIGNATURE__',null, 1); diff --git a/htdocs/langs/de_AT/members.lang b/htdocs/langs/de_AT/members.lang index 063dfac0666..f90be1011c1 100644 --- a/htdocs/langs/de_AT/members.lang +++ b/htdocs/langs/de_AT/members.lang @@ -19,6 +19,4 @@ Physical=Physisch Moral=Rechtlich MorPhy=Physisch/Rechtlich Filehtpasswd=htpasswd-Datei -DescADHERENT_MAIL_RESIL_SUBJECT=E-Mail-Betreff für Zurückstellen eines Mitglieds -DescADHERENT_MAIL_RESIL=E-Mail-Text für Zurückstellen eines Mitglieds HTPasswordExport=htpassword-Dateierstellung diff --git a/htdocs/langs/de_CH/members.lang b/htdocs/langs/de_CH/members.lang index 73f9ee9b008..0709b29c82b 100644 --- a/htdocs/langs/de_CH/members.lang +++ b/htdocs/langs/de_CH/members.lang @@ -30,7 +30,6 @@ WelcomeEMail=Begrüssungsemail SubscriptionRequired=Abonnement notwendig VoteAllowed=Abstimmen erlaubt ShowSubscription=Abonnement anzeigen -SendAnEMailToMember=Informationsemail dem Mitglied senden HTPasswordExport=htpassword Datei generieren MembersAndSubscriptions=Mitglieder und Abonnemente SubscriptionPayment=Zahlung des Mitgliedsbeitrags diff --git a/htdocs/langs/en_GB/accountancy.lang b/htdocs/langs/en_GB/accountancy.lang index 8639f6dde52..1fea94adb02 100644 --- a/htdocs/langs/en_GB/accountancy.lang +++ b/htdocs/langs/en_GB/accountancy.lang @@ -61,14 +61,12 @@ ACCOUNTING_PRODUCT_BUY_ACCOUNT=Default purchases account (used if not defined in ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Default sales account (used if not defined in the product sheet) ACCOUNTING_SERVICE_BUY_ACCOUNT=Default services purchase account (used if not defined in the service sheet) ACCOUNTING_SERVICE_SOLD_ACCOUNT=Default services sales account (used if not defined in the service sheet) -Code_tiers=Third party LabelAccount=Account name Sens=Meaning NumPiece=Item number GroupByAccountAccounting=Group by finance account DelBookKeeping=Delete record in the Ledger FeeAccountNotDefined=Account for fees not defined -ThirdPartyAccount=Third party account NumMvts=Transaction Number ErrorDebitCredit=Debit and Credit fields cannot have values at the same time AddCompteFromBK=Add finance accounts to the group diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index 25f06dacd42..2cbe4289654 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -14,7 +14,7 @@ PaypalModeOnlyPaypal=PayPal only ONLINE_PAYMENT_CSS_URL=Optionnal URL of CSS style sheet on online payment page ThisIsTransactionId=This is id of transaction: %s PAYPAL_ADD_PAYMENT_URL=Add the url of Paypal payment when you send a document by mail -PredefinedMailContentLink=You can click on the secure link below to make your payment (PayPal) if it is not already done.\n\n%s\n\n +PredefinedMailContentLink=You can click on the link below to make your payment if it is not already done.

%s

YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode NewOnlinePaymentReceived=New online payment received NewOnlinePaymentFailed=New online payment tried but failed diff --git a/htdocs/langs/es_CL/accountancy.lang b/htdocs/langs/es_CL/accountancy.lang index c98c669ebe4..c5508ab297a 100644 --- a/htdocs/langs/es_CL/accountancy.lang +++ b/htdocs/langs/es_CL/accountancy.lang @@ -110,7 +110,6 @@ ACCOUNTING_PRODUCT_BUY_ACCOUNT=Cuenta de contabilidad por defecto para productos ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Cuenta de contabilidad por defecto para los productos vendidos (utilizada si no está definida en la hoja del producto) ACCOUNTING_SERVICE_BUY_ACCOUNT=Cuenta de contabilidad por defecto para los servicios comprados (se usa si no se define en la hoja de servicio) ACCOUNTING_SERVICE_SOLD_ACCOUNT=Cuenta de contabilidad por defecto para los servicios vendidos (utilizada si no está definida en la hoja de servicio) -Code_tiers=Socio de Negocio LabelAccount=Cuenta LabelOperation=Operación de etiqueta Sens=Significado diff --git a/htdocs/langs/es_CL/admin.lang b/htdocs/langs/es_CL/admin.lang index cbf83f9eb3b..b8b8c1ac533 100644 --- a/htdocs/langs/es_CL/admin.lang +++ b/htdocs/langs/es_CL/admin.lang @@ -318,7 +318,6 @@ ExtrafieldParamHelpsellist=Lista de valores proviene de una tabla
Sintaxis: ExtrafieldParamHelpchkbxlst=La lista de valores proviene de una tabla
Sintaxis: table_name: label_field: id_field :: filter
Ejemplo: c_typent: libelle: id :: filter

el filtro puede ser una prueba simple (por ejemplo, active = 1 ) para mostrar solo el valor activo
También puede usar $ ID $ en el filtro bruja es la identificación actual del objeto actual
Para hacer un SELECCIONAR en filtro use $ SEL $
si desea filtrar el uso de campos extraños sintaxis extra.fieldcode = ... (donde el código de campo es el código de extrafield)

Para que la lista dependa de otra lista de atributos complementarios:
c_typent: libelle: id: options_ parent_list_code|parent_column: filter

Para que la lista dependa de otra lista:
c_typent: libelle: id: parent_list_codelparent_column: filter ExtrafieldParamHelplink=Los parámetros deben ser ObjectName: Classpath
Sintaxis: ObjectName: Classpath
Ejemplo: Societe: societe / class / societe.class.php LibraryToBuildPDF=Biblioteca utilizada para la generación de PDF -WarningUsingFPDF=Advertencia: su conf.php contiene la directiva dolibarr_pdf_force_fpdf = 1. Esto significa que usa la biblioteca FPDF para generar archivos PDF. Esta biblioteca es antigua y no admite muchas características (Unicode, transparencia de imagen, cirílico, árabe y asiático, ...), por lo que puede experimentar errores durante la generación de PDF.
Para solucionar esto y tener un soporte completo de la generación de PDF, descargue la librería TCPDF, luego comente o elimine la línea $dolibarr_pdf_force_fpdf = 1, y en su lugar, agregue $dolibarr_lib_TCPDF_PATH = 'path_to_TCPDF_dir' LocalTaxDesc=Algunos países aplican 2 o 3 impuestos en cada línea de factura. Si este es el caso, elija tipo para el segundo y tercer impuesto y su tasa. El tipo posible es:
1: impuesto local se aplica a productos y servicios sin IVA (el impuesto local se calcula sobre el monto sin impuestos)
2: se aplica el impuesto local sobre productos y servicios, incluido el IVA (el impuesto local se calcula sobre el monto + impuesto principal )
3: el impuesto local se aplica a los productos sin IVA (el impuesto local se calcula sobre el monto sin impuestos)
4: se aplica el impuesto local sobre los productos, incluido IVA (el impuesto local se calcula sobre el monto + el IVA principal)
5: local se aplica impuesto sobre los servicios sin IVA (el impuesto local se calcula sobre el monto sin impuestos)
6: el impuesto local se aplica a los servicios, incluido el IVA (el impuesto local se calcula sobre el monto + impuestos) LinkToTestClickToDial=Ingrese un número de teléfono para llamar y mostrar un enlace para probar la URL de ClickToDial para el usuario %s RefreshPhoneLink=Actualizar enlace diff --git a/htdocs/langs/es_CL/members.lang b/htdocs/langs/es_CL/members.lang index 29d57cd65b8..a04a3869592 100644 --- a/htdocs/langs/es_CL/members.lang +++ b/htdocs/langs/es_CL/members.lang @@ -79,17 +79,8 @@ PublicMemberCard=Tarjeta pública de miembro SubscriptionNotRecorded=Suscripción no grabada AddSubscription=Crear suscripción ShowSubscription=Mostrar suscripción -SendAnEMailToMember=Enviar información por correo electrónico al miembro DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Asunto del correo electrónico recibido en caso de inscripción automática de un invitado DescADHERENT_AUTOREGISTER_NOTIF_MAIL=E-mail recibido en caso de auto inscripción de un invitado -DescADHERENT_AUTOREGISTER_MAIL_SUBJECT=Asunto de correo electrónico para la suscripción automática de miembros -DescADHERENT_AUTOREGISTER_MAIL=Correo electrónico para la suscripción automática de miembros -DescADHERENT_MAIL_VALID_SUBJECT=Asunto de correo electrónico para la validación de miembros -DescADHERENT_MAIL_VALID=Correo electrónico para la validación de miembro -DescADHERENT_MAIL_COTIS_SUBJECT=Correo electrónico sujeto a suscripción -DescADHERENT_MAIL_COTIS=Correo electrónico para suscripción -DescADHERENT_MAIL_RESIL_SUBJECT=Asunto de correo para la resiliencia de miembros -DescADHERENT_MAIL_RESIL=Correo electrónico para la resiliencia de miembros DescADHERENT_MAIL_FROM=Remitente Correo electrónico para correos electrónicos automáticos DescADHERENT_ETIQUETTE_TYPE=Formato de la página de etiquetas DescADHERENT_ETIQUETTE_TEXT=Texto impreso en las hojas de direcciones de los miembros diff --git a/htdocs/langs/es_EC/admin.lang b/htdocs/langs/es_EC/admin.lang index aa4ce9ecbfc..e6d9f06e3f0 100644 --- a/htdocs/langs/es_EC/admin.lang +++ b/htdocs/langs/es_EC/admin.lang @@ -325,7 +325,6 @@ ExtrafieldParamHelpsellist=La lista de valores viene de una tabla
Sintaxis : ExtrafieldParamHelpchkbxlst=La lista de valores proviene de un tabla
Syntax: nombre_tabla:label_field:id_field::filter
Example : c_typent:libelle:id::filter

filter puede ser una prueba simple (por ejemplo, activa=1) para mostrar sólo el valor activo
También puede usar $ID$ en filtro con el id actual del objeto actual
Para hacer un SELECT en el filtro use $SEL$
si quiere filtrar en extrafields use sintaxis extra.fieldcode=...(donde código de campo es el código de extrafield)

Para tener la lista dependiendo de otra lista de atributos complementarios:
c_typent:libelle:id:options_parent_list_code|parent_column:filter

Para que la lista dependa de otra lista:
c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelplink=Los parámetros deben ser ObjectName: Classpath
Syntax: ObjectName: Classpath
Examples:
Societe: societe/class/societe.class.php
Contacto: contact/class/contact.class.php LibraryToBuildPDF=Biblioteca utilizado para la generación de PDF -WarningUsingFPDF=Advertencia: Su conf.php contiene una directiva dolibarr_pdf_force_fpdf=1. Esto significa que utiliza la biblioteca FPDF para generar archivos PDF. Esta biblioteca es antigua y no soporta muchas características (Unicode, transparencia de imagen, cyrillic, árabe y idiomas asiáticos, ...), por lo que puede experimentar errores durante la generación de PDF.
Para resolver esto y tener un soporte completo de generación de PDF, por favor descargue TCPDF library, luego comenta o elimina la línea $dolibarr_pdf_force_fpdf=1, and Agregar en su lugar $dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir' LocalTaxDesc=Algunos países aplican 2 o 3 impuestos en cada línea de factura. Si este es el caso, elija el tipo de segundo y tercer impuesto y su tasa. El tipo posible es:
1 : el impuesto local se aplica sobre los productos y servicios sin IVA (impuesto local se calcula sobre la cantidad sin impuestos)
2 : El impuesto local se aplica en los productos y los servicios incluyendo el IVA (el impuesto local se calcula sobre la cantidad + impuesto principal)
3 : El impuesto local se aplica en los productos sin IVA (el impuesto local se calcula sobre la cantidad sin impuestos)
4 : El impuesto local se aplica a los productos, incluido el IVA (el impuesto local se calcula sobre la cantidad + impuesto principal)
5 : Se aplica el impuesto local sobre los servicios sin IVA (el impuesto local se calcula sobre la cantidad sin impuestos)
6 : Se aplican impuestos locales sobre los servicios, incluido el IVA (el impuesto local se calcula sobre el importe + impuestos) LinkToTestClickToDial=Introduzca un número de teléfono para llamar, para mostrar un enlace y probar la URL de ClickToDial para el usuario %s RefreshPhoneLink=Actualizar enlace diff --git a/htdocs/langs/fr_CA/members.lang b/htdocs/langs/fr_CA/members.lang index 26e7135f0df..a53f05ad15d 100644 --- a/htdocs/langs/fr_CA/members.lang +++ b/htdocs/langs/fr_CA/members.lang @@ -89,17 +89,8 @@ PublicMemberCard=Carte publique membre SubscriptionNotRecorded=L'abonnement n'est pas enregistré AddSubscription=Créer un abonnement ShowSubscription=Afficher l'abonnement -SendAnEMailToMember=Envoyer un email d'information au membre DescADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT=Objet de l'e-mail reçu en cas d'auto-inscription d'un invité DescADHERENT_AUTOREGISTER_NOTIF_MAIL=E-mail reçu en cas d'auto-inscription d'un invité -DescADHERENT_AUTOREGISTER_MAIL_SUBJECT=Émetteur pour les abonnements aux membres -DescADHERENT_AUTOREGISTER_MAIL=EMail pour les abonnements aux membres -DescADHERENT_MAIL_VALID_SUBJECT=Sujet d'envoi pour la validation des membres -DescADHERENT_MAIL_VALID=EMail pour la validation des membres -DescADHERENT_MAIL_COTIS_SUBJECT=Sujet d'envoi pour souscription -DescADHERENT_MAIL_COTIS=EMail pour souscription -DescADHERENT_MAIL_RESIL_SUBJECT=Sujet d'envoi pour la résiliation des membres -DescADHERENT_MAIL_RESIL=EMail pour la résiliation des membres DescADHERENT_MAIL_FROM=Expéditeur EMail pour les courriels automatiques DescADHERENT_ETIQUETTE_TYPE=Format de la page des étiquettes DescADHERENT_ETIQUETTE_TEXT=Texte imprimé sur les feuilles d'adresses des membres diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 0ab3342ed4f..84884e898b4 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -68,8 +68,8 @@ ErrorCodeCantContainZero=Erreur, le code ne peut contenir la valeur 0 DisableJavascript=Désactive les fonctions Javascript et Ajax (Recommandé pour les personnes aveugles ou navigateurs text). UseSearchToSelectCompanyTooltip=Si vous avez un nombre important de tiers (>100 000), vous pourrez améliorer les performances en positionnant la constante COMPANY_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limité au début des chaines. UseSearchToSelectContactTooltip=Si vous avez un nombre important de contacts (>100 000), vous pourrez améliorer les performances en positionnant la constante CONTACT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limité au début des chaines. -DelaiedFullListToSelectCompany=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des tiers (Cela peut augmenter les performances si vous avez un grand nombre de contacts) -DelaiedFullListToSelectContact=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des contacts/adresses (Cela peut augmenter les performances si vous avez un grand nombre de contacts) +DelaiedFullListToSelectCompany=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des tiers (Cela peut augmenter les performances si vous avez un grand nombre de tiers, mais cela est moins convivial) +DelaiedFullListToSelectContact=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des contacts/adresses (Cela peut augmenter les performances si vous avez un grand nombre de contacts, mais cela est moins convivial) NumberOfKeyToSearch=Nb carac. déclenchant recherche : %s NotAvailableWhenAjaxDisabled=Non disponible quand Ajax est désactivé AllowToSelectProjectFromOtherCompany=Sur les éléments d'un tiers, autorise la sélection d'un projet lié à un autre tiers @@ -151,7 +151,7 @@ PurgeDeleteAllFilesInDocumentsDir=Effacer tous les fichiers du répertoire %s PurgeRunNow=Lancer la purge maintenant PurgeNothingToDelete=Aucun dossier ou fichier à supprimer. PurgeNDirectoriesDeleted=%s fichiers ou répertoires supprimés. -PurgeNDirectoriesFailed=Echec de la suppression des fichiers ou du répertoire '%s'. +PurgeNDirectoriesFailed=Echec de la suppression de %s fichier(s) ou du répertoire(s). PurgeAuditEvents=Purger les événements d'audit de sécurité ConfirmPurgeAuditEvents=Êtes vous sûr de vouloir purger la liste des événements d'audit de sécurité. Toute la liste sera effacée, mais ceci est sans conséquence sur vos autres données. GenerateBackup=Générer sauvegarde @@ -278,10 +278,6 @@ MAIN_MAIL_SMTPS_ID=Identifiant d'authentification SMTP si authentification SMTP MAIN_MAIL_SMTPS_PW=Mot de passe d'authentification SMTP si authentification SMTP requise MAIN_MAIL_EMAIL_TLS= Utilisation du chiffrement TLS (SSL) MAIN_MAIL_EMAIL_STARTTLS= Utiliser le cryptage TTS (STARTTLS) -MAIN_MAIL_EMAIL_DKIM_ENABLED= Utiliser la signature DKIM -MAIN_MAIL_EMAIL_DKIM_DOMAIN=Domaine DKIM -MAIN_MAIL_EMAIL_DKIM_SELECTOR=Sélecteur de clé DKIM -MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY=Clé privée RSA DKIM MAIN_DISABLE_ALL_SMS=Désactiver globalement tout envoi de SMS (pour mode test ou démos) MAIN_SMS_SENDMODE=Méthode d'envoi des SMS MAIN_MAIL_SMS_FROM=Numéro de téléphone par défaut pour l'envoi des SMS @@ -346,7 +342,7 @@ ErrorCantUseRazIfNoYearInMask=Erreur, ne peut utiliser l'option @ pour remettre ErrorCantUseRazInStartedYearIfNoYearMonthInMask=Erreur, ne peut utiliser l'option @ si la séquence {yy}{mm} ou {yyyy}{mm} n'est pas dans le masque. UMask=Masque des nouveaux fichiers sous Unix/Linux/BSD/Mac. UMaskExplanation=Ce paramètre permet de définir les droits des fichiers créés sur le serveur par Dolibarr (lors d'envois par exemple).
Ce doit être la valeur octale (par exemple 0666 signifie lecture/écriture pour tous).
Ce paramètre n'a aucun effet sur un serveur Windows. -SeeWikiForAllTeam=Voir le wiki pour le détail de tous les acteurs et leur organisation +SeeWikiForAllTeam=Take a look at the wiki page for full list of all actors and their organization UseACacheDelay= Délai de mise en cache de l'export en secondes (0 ou vide pour aucun cache) DisableLinkToHelpCenter=Cacher le lien «Besoin d'aide ou d'assistance» sur la page de connexion DisableLinkToHelp=Cacher le lien vers l'aide en ligne %s @@ -396,6 +392,7 @@ PriceBaseTypeToChange=Modifier sur les prix dont la référence de base est le MassConvert=Convertir en masse String=Chaîne TextLong=Texte long +HtmlText=Html text Int=Numérique entier Float=Décimal DateAndTime=Date et heure @@ -415,6 +412,7 @@ ExtrafieldCheckBoxFromList=Cases à cocher issues d'une table ExtrafieldLink=Lien vers un objet ComputedFormula=Champ calculé ComputedFormulaDesc=Vous pouvez entrer ici une formule utilisant les propriétés objet ou tout code PHP pour obtenir des valeurs dynamiques. Vous pouvez utiliser toute formule compatible PHP, incluant l'opérateur conditionnel "?", et les objets globaux : $db, $conf, $langs, $mysoc, $user, $object.
ATTENTION : Seulement quelques propriétés de l'objet $object pourraient être disponibles. Si vous avez besoin de propriétés non chargées, créez vous même une instance de l'objet dans votre formule, comme dans le deuxième exemple.
Utiliser un champs calculé signifie que vous ne pouvez pas entrer vous même toute valeur à partir de l'interface. Aussi, s'il y a une erreur de syntaxe, la formule pourrait ne rien retourner.

Exemple de formule:
$object->id < 10 ? round($object->id / 2, 2) : ($object->id + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)

Exemple pour recharger l'objet:
(($reloadedobj = new Societe($db)) && ($reloadedobj->fetch($obj->id ? $obj->id : ($obj->rowid ? $obj->rowid : $object->id)) > 0)) ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5 : '-1'

Un autre exemple de formule pour forcer le rechargement d'un objet et de son objet parent:
(($reloadedobj = new Task($db)) && ($reloadedobj->fetch($object->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetch($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref : 'Objet parent projet non trouvé' +ExtrafieldParamHelpPassword=Keep this field empty means value will be stored without encryption (field must be only hidden with star on screen).
Set here value 'auto' to use the default encryption rule to save password into database (then value read will be the hash only, no way to retreive original value) ExtrafieldParamHelpselect=La liste doit être de la forme clef,valeur (où la clé ne peut être '0')

par exemple :
1,valeur1
2,valeur2
3,valeur3
...

\nPour afficher une liste dépendant d'une autre liste attribut complémentaire:
1, valeur1|options_code_liste_parente:clé_parente
2,valeur2|option_Code_liste_parente:clé_parente

\nPour que la liste soit dépendante d'une autre liste:
1,valeur1|code_liste_parent:clef_parent
2,valeur2|code_liste_parent:clef_parent ExtrafieldParamHelpcheckbox=La liste doit être de la forme clef,valeur (où la clé ne peut être '0')

par exemple :
1,valeur1
2,valeur2
3,valeur3
... ExtrafieldParamHelpradio=La liste doit être de la forme clef,valeur (où la clé ne peut être '0')

par exemple :
1,valeur1
2,valeur2
3,valeur3
... @@ -422,7 +420,6 @@ ExtrafieldParamHelpsellist=Les paramètres de la liste viennent d'une table
S ExtrafieldParamHelpchkbxlst=Les paramètres de la liste proviennent d'une table
:\nSyntaxe : nom_de_la_table:libelle_champ:id_champ::filtre
\nExemple : c_typent:libelle:id::filter

le filtre peut n'est qu'un test (ex : active=1) pour n'afficher que les valeurs actives.
Vous pouvez aussi utiliser $ID$ dans les filtres pour indiquer l'ID de l'élément courant.
\nPour utiliser un SELECT dans un filtre, utilisez $SEL$
\nPour filtrer sur un attribut supplémentaire, utilisez la syntaxe\nextra.fieldcode=... (ou fieldcode est le code de l'attribut supplémentaire)

Pour afficher une liste dépendant d'un autre attribut supplémentaire :
c_typent:libelle:id:options_code_liste_parente|colonne_parente:filtre

Pour afficher une liste dépendant d'une autre liste :
c_typent:libelle:id:code_liste_parente|colonne_parente:filter ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
Syntax : ObjectName:Classpath
Examples :
Societe:societe/class/societe.class.php
Contact:contact/class/contact.class.php LibraryToBuildPDF=Bibliothèque utilisée pour la génération des PDF -WarningUsingFPDF=Attention : votre fichier conf.php contient la directive dolibarr_pdf_force_fpdf=1. Cela signifie que vous utilisez la librairie FPDF pour générer vos fichiers PDF. Cette librairie est ancienne et ne couvre pas de nombreuses fonctionnalités (Unicode, transparence des images, langues cyrilliques, arabes ou asiatiques...), aussi vous pouvez rencontrer des problèmes durant la génération des PDF.
Pour résoudre cela et avoir une prise en charge complète de PDF, vous pouvez télécharger la bibliothèque TCPDF puis commenter ou supprimer la ligne $dolibarr_pdf_force_fpdf=1, et ajouter à la place $dolibarr_lib_TCPDF_PATH='chemin_vers_TCPDF' LocalTaxDesc=Certains pays appliquent 2 voire 3 taux sur chaque ligne de facture. Si c'est le cas, choisissez le type du deuxième et troisième taux et sa valeur. Les types possibles sont:
1 : taxe locale sur les produits et services hors tva (la taxe locale est calculée sur le montant hors taxe)
2 : taxe locale sur les produits et services avant tva (la taxe locale est calculée sur le montant + tva)
3 : taxe locale uniquement sur les produits hors tva (la taxe locale est calculée sur le montant hors taxe)
4 : taxe locale uniquement sur les produits avant tva (la taxe locale est calculée sur le montant + tva)
5 : taxe locale uniquement sur les services hors tva (la taxe locale est calculée sur le montant hors taxe)
6 : taxe locale uniquement sur les service avant tva (la taxe locale est calculée sur le montant + tva) SMS=SMS LinkToTestClickToDial=Entrez un numéro de téléphone à appeler pour tester le lien d'appel « ClickToDial » pour l'utilisateur %s @@ -453,7 +450,8 @@ ModuleCompanyCodePanicum=Retourne un code comptable vide ModuleCompanyCodeDigitaria=Renvoie un code comptable composé suivant le code tiers. Le code est composé du caractère 'C' en première position suivi des 5 premiers caractères du code tiers. Use3StepsApproval=Par défaut, les commandes fournisseurs nécessitent d'être créées et approuvées en deux étapes/utilisateurs (une étape/utilisateur pour créer et une étape/utilisateur pour approuver. Si un utilisateur à les deux permissions, ces deux actions sont effectuées en une seule fois). Cette option ajoute la nécessité d'une approbation par une troisième étape/utilisateur, si le montant de la commande est supérieur au montant d'une valeur définie (soit 3 étapes nécessaire: 1 =Validation, 2=Première approbation et 3=seconde approbation si le montant l'exige).
Laissez le champ vide si une seule approbation (2 étapes) sont suffisantes, placez une valeur très faibe (0.1) si une deuxième approbation (3 étapes) est toujours exigée. UseDoubleApproval=Activer l'approbation en trois étapes si le montant HT est supérieur à... -WarningPHPMail=Attention : Certains serveurs de messagerie (Yahoo) ne permettent pas l'envoi d'e-mails depuis un autre serveur que le leur si l'adresse d'envoi utilisée est une adresse Yahoo (myemail@yahoo.fr, myemail@yahoo.com...) Votre configuration actuelle utilise le serveur de l'application pour l'envoi d'e-mails. Le serveur de certains destinataires (compatibles avec le protocole restrictif DMARC) demanderont aux serveurs Yahoo l'autorisation de recevoir les e-mails et Yahoo la refusera car le serveur n'est pas un serveur appartenant à Yahoo, aussi une partie de vos e-mails envoyés risquent de ne pas être reçus.\n
Si votre fournisseur d'e-mail (comme Yahoo) impose cette restriction, vous devrez modifier votre configuration et opter pour l'autre méthode d'envoi "SMTP server" et saisissez les identifiants SMTP de votre compte fournis par votre fournisseur d'e-mail (à demander à votre fournisseur d'e-mail) +WarningPHPMail=WARNING: It is often better to setup outgoing emails to use the email server of your provider instead of the default setup. Some email providers (like Yahoo) does not allow you to send an email from another server than their own server. Your current setup use the server of the application to send email and not the server of your email provider, so some recipients (the one compatible with the restrictive DMARC protocol), will ask your email provider if they can accept your email and some email providers (like Yahoo) may respond "no" because the server is not a server of them, so few of your sent Emails may not be accepted (be car also to your email provider sending quota).
If your Email provider (like Yahoo) has this restriction, you must change Email setup to choose the other method "SMTP server" and enter the SMTP server and credentials provided by your Email provider (ask your EMail provider to get SMTP credentials for your account). +WarningPHPMail2=If your email SMTP provider need to restrict email client to some IP addresses (very rare), this is the IP address of your ERP CRM application: %s. ClickToShowDescription=Cliquer pour afficher la description DependsOn=Ce module a besoin du(des) module(s) RequiredBy=Ce module est requis par le ou les module(s) @@ -623,6 +621,8 @@ Module59000Name=Marges Module59000Desc=Module pour gérer les marges Module60000Name=Commissions Module60000Desc=Module pour gérer les commissions +Module62000Name=Incoterm +Module62000Desc=Ajouts de fonctionnalités pour gérer les incoterms Module63000Name=Ressources Module63000Desc=Gère les ressources (imprimantes, voitures, salles...). les ressources peuvent être affectées à des événements. Permission11=Consulter les factures clients @@ -837,11 +837,11 @@ Permission1251=Lancer des importations en masse dans la base (chargement de donn Permission1321=Exporter les factures clients, attributs et règlements Permission1322=Rouvrir une facture payée Permission1421=Exporter les commandes clients et attributs -Permission20001=Lire les demandes de congé (les vôtres et celle de vos subordonnés) -Permission20002=Créer/modifier vos demandes de congé +Permission20001=Read leave requests (your leaves and the one of your subordinates) +Permission20002=Create/modify your leave requests (yours leaves and the one of your subordinates) Permission20003=Supprimer les demandes de congé -Permission20004=Lire toutes les demandes de congé (même celle des utilisateurs non subordonnés) -Permission20005=Créer/modifier les congés pour tout le monde +Permission20004=Read all leave requests (even of user not subordinates) +Permission20005=Create/modify leave requests for everybody (even of user not subordinates) Permission20006=Administration des demandes de congés (configuration et mise à jour du solde) Permission23001=Voir les travaux planifiés Permission23002=Créer/Modifier des travaux planifiées @@ -888,6 +888,7 @@ DictionaryRevenueStamp=Montants des timbres fiscaux DictionaryPaymentConditions=Conditions de règlement DictionaryPaymentModes=Modes de paiements DictionaryTypeContact=Types de contacts/adresses +DictionaryTypeOfContainer=Type of website pages/containers DictionaryEcotaxe=Barèmes Eco-participation (DEEE) DictionaryPaperFormat=Format papiers DictionaryFormatCards=Formats des cartes @@ -915,8 +916,8 @@ TypeOfRevenueStamp=Type de timbre fiscal VATManagement=Gestion TVA VATIsUsedDesc=Le taux de TVA proposé par défaut lors de la création de proposition commerciale, facture, commande, etc... répond à la règle standard suivante :
Si vendeur non assujetti à TVA, TVA par défaut=0. Fin de règle.
Si le (pays vendeur= pays acheteur) alors TVA par défaut=TVA du produit vendu. Fin de règle.
Si vendeur et acheteur dans Communauté européenne et bien vendu= moyen de transport neuf (auto, bateau, avion), TVA par défaut=0 (La TVA doit être payée par acheteur au centre d'impôts de son pays et non au vendeur). Fin de règle.
Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TVA par défaut=TVA du produit vendu (TVA pays vendeur si < seuil du pays et si avant 01/01/2015, TVA pays acheteur après le 01/01/2015). Fin de règle.
Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TVA par défaut=0. Fin de règle.
Sinon TVA proposée par défaut=0. Fin de règle.
VATIsNotUsedDesc=Le taux de TVA proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés. -VATIsUsedExampleFR=En France, il s'agit des sociétés ou organismes ayant choisi un régime fiscale réel (Réel simplifié ou Réel normal), régime dans lequel la TVA est déclarée. -VATIsNotUsedExampleFR=En France, il s'agit des associations ne déclarant pas de TVA ou sociétés, organismes ou professions libérales ayant choisi le régime fiscal micro entreprise (TVA en franchise) et payant une TVA en franchise sans faire de déclaration de TVA. Ce choix fait de plus apparaître la mention "TVA non applicable - art-293B du CGI" sur les factures. +VATIsUsedExampleFR=En France, cela signifie que les entreprises ou les organisations sont assuetis à la tva (réel ou normal). +VATIsNotUsedExampleFR=In France, it means associations that are non VAT declared or companies, organizations or liberal professions that have chosen the micro enterprise fiscal system (VAT in franchise) and paid a franchise VAT without any VAT declaration. This choice will display the reference "Non applicable VAT - art-293B of CGI" on invoices. ##### Local Taxes ##### LTRate=Taux LocalTax1IsNotUsed=Non assujeti @@ -981,7 +982,7 @@ Host=Serveur DriverType=Type du pilote SummarySystem=Résumé des informations systèmes SummaryConst=Liste de tous les paramètres de configuration Dolibarr -MenuCompanySetup=Société/Organisation +MenuCompanySetup=Company/Organization DefaultMenuManager= Gestionnaire du menu standard DefaultMenuSmartphoneManager=Gestionnaire du menu smartphone Skin=Thème visuel @@ -997,8 +998,8 @@ PermanentLeftSearchForm=Zone de recherche permanente du menu de gauche DefaultLanguage=Langue à utiliser par défaut (code langue) EnableMultilangInterface=Activer l'interface multi-langue EnableShowLogo=Afficher le logo dans le menu gauche -CompanyInfo=Informations sur la société/organisation -CompanyIds=Identifiants règlementaires +CompanyInfo=Company/organization information +CompanyIds=Company/organization identities CompanyName=Nom/Enseigne/Raison sociale CompanyAddress=Adresse CompanyZip=Code postal @@ -1053,6 +1054,7 @@ AreaForAdminOnly=Les paramètres d'installation ne peuvent être remplis que par SystemInfoDesc=Les informations systèmes sont des informations techniques diverses accessibles en lecture seule aux administrateurs uniquement. SystemAreaForAdminOnly=Cet espace n'est accessible qu'aux utilisateurs de type administrateur. Aucune permission Dolibarr ne permet d'étendre le cercle des utilisateurs autorisés à cet espace. CompanyFundationDesc=Éditez sur cette page toutes les informations connues de la société ou de l'association que vous souhaitez gérer (Pour cela, cliquez sur les boutons "Modifier" ou "Sauvegarder" en bas de page) +AccountantDesc=Edit on this page all known information of your accountant/auditor to manage (For this, click on "Modify" or "Save" button at bottom of page) DisplayDesc=Vous pouvez choisir ici tous les paramètres liés à l'apparence de Dolibarr AvailableModules=Modules/applications installés ToActivateModule=Pour activer des modules, aller dans l'espace Configuration (Accueil->Configuration->Modules). @@ -1429,7 +1431,7 @@ ViewProductDescInFormAbility=Visualisation des descriptions produits dans les fo MergePropalProductCard=Ajoute dans l'onglet Fichiers joints des produits/services, une option pour fusionner le document PDF du produit au PDF des propositions Azur si le produit/services est inclut dans la proposition. ViewProductDescInThirdpartyLanguageAbility=Visualisation des descriptions de produits dans la langue du tiers UseSearchToSelectProductTooltip=Si vous avez un nombre important de produits (>100 000), vous pourrez améliorer les performances en positionnant la constante PRODUCT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limité au début des chaines. -UseSearchToSelectProduct=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des produits (Cela peut augmenter les performances si vous avez un grand nombre de contacts) +UseSearchToSelectProduct=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des produits (Cela peut augmenter les performances si vous avez un grand nombre de produits, mais cela est moins convivial) SetDefaultBarcodeTypeProducts=Type de code-barre utilisé par défaut pour les produits SetDefaultBarcodeTypeThirdParties=Type de code-barre utilisé par défaut pour les tiers UseUnits=Définir une unité de mesure pour la quantité lors de l'édition de lignes de commande, proposition ou facture @@ -1445,6 +1447,9 @@ SyslogFilename=Nom et chemin du fichier YouCanUseDOL_DATA_ROOT=Vous pouvez utiliser DOL_DATA_ROOT/dolibarr.log pour un journal dans le répertoire "documents" de Dolibarr. Vous pouvez néanmoins définir un chemin différent pour stocker ce fichier. ErrorUnknownSyslogConstant=La constante %s n'est pas une constante syslog connue OnlyWindowsLOG_USER=Windows ne prend en charge que LOG_USER +CompressSyslogs=Syslog files compression and backup +SyslogFileNumberOfSaves=Log backups +ConfigureCleaningCronjobToSetFrequencyOfSaves=Configure cleaning scheduled job to set log backup frequency ##### Donations ##### DonationsSetup=Configuration du module Dons DonationsReceiptModel=Modèles de reçu de dons @@ -1554,7 +1559,7 @@ SupposedToBeInvoiceDate=Date de facture utilisée Buy=Achat Sell=Vente InvoiceDateUsed=Date de facture utilisée -YourCompanyDoesNotUseVAT=Votre société/institution est définie comme non assujettie à la TVA (voir Accueil > Configuration > Société/Institution), aussi il n'y a pas d'option paramétrage de la TVA. +YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Setup - Company/Organization), so there is no VAT options to setup. AccountancyCode=Code comptable AccountancyCodeSell=Code comptable vente AccountancyCodeBuy=Code comptable achat @@ -1636,7 +1641,7 @@ ProjectsSetup=Configuration du module Projets ProjectsModelModule=Modèles de document de rapport projets TasksNumberingModules=Modèles de numérotation des références tâches TaskModelModule=Modèles de document de rapport tâches -UseSearchToSelectProject=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des projets (Cela peut augmenter les performances si vous avez un grand nombre de projets) +UseSearchToSelectProject=Attendre que vous ayez appuyé sur une touche avant de charger le contenu de la liste déroulante des projets (Cela peut augmenter les performances si vous avez un grand nombre de projets, mais cela est moins convivial) ##### ECM (GED) ##### ##### Fiscal Year ##### AccountingPeriods=Période fiscales @@ -1718,10 +1723,10 @@ MailToSendIntervention=Pour l'envoi de fiche intervention MailToSendSupplierRequestForQuotation=Pour l'envoi de demande de prix fournisseur MailToSendSupplierOrder=Pour l'envoi de commande fournisseur MailToSendSupplierInvoice=Pour l'envoi de facture fournisseur -MailToSendContract=Pour envoyer un contrat +MailToSendContract=Pour l'envoie depuis un contrat MailToThirdparty=Pour l'envoi depuis la fiche Tiers -MailToMember=Pour envoyer un e-mail depuis la fiche d'un adhérent -MailToUser=Pour envoyer un e-mail depuis la page utilisateur +MailToMember=Pour l'envoi depuis la fiche d'un adhérent +MailToUser=Pour l'envoi depuis la page utilisateur ByDefaultInList=Afficher par défaut sur les vues listes YouUseLastStableVersion=Vous utilisez la dernière version stable TitleExampleForMajorRelease=Exemple de message que vous pouvez utiliser pour annonce une nouvelle version majeure (n'hésitez pas à l'utilisez pour vos propres news) @@ -1768,9 +1773,11 @@ MAIN_PDF_MARGIN_LEFT=Marge gauche sur les PDF MAIN_PDF_MARGIN_RIGHT=Marge droite sur les PDF MAIN_PDF_MARGIN_TOP=Marge haute sur les PDF MAIN_PDF_MARGIN_BOTTOM=Marge bas sur les PDF +SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups +EnterCalculationRuleIfPreviousFieldIsYes=Enter calculcation rule if previous field was set to Yes (For example 'CODEGRP1+CODEGRP2') ##### Resource #### ResourceSetup=Configuration du module Ressource UseSearchToSelectResource=Utilisez un champ avec auto-complétion pour choisir les ressources (plutôt qu'une liste déroulante). -DisabledResourceLinkUser=Supprimer le lien entre la ressource et l'utilisateur -DisabledResourceLinkContact=Désactiver le lient entre la ressource et le contact/adresse +DisabledResourceLinkUser=Disable feature to link a resource to users +DisabledResourceLinkContact=Disable feature to link a resource to contacts ConfirmUnactivation=Confirmer réinitialisation du module diff --git a/htdocs/langs/fr_FR/paypal.lang b/htdocs/langs/fr_FR/paypal.lang index e4bd2341c06..dded657e3d6 100644 --- a/htdocs/langs/fr_FR/paypal.lang +++ b/htdocs/langs/fr_FR/paypal.lang @@ -14,7 +14,7 @@ PaypalModeOnlyPaypal=PayPal seul ONLINE_PAYMENT_CSS_URL=URL optionnelle de la feuille de style CSS sur la page de paiement en ligne ThisIsTransactionId=Voici l'identifiant de la transaction: %s PAYPAL_ADD_PAYMENT_URL=Ajouter l'URL de paiement Paypal lors de l'envoi d'un document par email -PredefinedMailContentLink=Vous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement (Paypal) si ce dernier n'a pas encore été fait.\n\n%s\n\n +PredefinedMailContentLink=Vous pouvez cliquer sur le lien sécurisé ci-dessous pour effectuer votre paiement si ce dernier n'a pas encore été fait:

%s

YouAreCurrentlyInSandboxMode=Vous travaillez actuellement dans le mode "bac à sable" de %s NewOnlinePaymentReceived=Nouveau paiement en ligne reçu NewOnlinePaymentFailed=Nouvelle tentative de paiement en ligne échouée @@ -30,3 +30,6 @@ ErrorCode=Code erreur ErrorSeverityCode=Code d'erreur sévérité OnlinePaymentSystem=Système de paiement en ligne PaypalLiveEnabled=Paypal live activé (sinon mode test/bac à sable) +PaypalImportPayment=Import Paypal payments +PostActionAfterPayment=Post actions after payments +ARollbackWasPerformedOnPostActions=A rollback was performed on all Post actions. You must complete post actions manually if they are necessary. diff --git a/htdocs/langs/pt_BR/accountancy.lang b/htdocs/langs/pt_BR/accountancy.lang index 82f62863844..ad4c29a5c0f 100644 --- a/htdocs/langs/pt_BR/accountancy.lang +++ b/htdocs/langs/pt_BR/accountancy.lang @@ -109,7 +109,6 @@ ACCOUNTING_PRODUCT_BUY_ACCOUNT=Conta contábil padrão para produtos comprados ( ACCOUNTING_PRODUCT_SOLD_ACCOUNT=Conta contábil padrão para os produtos vendidos (usado se não estiver definido na folha do produto) ACCOUNTING_SERVICE_BUY_ACCOUNT=Conta contábil padrão para os serviços comprados (se não for definido na listagem de serviços) ACCOUNTING_SERVICE_SOLD_ACCOUNT=Conta contábil padrão para os serviços vendidos (se não for definido na listagem de serviços) -Code_tiers=Terceiro LabelAccount=Conta rótulo LabelOperation=Operação de etiqueta Sens=Significado diff --git a/htdocs/langs/pt_BR/admin.lang b/htdocs/langs/pt_BR/admin.lang index d686d50cace..c88cca519b6 100644 --- a/htdocs/langs/pt_BR/admin.lang +++ b/htdocs/langs/pt_BR/admin.lang @@ -353,7 +353,6 @@ ExtrafieldParamHelpsellist=Lista de valores oriundos de uma tabela
Sintaxe : ExtrafieldParamHelpchkbxlst=A lista de valores oriundos de uma tabela
Sintaxe : table_name:label_field:id_field::filter
Exemplo : c_typent:libelle:id::filter

o filtro pode ser um teste simples (ex. ativo=1) para exibir somente valores ativos
Você também pode usar $ID$ no filtro que é a id atual do objeto atual
Para realizar uma SELEÇÃO no filtro, use $SEL$
Se você deseja filtrar nos campos extras, use a sintaxe extra.fieldcode=... (onde o código do campo é o código do campo extra)

A fim de ter a lista dependendo de uma outra lista de atributos complementares :
c_typent:libelle:id:options_parent_list_code|parent_column:filter

A fim de ter a lista dependendo de uma outra lista :
c_typent:libelle:id:parent_list_code|parent_column:filter ExtrafieldParamHelplink=Os parâmetros devem ser ObjectName:Classpath
Sintaxe: ObjectName:Classpath
Exemplos:
Societe:societe/class/societe.class.php
Contact:contact/class/contact.class.php LibraryToBuildPDF=Biblioteca usada para a geração de PDF -WarningUsingFPDF=Aviso: Sua conf.php Contém diretrize dolibarr_pdf_force_fpdf=1. Isso significa que você usa a biblioteca FPDF para gerar arquivos em PDF. Essa biblioteca é velha e não suporta muitas novas funções (Unicode, imagem transparente, cyrillic, línguas arábicas e asiáticas,...), portanto pode ocorrer alguns erros durante a geração de PDF.
Para corrigir esse problema e ter todo o suporte na geração de PDF, baixe Biblioteca TCPDF, então comente ou remova essa linha $dolibarr_pdf_force_fpdf=1, e adicione essa $dolibarr_lib_TCPDF_PATH='path_to_TCPDF_dir' LocalTaxDesc=Alguns paises aplicam de 2 a 3 taxas em cada linha de fatura. Se for esse caso, escolha o tipo de segunda e terceira taxa. Os possíveis tipos são:
1 : Taxa local aplicam em produtos e serviços sem ICMS (ICMS não é aplicada em taxa local)
2 : Taxa local aplicam em produtos e serviços antes do ICMS (ICMS é calculado no montante + taxa local)
3 : Taxa local aplicam em produtos sem o ICMS (ICMS não é aplicada na taxa local)
4 : Taxa local aplicam nos produtos antes do ICMS (ICMS é calculado no montante + taxa local)
5 : Taxa local aplicam no serviço sem o ICMS (ICMS não é aplicado em taxa local)
6 : Taxa local aplicam em serviços antes do ICMS (ICMS é calculado no montante + taxa local) LinkToTestClickToDial=Entre com um número telefônico para chamar e mostrar um link que testar a URL CliqueParaDiscar para usuário %s RefreshPhoneLink=Atualizar link diff --git a/htdocs/langs/pt_BR/members.lang b/htdocs/langs/pt_BR/members.lang index 4197d9375a0..8d541fe0e14 100644 --- a/htdocs/langs/pt_BR/members.lang +++ b/htdocs/langs/pt_BR/members.lang @@ -60,8 +60,6 @@ LastSubscriptionsModified=Últimas %s subscrições modificadas PublicMemberCard=Ficha pública membro SubscriptionNotRecorded=Subscrição não registrada AddSubscription=Criar subscripção -DescADHERENT_AUTOREGISTER_MAIL_SUBJECT=Assunto do email em caso de inscrição automática -DescADHERENT_AUTOREGISTER_MAIL=Email a enviar em caso de convite para inscrição automática DescADHERENT_ETIQUETTE_TEXT=Texto impresso em folhas de endereço de membros DescADHERENT_CARD_TYPE=Formato da página fichas DescADHERENT_CARD_HEADER_TEXT=Texto a imprimir na parte superior do cartão de membro From 639d8ce9ef47b86a7f8f05b0198a1b9e41cd9cd9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 18:09:55 +0100 Subject: [PATCH 39/53] Fix link replacement --- htdocs/core/class/html.formmail.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 4625e6ea0ee..4309c689b9e 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -877,11 +877,11 @@ class FormMail extends Form require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; $langs->load('paypal'); $typeforonlinepayment='free'; - if ($this->param["models"]=='order_send') $typeforonlinepayment='order'; // TODO use detection on something else than template - if ($this->param["models"]=='facture_send') $typeforonlinepayment='invoice'; // TODO use detection on something else than template - if ($this->param["models"]=='member_send') $typeforonlinepayment='member'; // TODO use detection on something else than template + if ($this->param["models"]=='order' || $this->param["models"]=='order_send') $typeforonlinepayment='order'; // TODO use detection on something else than template + if ($this->param["models"]=='invoice' || $this->param["models"]=='facture_send') $typeforonlinepayment='invoice'; // TODO use detection on something else than template + if ($this->param["models"]=='member') $typeforonlinepayment='member'; // TODO use detection on something else than template $url=getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']); - $paymenturl=$url; + $paymenturl=$url; } $this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']=($paymenturl?$langs->trans("PredefinedMailContentLink", $paymenturl):''); $this->substit['__ONLINE_PAYMENT_URL__']=$paymenturl; From 53edb86ffb908cb379cbf5e89d5a012a382cf968 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 19:35:25 +0100 Subject: [PATCH 40/53] Make sending of email for member module ok with new email template archi --- htdocs/adherents/card.php | 133 +++++++++++++++--- htdocs/adherents/class/adherent.class.php | 3 +- .../adherents/class/adherent_type.class.php | 24 ++-- htdocs/adherents/subscription.php | 57 +++++++- htdocs/core/class/html.form.class.php | 2 +- .../core/class/html.formticketsup.class.php | 10 +- htdocs/core/lib/member.lib.php | 2 + htdocs/core/tpl/notes.tpl.php | 4 +- htdocs/public/members/new.php | 41 +++++- htdocs/public/payment/paymentok.php | 28 +++- htdocs/theme/eldy/style.css.php | 3 +- htdocs/theme/md/style.css.php | 3 +- 12 files changed, 252 insertions(+), 58 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 41a49bd386d..2e1526c89cb 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -238,21 +238,6 @@ if (empty($reshook)) } } - /* - if ($action == 'confirm_sendinfo' && $confirm == 'yes') - { - if ($object->email) - { - $from=$conf->email_from; - if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM; - - $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); - - $langs->load("mails"); - setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs'); - } - }*/ - if ($action == 'update' && ! $cancel && $user->rights->adherent->creer) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -630,7 +615,34 @@ if (empty($reshook)) // Send confirmation email (according to parameters of member type. Otherwise generic) if ($object->email && GETPOST("send_mail")) { - $result=$object->send_an_email($adht->getMailOnValid(),$conf->global->ADHERENT_MAIL_VALID_SUBJECT,array(),array(),array(),"","",0,2); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs); + + $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, 2); if ($result < 0) { $error++; @@ -674,7 +686,34 @@ if (empty($reshook)) { if ($object->email && GETPOST("send_mail")) { - $result=$object->send_an_email($adht->getMailOnResiliate(),$conf->global->ADHERENT_MAIL_RESIL_SUBJECT,array(),array(),array(),"","",0,-1); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs); + + $result=$object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1); } if ($result < 0) { @@ -1350,8 +1389,32 @@ else $adht = new AdherentType($db); $adht->fetch($object->typeid); - $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_VALID_SUBJECT); - $texttosend=$object->makeSubstitution($adht->getMailOnValid()); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnValid()), $substitutionarray, $outputlangs); $tmp=$langs->trans("SendingAnEMailToMember"); $tmp.='
'.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; @@ -1375,7 +1438,7 @@ else if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); } - print $form->formconfirm("card.php?rowid=".$id,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1,1); + print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ValidateMember"), $langs->trans("ConfirmValidateMember"), "confirm_valid", $formquestion, '1', 1, 220); } // Confirm send card by mail @@ -1392,8 +1455,32 @@ else $adht = new AdherentType($db); $adht->fetch($object->typeid); - $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_RESIL_SUBJECT); - $texttosend=$object->makeSubstitution($adht->getMailOnResiliate()); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnResiliate()), $substitutionarray, $outputlangs); $tmp=$langs->trans("SendingAnEMailToMember"); $tmp.='
('.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; @@ -1623,7 +1710,7 @@ else $parameters = array(); $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been if (empty($reshook)) { - if ($action != 'valid' && $action != 'editlogin' && $action != 'editthirdparty') + if ($action != 'editlogin' && $action != 'editthirdparty') { // Send if ($object->statut == 1) { diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3ef7af75ceb..5323355eb11 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2556,7 +2556,7 @@ class Adherent extends CommonObject // Send reminder email include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + $formmail=new FormMail($db); $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); @@ -2578,6 +2578,7 @@ class Adherent extends CommonObject $from = $conf->global->ADHERENT_MAIL_FROM; $to = $adherent->email; + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $cmail = new CMailFile($subject, $to, $from, $msg, array(), array(), array(), '', '', 0, 1); $result = $cmail->sendfile(); if (! $result) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 71f18f01e4a..2393d5dad3b 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -499,7 +499,7 @@ class AdherentType extends CommonObject /** * getMailOnValid * - * @return string Return mail model + * @return string Return mail content of type or empty */ function getMailOnValid() { @@ -509,16 +509,14 @@ class AdherentType extends CommonObject { return $this->mail_valid; } - else - { - return $conf->global->ADHERENT_MAIL_VALID; - } + + return ''; } /** * getMailOnSubscription * - * @return string Return mail model + * @return string Return mail content of type or empty */ function getMailOnSubscription() { @@ -529,16 +527,14 @@ class AdherentType extends CommonObject { return $this->mail_subscription; } - else - { - return $conf->global->ADHERENT_MAIL_COTIS; - } + + return ''; } /** * getMailOnResiliate * - * @return string Return mail model + * @return string Return mail model content of type or empty */ function getMailOnResiliate() { @@ -549,10 +545,8 @@ class AdherentType extends CommonObject { return $this->mail_resiliate; } - else - { - return $conf->global->ADHERENT_MAIL_RESIL; - } + + return ''; } } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 9d164307e91..3e4af5438c6 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -349,8 +349,32 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && ! // Send confirmation Email if ($object->email && $sendalsoemail) { - $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT); - $texttosend=$object->makeSubstitution($adht->getMailOnSubscription()); + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs); // Attach a file ? $file=''; @@ -1018,8 +1042,33 @@ if ($rowid > 0) $adht = new AdherentType($db); $adht->fetch($object->typeid); - $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_COTIS_SUBJECT); - $texttosend=$object->makeSubstitution($adht->getMailOnSubscription()); + // Send subscription email + $subject = ''; + $msg= ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail=new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + $outputlangs->loadLangs(array("main", "members")); + // Get email content fro mtemplae + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; + + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnSubscription()), $substitutionarray, $outputlangs); $tmp='global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?' checked':'')).'>'; $helpcontent=''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8c575b6478e..8e9fa3bec4e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3597,7 +3597,7 @@ class Form * @param string $action Action * @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , )) * type can be 'hidden', 'text', 'password', 'checkbox', 'radio', 'date', ... - * @param string $selectedchoice "" or "no" or "yes" + * @param string $selectedchoice '' or 'no' or 'yes' or '1' or '0' * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int $height Force height of box * @param int $width Force width of box ('999' or '90%'). Ignored and forced to 90% on smartphones. diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 3310b83eb09..b86ebc95442 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -808,7 +808,7 @@ class FormTicketsup // External users can't send message email - if ($user->rights->ticketsup->write && !$user->societe_id) { + if ($user->rights->ticketsup->write && !$user->socid) { print '
"; } - if (!$user->societe_id) { + if (! $user->socid) { print ''; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8e9fa3bec4e..466faba295e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6462,7 +6462,7 @@ class Form else if ($object->element == 'member') { $fullname=$object->getFullName($langs); - if ($object->morphy == 'mor') { + if ($object->morphy == 'mor' && $object->societe) { $ret.= dol_htmlentities($object->societe) . ((! empty($fullname) && $object->societe != $fullname)?' ('.dol_htmlentities($fullname).')':''); } else { $ret.= dol_htmlentities($fullname) . ((! empty($object->societe) && $object->societe != $fullname)?' ('.dol_htmlentities($object->societe).')':''); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 1a7b336b4bc..4c244f9f403 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -397,7 +397,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) $stripeToken = GETPOST("stripeToken",'alpha'); $email = GETPOST("email",'alpha'); - $thirdparty_id=GETPOST('thirdparty_id', 'int'); + $thirdparty_id=GETPOST('thirdparty_id', 'int'); // Note that for payment following online registration for members, this is empty because thirdparty is created once payment is confirmed by paymentok.php $vatnumber = GETPOST('vatnumber','alpha'); dol_syslog("stripeToken = ".$stripeToken, LOG_DEBUG, 0, '_stripe'); @@ -419,7 +419,7 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) if ($thirdparty_id > 0) { - dol_syslog("Search existing customer profile for thirdparty_id=".$thirdparty_id, LOG_DEBUG, 0, '_stripe'); + dol_syslog("Search existing Stripe customer profile for thirdparty_id=".$thirdparty_id, LOG_DEBUG, 0, '_stripe'); $service = 'StripeTest'; $servicestatus = 0; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 7eb9aa95b75..4eb22707bef 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -281,6 +281,11 @@ if ($ispaymentok) if (in_array('MEM', array_keys($tmptag))) { + // Validate member + // Create subscription + // Create complementary actions (this include creation of thirdparty) + // Send confirmation email + $defaultdelay=1; $defaultdelayunit='y'; @@ -384,7 +389,9 @@ if ($ispaymentok) if (! $error) { - $result = $object->subscriptionComplementaryActions($crowid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom, $emetteur_banque, 1); + $autocreatethirdparty = 1; + + $result = $object->subscriptionComplementaryActions($crowid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom, $emetteur_banque, $autocreatethirdparty); if ($result < 0) { $error++; @@ -403,6 +410,49 @@ if ($ispaymentok) } } + if (! $error) + { + if ($paymentmethod == 'stripe' && $autocreatethirdparty && $option == 'bankviainvoice') + { + $thirdparty_id = $object->fk_soc; + + dol_syslog("Search existing Stripe customer profile for thirdparty_id=".$thirdparty_id, LOG_DEBUG, 0, '_stripe'); + + $service = 'StripeTest'; + $servicestatus = 0; + if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox','alpha')) + { + $service = 'StripeLive'; + $servicestatus = 1; + } + $stripeacc = null; // No Oauth/connect use for public pages + + $thirdparty = new Societe($db); + $thirdparty->fetch($thirdparty_id); + + include_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php'; + $stripe = new Stripe($db); + $customer = $stripe->customerStripe($thirdparty, $stripeacc, $servicestatus, 0); + + if (! $customer && $TRANSACTIONID) // Not linked to a stripe customer, we make the link + { + $ch = \Stripe\Charge::retrieve($TRANSACTIONID); // contains the charge id + $stripecu = $ch->customer; // value 'cus_....' + + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "societe_account (fk_soc, login, key_account, site, status, entity, date_creation, fk_user_creat)"; + $sql .= " VALUES (".$object->fk_soc.", '', '".$db->escape($stripecu)."', 'stripe', " . $servicestatus . ", " . $conf->entity . ", '".$db->idate(dol_now())."', 0)"; + $resql = $db->query($sql); + if (! $resql) + { + $error++; + $errmsg='Failed to save customer stripe id in database ; '.$db->lasterror(); + $postactionmessages[] = $errmsg; + $ispostactionok = -1; + } + } + } + } + if (! $error) { $db->commit(); From ab4f66009a1b61dc2ad846f956763d854c02bbbc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Mar 2018 00:00:35 +0100 Subject: [PATCH 43/53] Translation --- htdocs/langs/fr_FR/ticketsup.lang | 301 ++++++++++++++++++++++++++++++ 1 file changed, 301 insertions(+) create mode 100644 htdocs/langs/fr_FR/ticketsup.lang diff --git a/htdocs/langs/fr_FR/ticketsup.lang b/htdocs/langs/fr_FR/ticketsup.lang new file mode 100644 index 00000000000..2e5ce95a235 --- /dev/null +++ b/htdocs/langs/fr_FR/ticketsup.lang @@ -0,0 +1,301 @@ +# en_US lang file for module ticketsup +# Copyright (C) 2013 Jean-François FERRY +# +# 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 3 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, see . + +# +# Generic +# + +Module56000Name=Billets +Module56000Desc=Système de ticket pour de l'assistance ou une demande d'accompagnement + +Permission56001=Voir tickets +Permission56002=Modifier des billets +Permission56003=Supprimer tickets +Permission56004=Gérer les tickets +Permission56005=Voir les tickets de tous les tiers (sauf pour les utilisateurs externes, toujours limité au tiers dont ils dépendent) + +TicketsupDictType=Type de ticket +TicketsupDictCategory=Catégories de tickets +TicketsupDictSeverity=Sévérité des tickets +TicketTypeShortBUGSOFT=Dysfonctionnement logiciel +TicketTypeShortBUGHARD=Dysfonctionnement matériel +TicketTypeShortCOM=Question commerciale +TicketTypeShortINCIDENT=Demande d'assistance +TicketTypeShortPROJET=Projet +TicketTypeShortOTHER=Autre + +TicketSeverityShortLOW=Faible +TicketSeverityShortNORMAL=Normal +TicketSeverityShortHIGH=Élevé +TicketSeverityShortBLOCKING=Critique/Bloquant + +ErrorBadEmailAddress=Field '%s' incorrect +MenuTicketsupMyAssign=Mes tickets +MenuTicketsupMyAssignNonClosed=Mes tickets ouverts +MenuListNonClosed=Tickets non fermés + +TypeContact_ticketsup_internal_CONTRIBUTOR=Contributeur +TypeContact_ticketsup_internal_SUPPORTTEC=Utilisateur assigné +TypeContact_ticketsup_external_SUPPORTCLI=Customer contact / incident tracking +TypeContact_ticketsup_external_CONTRIBUTOR=External contributor + +Notify_TICKETMESSAGE_SENTBYMAIL=Envoyée la réponse par email + +# Status +NotRead=Non lu +Read=Lu +Answered=Répondu +Assigned=assigné +InProgress=En cours +Waiting=En attente +Closed=Fermé +Deleted=Supprimé + +# Dict +Type=Type +Category=Catégorie +Severity=Sévérité + +# Email templates +MailToSendTicketsupMessage=To send email from ticket message + +# +# Admin page +# +TicketsupSetup=Ticket module setup +TicketSupSettings=Paramètres +TicketsupSetupPage= +TicketsupPublicAccess=A public interface requiring no identification is available at the following url +TicketsupSetupDictionaries=The type of application categories and severity level are configurable from dictionaries +TicketParamModule=Module variable setup +TicketParamMail=Email setup +TicketEmailNotificationFrom=Notification email from +TicketEmailNotificationFromHelp=Used into ticket message answer by example +TicketEmailNotificationTo=Notifications email to +TicketEmailNotificationToHelp=Send email notifications to this address. +TicketNewEmailBodyLabel=Text message sent after creating a ticket (public interface) +TicketNewEmailBodyHelp=The text specified here will be inserted into the email confirming the creation of a new ticket from the public interface. Information on the consultation of the ticket are automatically added. +TicketParamPublicInterface=Configuration de l'interface publique\n +TicketsEmailMustExist=Une adresse mail existante est requise pour créer un ticket +TicketsEmailMustExistHelp=Pour accéder à l'interface publique et créer un nouveau ticket, votre compte doit déjà être existant. +PublicInterface=Interface publique +TicketUrlPublicInterfaceLabelAdmin=URL interface publique +TicketUrlPublicInterfaceHelpAdmin=It is possible to define an alias to the web server and thus make available the public interface to another IP address. +TicketPublicInterfaceTextHomeLabelAdmin=Texte de bienvenu dans l'interface publique +TicketPublicInterfaceTextHome=You can create a support ticket or view existing from its identifier tracking ticket. +TicketPublicInterfaceTextHomeHelpAdmin=The text defined here will appear on the home page of the public interface. +TicketPublicInterfaceTopicLabelAdmin=Titre de l'interface +TicketPublicInterfaceTopicHelp=This text will appear as the title of the public interface. +TicketPublicInterfaceTextHelpMessageLabelAdmin=Help text to the message entry +TicketPublicInterfaceTextHelpMessageHelpAdmin=This text will appear above the message input area of the user. +ExtraFieldsTicketSup=Extra attributes +TicketSupCkEditorEmailNotActivated=HTML editor is not activated. Please put FCKEDITOR_ENABLE_MAIL contant equal to 1 +TicketsDisableEmail=Do not send ticket creation or message send emails +TicketsDisableEmailHelp=By default, emails are sent when new tickets or messages created. Enable this option to disable *all* email notifications +TicketsLogEnableEmail=Activer l'alerte par mail +TicketsLogEnableEmailHelp=A chaque changements, un email sera envoyé à chaque contact associé à ce ticket +TicketParams=Params +TicketsShowModuleLogo=Display the logo of the module in the public interface +TicketsShowModuleLogoHelp=Enable this option to hide the logo module in the pages of the public interface +TicketsShowCompanyLogo=Afficher le logo de la société dans l'interface publique +TicketsShowCompanyLogoHelp=Enable this option to hide the logo of the main company in the pages of the public interface +TicketsEmailAlsoSendToMainAddress=Also send notification to main email address +TicketsEmailAlsoSendToMainAddressHelp=Enable this option to send an email to "Notification email from" address (see setup below) +TicketsShowExtrafieldsIntoPublicArea=Show Extras fields in the public interface +TicketsShowExtrafieldsIntoPublicAreaHelp=When this option is enabled, additional attributes defined on the tickets will be shown in the public interface of ticket creation. +TicketsLimitViewAssignedOnly=Restrict the display to tickets assigned to the current user (not effective for external users, always be limited to the thirdparty they depend on) +TicketsLimitViewAssignedOnlyHelp=Seuls les tickets affectés à l'utilisateur actuel seront visibles. Ne s'applique pas à un utilisateur disposant de droits de gestion des tickets. +TicketsActivatePublicInterface=Activer l'interface publique +TicketsActivatePublicInterfaceHelp=Public interface allow any visitors to create tickets. +TicketsAutoAssignTicket=Automatically assign the user who created the ticket +TicketsAutoAssignTicketHelp=When creating a ticket, the user can be automatically assigned to the ticket. +TicketSupNumberingModules=Tickets numbering module +TicketNotNotifyTiersAtCreate=Do not notify the company to the creation + +# +# About page +# +About=À propos +TicketSupAbout=À propos du module Ticket +TicketSupAboutModule=The development of this module has been initiated by the company Libr&thic. +TicketSupAboutModuleHelp=You can get help by using the contact form on the website librethic.io +TicketSupAboutModuleImprove=Feel free to suggest improvements! Please visit the project page on Doliforge website to report bugs and add tasks. +TicketSupAboutModuleThanks=Thanks to nwa who creates icons for this module./ + +# +# Index & list page +# +TicketsIndex=Accueil +TicketList=Liste des tickets +TicketAssignedToMeInfos=Cette page présente la liste des tickets assignés à l'utilisateur actuel +NoTicketsFound=Aucun ticket trouvé +TicketViewAllTickets=Voir tous les tickets +TicketViewNonClosedOnly=Voir seulement les tickets non fermés +TicketStatByStatus=Billets par statut + +# +# Ticket card +# +Ticketsup=Incident ticket +TicketCard=Ticket card +CreateTicket=Créez un nouveau billet +EditTicket=Modifier un billet +TicketsManagement=Gestion de billets +CreatedBy=Créé par +NewTicket=Nouveau ticket +SubjectAnswerToTicket=Réponse ticket +TicketTypeRequest=Request type +TicketCategory=Catégorie +SeeTicket=Voir le ticket +TicketMarkedAsRead=Le ticket a été marqué comme lu +TicketReadOn=Read on +TicketCloseOn=Fermé le +UserAssignedTo=Utilisateur assigné +MarkAsRead=Mark ticket as read +TicketMarkedAsReadButLogActionNotSaved=Ticket marked as closed but no action saved +TicketHistory=Historique de billets +AssignUser=Assign to user +TicketAssigned=Le ticket est à présent assigné +TicketChangeType=Change type +TicketChangeCategory=Changer la catégorie +TicketChangeSeverity=Changer la sévérité +TicketAddMessage=Ajouter un message +TicketEditProperties=Éditer les propriétés +AddMessage=Ajouter un message +MessageSuccessfullyAdded=Ticket créé +TicketMessageSuccessfullyAdded=Message ajouté avec succès +TicketMessagesList=Message list +NoMsgForThisTicket=Pas de message pour ce ticket +Properties=Classification +LatestNewTickets=Last %s tickets newest (not read) +TicketSeverity=Sévérité +ShowTicket=Voir le ticket +RelatedTickets=Tickets liés +TicketAddIntervention=Créer intervention +CloseTicket=Fermer le ticket +CloseATicket=Fermer un billet +ConfirmCloseAticket=Confirmer la fermeture du ticket +ConfirmDeleteTicket=Confirmez la suppression du ticket +TicketDeletedSuccess=Ticket supprimé avec succès +TicketMarkedAsClosed=Ticket indiqué fermé +TicketMarkedAsClosedButLogActionNotSaved=Ticket marqué comme fermé mais pas commenté ! +TicketDurationAuto=Durée calculée +TicketDurationAutoInfos=Duration calculated automatically from intervention related +TicketUpdated=Ticket mis à jour +SendMessageByEmail=Envoyer ce message par email +TicketNewMessage=Nouveau message +ErrorMailRecipientIsEmptyForSendTicketMessage=Recipient is empty. No email send +TicketGoIntoContactTab=Please go into "Contacts" tab to select them +TicketMessageMailIntro=Introduction +TicketMessageMailIntroHelp=This text is added only at the beginning of the email and will not be saved. +TicketMessageMailIntroLabelAdmin=Introduction to the message when sending email +TicketMessageMailIntroText=

Bonjour Une nouvelle réponse a été ajoutée à un ticket que vous suivez. Voici le message : +TicketMessageMailIntroHelpAdmin=This text will be inserted before the text of the response to a ticket. +TicketMessageMailSignature=Signature +TicketMessageMailSignatureHelp=This text is added only at the end of the email and will not be saved. +TicketMessageMailSignatureText=

Cordialement,

--

+TicketMessageMailSignatureLabelAdmin=Signature of response email +TicketMessageMailSignatureHelpAdmin=This text will be inserted after the response message. +TicketMessageHelp=Only this text will be saved in the message list on ticket card. +TicketMessageSubstitutionReplacedByGenericValues=Substitutions variables are replaced by generic values. +TicketTimeToRead=Time elapsed before ticket read +TicketContacts=Contacts ticket +TicketDocumentsLinked=Documents liés +ConfirmReOpenTicket=Voulez-vous ré-ouvrir ce ticket ? +TicketMessageMailIntroAutoNewPublicMessage=A new message was posted on the ticket with the subject %s : +TicketAssignedToYou=Ticket assigned +TicketAssignedEmailBody=You have been assigned the ticket #%s by %s +MarkMessageAsPrivate=Mark message as private +TicketMessagePrivateHelp=This message will not display to external users +TicketEmailOriginIssuer=Issuer at origin of the tickets +InitialMessage=Message initial +LinkToAContract=Link to a contract +TicketSupPleaseSelectAContract=Sélectionner un contrat +UnableToCreateInterIfNoSocid=Can not create a response file without defining a thirdparty +TicketMailExchanges=Mail exchanges +TicketInitialMessageModified=Message initial modifié +TicketMessageSuccesfullyUpdated=Message successfully updated +TicketChangeStatus=Changer l'état +TicketConfirmChangeStatus=Confirm the status change : %s ? +TicketLogStatusChanged=Status changed : %s to %s +TicketNotNotifyTiersAtCreate=Do not notify the company to the creation + +# +# Logs +# +TicketLogMesgReadBy=Ticket read by %s +NoLogForThisTicket=No log for this ticket yet +TicketLogAssignedTo=Ticket assigned to %s +TicketAssignedButLogActionNotSaved=Ticket assigned but no log saved ! +TicketLogPropertyChanged=Change classification : from %s to %s +TicketLogClosedBy=Ticket clôt par %s +TicketLogProgressSetTo=Progression de %s pour-cent appliquée +TicketLogReopen=Ticket ré-ouvert + +# +# Public pages +# +TicketSystem=Gestionnaire de tickets +ShowListTicketWithTrackId=Display ticket list from track ID +ShowTicketWithTrackId=Display ticket from track ID +TicketPublicDesc=You can create a support ticket or check from an existing ID. +YourTicketSuccessfullySaved=Le billet a été enregistré avec succès +MesgInfosPublicTicketCreatedWithTrackId=A new ticket has been created with ID %s. +PleaseRememberThisId=Merci de conserver le code de suivi du ticket, il vous sera peut-être nécessaire ultérieurement +TicketNewEmailSubject=Ticket creation confirmation +TicketNewEmailSubjectCustomer=New support ticket +TicketNewEmailBody=Ceci est un message automatique pour confirmer l'enregistrement de votre ticket. +TicketNewEmailBodyCustomer=This is an automatic email to confirm a new ticket has just been created into your account. +TicketNewEmailBodyInfosTicket=Information for monitoring the ticket +TicketNewEmailBodyInfosTrackId=Ticket tracking number : %s +TicketNewEmailBodyInfosTrackUrl=You can view the progress of the ticket by clicking the link above. +TicketNewEmailBodyInfosTrackUrlCustomer=You can view the progress of the ticket in the specific interface by clicking the following link +TicketEmailPleaseDoNotReplyToThisEmail=Merci de ne pas répondre directement à ce courriel ! Utilisez le lien pour répondre via l'interface. +TicketPublicInfoCreateTicket=This form allows you to record a trouble ticket in our management system. +TicketPublicPleaseBeAccuratelyDescribe=Veuillez décrire avec précision le problème. Fournissez le plus d'informations possibles pour nous permettre d'identifier correctement votre demande. +TicketPublicMsgViewLogIn=Merci d'entrer le code de suivi du ticket +TicketTrackId=Tracking ID +OneOfTicketTrackId=One of yours tracking ID +ErrorTicketNotFound=Ticket with tracking ID %s not found ! +Subject=Sujet +ViewTicket=Voir le ticket +ViewMyTicketList=Voir la liste de mes tickets +ErrorEmailMustExistToCreateTicket=Erreur : Email introuvable dans notre base de données +TicketNewEmailSubjectAdmin=Nouveau ticket créé +TicketNewEmailBodyAdmin=

Ticket has just been created with ID #%s, see informations :

+SeeThisTicketIntomanagementInterface=See ticket in management interface +TicketPublicInterfaceForbidden=Accès à cette partie : interdit + +# notifications +TicketNotificationEmailSubject=Ticket %s updated +TicketNotificationEmailBody=This is an automatic message to notify you that ticket %s has just been updated +TicketNotificationRecipient=Notification recipient +TicketNotificationLogMessage=Log message +TicketNotificationEmailBodyInfosTrackUrlinternal=View ticket into interface +TicketNotificationNumberEmailSent=Email de notification envoyé: %s + + +# +# Boxes +# +BoxLastTicketsup=Les derniers tickets +BoxLastTicketsupDescription=Last %s tickets saved +BoxLastTicketsupContent= +BoxLastTicketsupNoRecordedTickets=Pas de ticket non lu +BoxLastModifiedTicketsup=Last modified tickets +BoxLastModifiedTicketsupDescription=Last %s tickets modified +BoxLastModifiedTicketsupContent= +BoxLastModifiedTicketsupNoRecordedTickets=Pas de tickets modifiés récemment From f9ad2f7fb2dca564e6631a373398210774b3745f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Mar 2018 12:10:04 +0100 Subject: [PATCH 44/53] FIX Missing include --- htdocs/core/class/html.formaccounting.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 5fd67659e15..aaae010c2fe 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -24,6 +24,7 @@ * \ingroup Advanced accountancy * \brief File of class with all html predefined components */ +require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php'; /** From ab9edef3c7a0ff1ff14e9758fdaf3430b4eb5577 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Mar 2018 12:46:52 +0100 Subject: [PATCH 45/53] Fix external links ko when substitution key are inside domain --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/core/menus/standard/auguria_menu.php | 11 +++++++++-- htdocs/core/menus/standard/eldy_menu.php | 12 ++++++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index d71d41019c4..e18a0f111ff 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5987,8 +5987,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob } /** - * Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval). - * Texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced. + * Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval), + * and texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced. * Example of usage: * $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $thirdparty); * complete_substitutions_array($substitutionarray, $langs, $thirdparty); diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 080e9ef81dc..df31b9c9d8f 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -237,9 +237,16 @@ class MenuManager { $substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user); $substitarray['__USERID__'] = $user->id; // For backward compatibility - $val2['url'] = make_substitutions($val2['url'], $substitarray); + $val2['url'] = make_substitutions($val2['url'], $substitarray); // Make also substitution of __(XXX)__ and __[XXX]__ - $relurl2=dol_buildpath($val2['url'],1); + if (! preg_match("/^(http:\/\/|https:\/\/)/i", $val2['url'])) + { + $relurl2=dol_buildpath($val2['url'],1); + } + else + { + $relurl2=$val2['url']; + } $canonurl2=preg_replace('/\?.*$/','',$val2['url']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 9ef1421daf2..f81d7d36c72 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -185,6 +185,7 @@ class MenuManager $tmpleftmenu='all'; $submenu=new Menu(); print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu); // Fill $submenu (example with tmpmainmenu='home' tmpleftmenu='all', return left menu tree of Home) + // Note: $submenu contains menu entry with substitution not yet done //if ($tmpmainmenu.'-'.$tmpleftmenu == 'home-all') { var_dump($submenu); exit; } //if ($tmpmainmenu=='accountancy') { var_dump($submenu->liste); exit; } $nexturl=dol_buildpath($submenu->liste[0]['url'],1); @@ -247,9 +248,16 @@ class MenuManager { $substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user); $substitarray['__USERID__'] = $user->id; // For backward compatibility - $val2['url'] = make_substitutions($val2['url'], $substitarray); + $val2['url'] = make_substitutions($val2['url'], $substitarray); // Make also substitution of __(XXX)__ and __[XXX]__ - $relurl2=dol_buildpath($val2['url'],1); + if (! preg_match("/^(http:\/\/|https:\/\/)/i", $val2['url'])) + { + $relurl2=dol_buildpath($val2['url'],1); + } + else + { + $relurl2=$val2['url']; + } $canonurl2=preg_replace('/\?.*$/','',$val2['url']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; From a3c199e9e3e73422e27d1c8bc8e7e691ec4c03c9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Mar 2018 12:10:04 +0100 Subject: [PATCH 46/53] FIX Missing include --- htdocs/core/class/html.formaccounting.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 5fd67659e15..aaae010c2fe 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -24,6 +24,7 @@ * \ingroup Advanced accountancy * \brief File of class with all html predefined components */ +require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php'; /** From 224fa1c03ef58da99a9cb2e69a92ad564d821a7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Mar 2018 12:46:52 +0100 Subject: [PATCH 47/53] Fix external links ko when substitution key are inside domain --- htdocs/core/lib/functions.lib.php | 4 ++-- htdocs/core/menus/standard/auguria_menu.php | 11 +++++++++-- htdocs/core/menus/standard/eldy_menu.php | 12 ++++++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7cb2236524a..20ab5aad7a9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5650,8 +5650,8 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob } /** - * Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval). - * Texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced. + * Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newval), + * and texts like __(TranslationKey|langfile)__ and __[ConstantKey]__ are also replaced. * Example of usage: * $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $thirdparty); * complete_substitutions_array($substitutionarray, $langs, $thirdparty); diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php index 080e9ef81dc..df31b9c9d8f 100644 --- a/htdocs/core/menus/standard/auguria_menu.php +++ b/htdocs/core/menus/standard/auguria_menu.php @@ -237,9 +237,16 @@ class MenuManager { $substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user); $substitarray['__USERID__'] = $user->id; // For backward compatibility - $val2['url'] = make_substitutions($val2['url'], $substitarray); + $val2['url'] = make_substitutions($val2['url'], $substitarray); // Make also substitution of __(XXX)__ and __[XXX]__ - $relurl2=dol_buildpath($val2['url'],1); + if (! preg_match("/^(http:\/\/|https:\/\/)/i", $val2['url'])) + { + $relurl2=dol_buildpath($val2['url'],1); + } + else + { + $relurl2=$val2['url']; + } $canonurl2=preg_replace('/\?.*$/','',$val2['url']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index 9ef1421daf2..f81d7d36c72 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -185,6 +185,7 @@ class MenuManager $tmpleftmenu='all'; $submenu=new Menu(); print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu); // Fill $submenu (example with tmpmainmenu='home' tmpleftmenu='all', return left menu tree of Home) + // Note: $submenu contains menu entry with substitution not yet done //if ($tmpmainmenu.'-'.$tmpleftmenu == 'home-all') { var_dump($submenu); exit; } //if ($tmpmainmenu=='accountancy') { var_dump($submenu->liste); exit; } $nexturl=dol_buildpath($submenu->liste[0]['url'],1); @@ -247,9 +248,16 @@ class MenuManager { $substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user); $substitarray['__USERID__'] = $user->id; // For backward compatibility - $val2['url'] = make_substitutions($val2['url'], $substitarray); + $val2['url'] = make_substitutions($val2['url'], $substitarray); // Make also substitution of __(XXX)__ and __[XXX]__ - $relurl2=dol_buildpath($val2['url'],1); + if (! preg_match("/^(http:\/\/|https:\/\/)/i", $val2['url'])) + { + $relurl2=dol_buildpath($val2['url'],1); + } + else + { + $relurl2=$val2['url']; + } $canonurl2=preg_replace('/\?.*$/','',$val2['url']); //var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']); if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2=''; From 630ed04e174b81f3e76d7762a7d8d2658ba9e77d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Mar 2018 13:15:00 +0100 Subject: [PATCH 48/53] FIX missing properties in last contract list --- htdocs/comm/card.php | 92 ++++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 4f012710a39..7471c9da962 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -660,8 +660,6 @@ if ($object->id > 0) */ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { - $propal_static = new Propal($db); - $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht"; $sql.= ", p.tva as total_tva"; $sql.= ", p.total as total_ttc"; @@ -676,9 +674,9 @@ if ($object->id > 0) $resql=$db->query($sql); if ($resql) { - $var=true; - $num = $db->num_rows($resql); + $propal_static = new Propal($db); + $num = $db->num_rows($resql); if ($num > 0) { print '
'.$langs->trans('Label').'
'.$langs->trans('Label').'
'.$langs->trans('Description').''; $doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%'); $doleditor->Create(); From 700c69e127390cf31bafe053fc5e119ad5a3768a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 11:46:35 +0100 Subject: [PATCH 13/53] NEW Can set position of images in module tickets Mutualize code of method show_photo --- htdocs/core/ajax/row.php | 2 +- htdocs/core/class/commonobject.class.php | 240 +++++++++++++++++- htdocs/core/lib/functions.lib.php | 4 +- .../tpl/document_actions_post_headers.tpl.php | 4 +- htdocs/expedition/shipment.php | 2 +- htdocs/langs/en_US/main.lang | 3 +- htdocs/langs/en_US/ticketsup.lang | 1 - .../template/myobject_document.php | 4 +- .../product/actions_card_product.class.php | 2 +- .../service/actions_card_service.class.php | 2 +- htdocs/product/class/product.class.php | 230 +---------------- htdocs/product/document.php | 11 +- htdocs/ticketsup/card.php | 6 +- .../class/actions_ticketsup.class.php | 2 +- htdocs/ticketsup/class/ticketsup.class.php | 182 +------------ htdocs/ticketsup/contact.php | 6 +- htdocs/ticketsup/document.php | 51 ++-- htdocs/ticketsup/history.php | 6 +- htdocs/ticketsup/index.php | 5 +- htdocs/ticketsup/list.php | 11 +- htdocs/ticketsup/new.php | 5 +- 21 files changed, 302 insertions(+), 477 deletions(-) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 71a5a0aac88..4fe31ee7ae8 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -63,7 +63,7 @@ if ((isset($_POST['roworder']) && ! empty($_POST['roworder'])) && (isset($_POST[ $row->table_element_line = $table_element_line; $row->fk_element = $fk_element; $row->id = $element_id; - $row->line_ajaxorder($newrowordertab); // This update field rank or position in table table_element_line + $row->line_ajaxorder($newrowordertab); // This update field rank or position in table row->table_element_line // Reorder line to have position of children lines sharing same counter than parent lines // This should be useless because there is no need to have children sharing same counter than parent, but well, it's cleaner into database. diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8ec7fa36b73..d80c67a8aeb 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6004,7 +6004,7 @@ abstract class CommonObject { $labeltoshow = ''.$labeltoshow.''; } - + if (empty($onetrtd)) $out .= ''; else $out .= ''; @@ -6194,6 +6194,243 @@ abstract class CommonObject return $buyPrice; } + /** + * Show photos of an object (nbmax maximum), into several columns + * + * @param string $modulepart 'product', 'ticketsup', ... + * @param string $sdir Directory to scan (full absolute path) + * @param int $size 0=original size, 1='small' use thumbnail if possible + * @param int $nbmax Nombre maximum de photos (0=pas de max) + * @param int $nbbyrow Number of image per line or -1 to use div. Used only if size=1. + * @param int $showfilename 1=Show filename + * @param int $showaction 1=Show icon with action links (resize, delete) + * @param int $maxHeight Max height of original image when size='small' (so we can use original even if small requested). If 0, always use 'small' thumb image. + * @param int $maxWidth Max width of original image when size='small' + * @param int $nolink Do not add a href link to view enlarged imaged into a new tab + * @param int $notitle Do not add title tag on image + * @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead) + * @return string Html code to show photo. Number of photos shown is saved in this->nbphoto + */ + function show_photos($modulepart, $sdir, $size=0, $nbmax=0, $nbbyrow=5, $showfilename=0, $showaction=0, $maxHeight=120, $maxWidth=160, $nolink=0, $notitle=0, $usesharelink=0) + { + global $conf,$user,$langs; + + include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; + include_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; + + $sortfield='position_name'; + $sortorder='asc'; + + $dir = $sdir . '/'; + $pdir = '/'; + if ($modulepart == 'ticketsup') + { + $dir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->track_id.'/'; + $pdir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->track_id.'/'; + } + else + { + $dir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->ref.'/'; + $pdir .= get_exdir(0, 0, 0, 0, $this, $modulepart).$this->ref.'/'; + } + + // For backward compatibility + if ($modulepart == 'product' && ! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) + { + $dir = $sdir . '/'. get_exdir($this->id,2,0,0,$this,$modulepart) . $this->id ."/photos/"; + $pdir = '/' . get_exdir($this->id,2,0,0,$this,$modulepart) . $this->id ."/photos/"; + } + + // Defined relative dir to DOL_DATA_ROOT + $relativedir = ''; + if ($dir) + { + $relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $dir); + $relativedir = preg_replace('/^[\\/]/','',$relativedir); + $relativedir = preg_replace('/[\\/]$/','',$relativedir); + } + + $dirthumb = $dir.'thumbs/'; + $pdirthumb = $pdir.'thumbs/'; + + $return =''."\n"; + $nbphoto=0; + + $filearray=dol_dir_list($dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + + /*if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs + { + $filearrayold=dol_dir_list($dirold,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); + $filearray=array_merge($filearray, $filearrayold); + }*/ + + completeFileArrayWithDatabaseInfo($filearray, $relativedir); + + if (count($filearray)) + { + if ($sortfield && $sortorder) + { + $filearray=dol_sort_array($filearray, $sortfield, $sortorder); + } + + foreach($filearray as $key => $val) + { + $photo=''; + $file = $val['name']; + + //if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory + + //if (dol_is_file($dir.$file) && image_format_supported($file) >= 0) + if (image_format_supported($file) >= 0) + { + $nbphoto++; + $photo = $file; + $viewfilename = $file; + + if ($size == 1 || $size == 'small') { // Format vignette + + // Find name of thumb file + $photo_vignette=basename(getImageFileNameForSize($dir.$file, '_small')); + if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette=''; + + // Get filesize of original file + $imgarray=dol_getImageSize($dir.$photo); + + if ($nbbyrow > 0) + { + if ($nbphoto == 1) $return.= ''; + + if ($nbphoto % $nbbyrow == 1) $return.= ''; + $return.= ''; + if (($nbphoto % $nbbyrow) == 0) $return.= ''; + } + else if ($nbbyrow < 0) $return.=''; + } + + if (empty($size)) { // Format origine + $return.= ''; + + if ($showfilename) $return.= '
'.$viewfilename; + if ($showaction) + { + // Special case for product + if ($modulepart == 'product' && ($user->rights->produit->creer || $user->rights->service->creer)) + { + // Link to resize + $return.= ''.img_picto($langs->trans("Resize"), 'resize', '').'   '; + + // Link to delete + $return.= ''; + $return.= img_delete().''; + } + } + } + + // On continue ou on arrete de boucler ? + if ($nbmax && $nbphoto >= $nbmax) break; + } + } + + if ($size==1 || $size=='small') + { + if ($nbbyrow > 0) + { + // Ferme tableau + while ($nbphoto % $nbbyrow) + { + $return.= ''; + $nbphoto++; + } + + if ($nbphoto) $return.= '
'; + } + else if ($nbbyrow < 0) $return .= '
'; + + $return.= "\n"; + + $relativefile=preg_replace('/^\//', '', $pdir.$photo); + if (empty($nolink)) + { + $urladvanced=getAdvancedPreviewUrl($modulepart, $relativefile, 0, 'entity='.$this->entity); + if ($urladvanced) $return.=''; + else $return.= ''; + } + + // Show image (width height=$maxHeight) + // Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine + $alt=$langs->transnoentitiesnoconv('File').': '.$relativefile; + $alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height']; + if ($notitle) $alt=''; + + if ($usesharelink) + { + if ($val['share']) + { + if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) + { + $return.= ''; + $return.= ''; + } + else { + $return.= ''; + $return.= ''; + } + } + else + { + $return.= ''; + $return.= ''; + } + } + else + { + if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) + { + $return.= ''; + $return.= ''; + } + else { + $return.= ''; + $return.= ''; + } + } + + if (empty($nolink)) $return.= ''; + $return.="\n"; + + if ($showfilename) $return.= '
'.$viewfilename; + if ($showaction) + { + $return.= '
'; + // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites + if ($photo_vignette && (image_format_supported($photo) > 0) && ($this->imgWidth > $maxWidth || $this->imgHeight > $maxHeight)) + { + $return.= ''.img_picto($langs->trans('GenerateThumb'),'refresh').'  '; + } + // Special cas for product + if ($modulepart == 'product' && ($user->rights->produit->creer || $user->rights->service->creer)) + { + // Link to resize + $return.= ''.img_picto($langs->trans("Resize"), 'resize', '').'   '; + + // Link to delete + $return.= ''; + $return.= img_delete().''; + } + } + $return.= "\n"; + + if ($nbbyrow > 0) + { + $return.= '
 
'; + } + } + } + + $this->nbphoto = $nbphoto; + + return $return; + } /** @@ -6228,7 +6465,6 @@ abstract class CommonObject else return false; } - /** * Function test if type is date * diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 746f6c55f13..6d57f7c34c3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1327,7 +1327,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $showimage=$object->is_photo_available($conf->product->multidir_output[$object->entity]); $maxvisiblephotos=(isset($conf->global->PRODUCT_MAX_VISIBLE_PHOTO)?$conf->global->PRODUCT_MAX_VISIBLE_PHOTO:5); if ($conf->browser->phone) $maxvisiblephotos=1; - if ($showimage) $morehtmlleft.='
'.$object->show_photos($conf->product->multidir_output[$object->entity],'small',$maxvisiblephotos,0,0,0,$width,0).'
'; + if ($showimage) $morehtmlleft.='
'.$object->show_photos('product', $conf->product->multidir_output[$object->entity],'small',$maxvisiblephotos,0,0,0,$width,0).'
'; else { if (!empty($conf->global->PRODUCT_NODISPLAYIFNOPHOTO)) { @@ -1346,7 +1346,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r $showimage=$object->is_photo_available($conf->ticketsup->dir_output.'/'.$object->track_id); $maxvisiblephotos=(isset($conf->global->TICKETSUP_MAX_VISIBLE_PHOTO)?$conf->global->TICKETSUP_MAX_VISIBLE_PHOTO:2); if ($conf->browser->phone) $maxvisiblephotos=1; - if ($showimage) $morehtmlleft.='
'.$object->show_photos($conf->ticketsup->dir_output,'small',$maxvisiblephotos,0,0,0,$width,0).'
'; + if ($showimage) $morehtmlleft.='
'.$object->show_photos('ticketsup', $conf->ticketsup->dir_output,'small',$maxvisiblephotos,0,0,0,$width,0).'
'; else { if (!empty($conf->global->TICKETSUP_NODISPLAYIFNOPHOTO)) { diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 8b24605607d..65312110cc9 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -86,8 +86,10 @@ $formfile->form_attach_new_file( $savingdocmask ); +// Drag and drop for up and down allowed on product, thirdparty, ... +// The drag and drop call the page core/ajax/row.php $disablemove=1; -if (in_array($modulepart, array('product', 'produit', 'societe', 'user'))) $disablemove=0; // Drag and drop for up and down allowed on product, thirdparty, ... +if (in_array($modulepart, array('product', 'produit', 'societe', 'user', 'ticketsup'))) $disablemove=0; // List of document $formfile->list_of_documents( diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index a9bb706c4d8..e3218d5f578 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -705,7 +705,7 @@ if ($id > 0 || ! empty($ref)) $text=$product_static->getNomUrl(1); $text.= ' - '.$label; $description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description)).'
'; - $description.= $product_static->show_photos($conf->product->multidir_output[$product_static->entity],1,1,0,0,0,80); + $description.= $product_static->show_photos('product', $conf->product->multidir_output[$product_static->entity], 1, 1, 0, 0, 0, 80); print $form->textwithtooltip($text,$description,3,'','',$i); // Show range diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index edcdb4ef791..a8bb2ad50fd 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -938,4 +938,5 @@ Annual=Annual Local=Local Remote=Remote LocalAndRemote=Local and Remote -KeyboardShortcut=Keyboard shortcut \ No newline at end of file +KeyboardShortcut=Keyboard shortcut +AssignedTo=Assigned to \ No newline at end of file diff --git a/htdocs/langs/en_US/ticketsup.lang b/htdocs/langs/en_US/ticketsup.lang index cabf1c39ec3..cd79202c7fa 100644 --- a/htdocs/langs/en_US/ticketsup.lang +++ b/htdocs/langs/en_US/ticketsup.lang @@ -163,7 +163,6 @@ SeeTicket=See ticket TicketMarkedAsRead=Ticket has been marked as read TicketReadOn=Read on TicketCloseOn=Clotured on -UserAssignedTo=User assigned MarkAsRead=Mark ticket as read TicketMarkedAsReadButLogActionNotSaved=Ticket marked as closed but no action saved TicketHistory=Ticket history diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 3462cde52d2..3d1580e1e3b 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -45,7 +45,7 @@ dol_include_once('/mymodule/class/myobject.class.php'); dol_include_once('/mymodule/lib/myobject.lib.php'); // Load traductions files requiredby by page -$langs->loadLangs(array("mymodule@mymodule","companies","other")); +$langs->loadLangs(array("mymodule@mymodule","companies","other","mails")); $action=GETPOST('action','aZ09'); @@ -68,6 +68,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; +//if (! $sortfield) $sortfield="position_name"; // Initialize technical objects $object=new MyObject($db); @@ -108,7 +109,6 @@ if ($object->id) /* * Show tabs */ - if (! empty($conf->notification->enabled)) $langs->load("mails"); $head = myobjectPrepareHead($object); dol_fiche_head($head, 'document', $langs->trans("MyObject"), -1, 'myobject@mymodule'); diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php index 09508f5c2cb..d7b91abe246 100644 --- a/htdocs/product/canvas/product/actions_card_product.class.php +++ b/htdocs/product/canvas/product/actions_card_product.class.php @@ -216,7 +216,7 @@ class ActionsCardProduct $this->tpl['nblignes'] = 4; if ($this->object->is_photo_available($conf->product->multidir_output[$this->object->entity])) { - $this->tpl['photos'] = $this->object->show_photos($conf->product->multidir_output[$this->object->entity],1,1,0,0,0,80); + $this->tpl['photos'] = $this->object->show_photos('product', $conf->product->multidir_output[$this->object->entity],1,1,0,0,0,80); } // Nature diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php index 171e3960299..ba43898724e 100644 --- a/htdocs/product/canvas/service/actions_card_service.class.php +++ b/htdocs/product/canvas/service/actions_card_service.class.php @@ -211,7 +211,7 @@ class ActionsCardService $this->tpl['nblignes'] = 4; if ($this->object->is_photo_available($conf->service->multidir_output[$this->object->entity])) { - $this->tpl['photos'] = $this->object->show_photos($conf->service->multidir_output[$this->object->entity],1,1,0,0,0,80); + $this->tpl['photos'] = $this->object->show_photos('product', $conf->service->multidir_output[$this->object->entity],1,1,0,0,0,80); } // Duration diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f4722b9158e..15651ca9130 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3559,7 +3559,7 @@ class Product extends CommonObject } if (! empty($this->entity)) { - $tmpphoto = $this->show_photos($conf->product->multidir_output[$this->entity],1,1,0,0,0,80); + $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80); if ($this->nbphoto > 0) $label .= '
' . $tmpphoto; } @@ -4133,234 +4133,6 @@ class Product extends CommonObject } - /** - * Show photos of a product (nbmax maximum), into several columns - * TODO Move this into html.formproduct.class.php - * - * @param string $sdir Directory to scan (full absolute path) - * @param int $size 0=original size, 1='small' use thumbnail if possible - * @param int $nbmax Nombre maximum de photos (0=pas de max) - * @param int $nbbyrow Number of image per line or -1 to use div. Used only if size=1. - * @param int $showfilename 1=Show filename - * @param int $showaction 1=Show icon with action links (resize, delete) - * @param int $maxHeight Max height of original image when size='small' (so we can use original even if small requested). If 0, always use 'small' thumb image. - * @param int $maxWidth Max width of original image when size='small' - * @param int $nolink Do not add a href link to view enlarged imaged into a new tab - * @param int $notitle Do not add title tag on image - * @param int $usesharelink Use the public shared link of image (if not available, the 'nophoto' image will be shown instead) - * @return string Html code to show photo. Number of photos shown is saved in this->nbphoto - */ - function show_photos($sdir,$size=0,$nbmax=0,$nbbyrow=5,$showfilename=0,$showaction=0,$maxHeight=120,$maxWidth=160,$nolink=0,$notitle=0,$usesharelink=0) - { - global $conf,$user,$langs; - - include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php'; - include_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; - - $sortfield='position_name'; - $sortorder='asc'; - - $dir = $sdir . '/'; - $pdir = '/'; - $dir .= get_exdir(0,0,0,0,$this,'product').$this->ref.'/'; - $pdir .= get_exdir(0,0,0,0,$this,'product').$this->ref.'/'; - - if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) - { - $dir = $sdir . '/'. get_exdir($this->id,2,0,0,$this,'product') . $this->id ."/photos/"; - $pdir = '/' . get_exdir($this->id,2,0,0,$this,'product') . $this->id ."/photos/"; - } - - // Defined relative dir to DOL_DATA_ROOT - $relativedir = ''; - if ($dir) - { - $relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT,'/').'/', '', $dir); - $relativedir = preg_replace('/^[\\/]/','',$relativedir); - $relativedir = preg_replace('/[\\/]$/','',$relativedir); - } - - $dirthumb = $dir.'thumbs/'; - $pdirthumb = $pdir.'thumbs/'; - - $return =''."\n"; - $nbphoto=0; - - $filearray=dol_dir_list($dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - - /*if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) // For backward compatiblity, we scan also old dirs - { - $filearrayold=dol_dir_list($dirold,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); - $filearray=array_merge($filearray, $filearrayold); - }*/ - - completeFileArrayWithDatabaseInfo($filearray, $relativedir); - - if (count($filearray)) - { - if ($sortfield && $sortorder) - { - $filearray=dol_sort_array($filearray, $sortfield, $sortorder); - } - - foreach($filearray as $key => $val) - { - $photo=''; - $file = $val['name']; - - //if (! utf8_check($file)) $file=utf8_encode($file); // To be sure file is stored in UTF8 in memory - - //if (dol_is_file($dir.$file) && image_format_supported($file) >= 0) - if (image_format_supported($file) >= 0) - { - $nbphoto++; - $photo = $file; - $viewfilename = $file; - - if ($size == 1 || $size == 'small') { // Format vignette - - // Find name of thumb file - $photo_vignette=basename(getImageFileNameForSize($dir.$file, '_small')); - if (! dol_is_file($dirthumb.$photo_vignette)) $photo_vignette=''; - - // Get filesize of original file - $imgarray=dol_getImageSize($dir.$photo); - - if ($nbbyrow > 0) - { - if ($nbphoto == 1) $return.= ''; - - if ($nbphoto % $nbbyrow == 1) $return.= ''; - $return.= ''; - if (($nbphoto % $nbbyrow) == 0) $return.= ''; - } - else if ($nbbyrow < 0) $return.=''; - } - - if (empty($size)) { // Format origine - $return.= ''; - - if ($showfilename) $return.= '
'.$viewfilename; - if ($showaction) - { - if ($user->rights->produit->creer || $user->rights->service->creer) - { - // Link to resize - $return.= ''.img_picto($langs->trans("Resize"), 'resize', '').'   '; - - // Link to delete - $return.= ''; - $return.= img_delete().''; - } - } - } - - // On continue ou on arrete de boucler ? - if ($nbmax && $nbphoto >= $nbmax) break; - } - } - - if ($size==1 || $size=='small') - { - if ($nbbyrow > 0) - { - // Ferme tableau - while ($nbphoto % $nbbyrow) - { - $return.= ''; - $nbphoto++; - } - - if ($nbphoto) $return.= '
'; - } - else if ($nbbyrow < 0) $return .= '
'; - - $return.= "\n"; - - $relativefile=preg_replace('/^\//', '', $pdir.$photo); - if (empty($nolink)) - { - $urladvanced=getAdvancedPreviewUrl('product', $relativefile, 0, 'entity='.$this->entity); - if ($urladvanced) $return.=''; - else $return.= ''; - } - - // Show image (width height=$maxHeight) - // Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine - $alt=$langs->transnoentitiesnoconv('File').': '.$relativefile; - $alt.=' - '.$langs->transnoentitiesnoconv('Size').': '.$imgarray['width'].'x'.$imgarray['height']; - if ($notitle) $alt=''; - - if ($usesharelink) - { - if ($val['share']) - { - if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) - { - $return.= ''; - $return.= ''; - } - else { - $return.= ''; - $return.= ''; - } - } - else - { - $return.= ''; - $return.= ''; - } - } - else - { - if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) - { - $return.= ''; - $return.= ''; - } - else { - $return.= ''; - $return.= ''; - } - } - - if (empty($nolink)) $return.= ''; - $return.="\n"; - - if ($showfilename) $return.= '
'.$viewfilename; - if ($showaction) - { - $return.= '
'; - // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites - if ($photo_vignette && (image_format_supported($photo) > 0) && ($this->imgWidth > $maxWidth || $this->imgHeight > $maxHeight)) - { - $return.= ''.img_picto($langs->trans('GenerateThumb'),'refresh').'  '; - } - if ($user->rights->produit->creer || $user->rights->service->creer) - { - // Link to resize - $return.= ''.img_picto($langs->trans("Resize"), 'resize', '').'   '; - - // Link to delete - $return.= ''; - $return.= img_delete().''; - } - } - $return.= "\n"; - - if ($nbbyrow > 0) - { - $return.= '
 
'; - } - } - } - - $this->nbphoto = $nbphoto; - - return $return; - } - - /** * Retourne tableau de toutes les photos du produit * diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 72312aa4643..93267538936 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -40,10 +40,10 @@ if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) $langs->load("other"); $langs->load("products"); -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action=GETPOST('action','alpha'); -$confirm=GETPOST('confirm','alpha'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action','alpha'); +$confirm= GETPOST('confirm','alpha'); // Security check $fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : '')); @@ -93,7 +93,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - //Delete line if product propal merge is linked to a file + // Delete line if product propal merge is linked to a file if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) { if ($action == 'confirm_deletefile' && $confirm == 'yes') @@ -346,7 +346,6 @@ if ($object->id) print ''; } } - } else { diff --git a/htdocs/ticketsup/card.php b/htdocs/ticketsup/card.php index 556ab3da79d..bb6b5804578 100644 --- a/htdocs/ticketsup/card.php +++ b/htdocs/ticketsup/card.php @@ -17,8 +17,8 @@ */ /** - * Card of ticket - * @ingroup ticketsup + * \file htdocs/ticketsup/card.php + * \ingroup ticketsup */ require '../main.inc.php'; @@ -343,7 +343,7 @@ if ($action == 'view' || $action == 'add_message' || $action == 'close' || $acti print '
' . $langs->trans("UserAssignedTo") . ''; + print '
' . $langs->trans("AssignedTo") . ''; if ($object->fk_user_assign > 0) { $userstat->fetch($object->fk_user_assign); print $userstat->getNomUrl(1); diff --git a/htdocs/ticketsup/class/actions_ticketsup.class.php b/htdocs/ticketsup/class/actions_ticketsup.class.php index 9a978e2e066..035b43ea1c6 100644 --- a/htdocs/ticketsup/class/actions_ticketsup.class.php +++ b/htdocs/ticketsup/class/actions_ticketsup.class.php @@ -335,7 +335,7 @@ class ActionsTicketsup /*if (! ($usertoassign > 0)) { $error++; - array_push($this->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("UserAssignedTo"))); + array_push($this->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("AssignedTo"))); $action = 'view'; }*/ diff --git a/htdocs/ticketsup/class/ticketsup.class.php b/htdocs/ticketsup/class/ticketsup.class.php index ced9ad3ff73..e201f1ab5bd 100644 --- a/htdocs/ticketsup/class/ticketsup.class.php +++ b/htdocs/ticketsup/class/ticketsup.class.php @@ -42,6 +42,10 @@ class Ticketsup extends CommonObject * @var string Name of table without prefix where object is stored */ public $table_element = 'ticketsup'; + /** + * @var string Name of field for link to tickets + */ + public $fk_element='fk_ticket'; /** * @var int Does ticketsupcore support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ @@ -178,7 +182,7 @@ class Ticketsup extends CommonObject 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty"), 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToProject"), 'fk_user_create' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Author', 'visible'=>1, 'enabled'=>1, 'position'=>510, 'notnull'=>1), - 'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AuthorAssign', 'visible'=>1, 'enabled'=>1, 'position'=>510, 'notnull'=>1), + 'fk_user_assign' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'AssignedTo', 'visible'=>1, 'enabled'=>1, 'position'=>510, 'notnull'=>1), 'subject' => array('type'=>'varchar(255)', 'label'=>'Subject', 'visible'=>1, 'enabled'=>1, 'position'=>12, 'notnull'=>-1, 'searchall'=>1, 'help'=>""), 'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>60, 'notnull'=>-1,), 'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-2, 'enabled'=>1, 'position'=>40, 'notnull'=>1), @@ -2469,182 +2473,6 @@ class Ticketsup extends CommonObject return false; } - /** - * Show photos of a product (nbmax maximum), into several columns - * TODO Move this into html.formproduct.class.php - * - * @param string $sdir Directory to scan - * @param int $size 0=original size, 1='small' use thumbnail if possible - * @param int $nbmax Nombre maximum de photos (0=pas de max) - * @param int $nbbyrow Number of image per line or -1 to use div. Used only if size=1. - * @param int $showfilename 1=Show filename - * @param int $showaction 1=Show icon with action links (resize, delete) - * @param int $maxHeight Max height of original image when size='small' (so we can use original even if small requested). If 0, always use 'small' thumb image. - * @param int $maxWidth Max width of original image when size='small' - * @param int $nolink Do not add a href link to view enlarged imaged into a new tab - * @return string Html code to show photo. Number of photos shown is saved in this->nbphoto - */ - function show_photos($sdir, $size = 0, $nbmax = 0, $nbbyrow = 5, $showfilename = 0, $showaction = 0, $maxHeight = 120, $maxWidth = 160, $nolink = 0) - { - global $conf, $user, $langs; - - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; - - $dir = $sdir . '/'; - $pdir = '/'; - $dir .= get_exdir(0, 0, 0, 0, $this, 'ticketsup') . $this->track_id . '/'; - $pdir .= get_exdir(0, 0, 0, 0, $this, 'ticketsup') . $this->track_id . '/'; - - $dirthumb = $dir . 'thumbs/'; - $pdirthumb = $pdir . 'thumbs/'; - - $return = '' . "\n"; - $nbphoto = 0; - - $dir_osencoded = dol_osencode($dir); - if (file_exists($dir_osencoded)) { - $handle = opendir($dir_osencoded); - if (is_resource($handle)) { - while (($file = readdir($handle)) != false) { - $photo = ''; - - if (!utf8_check($file)) { - $file = utf8_encode($file); - } - // To be sure file is stored in UTF8 in memory - if (dol_is_file($dir . $file) && preg_match('/(' . $this->regeximgext . ')$/i', $dir . $file)) { - $nbphoto++; - $photo = $file; - $viewfilename = $file; - - if ($size == 1 || $size == 'small') { // Format vignette - // Find name of thumb file - $photo_vignette = basename(getImageFileNameForSize($dir . $file, '_small', '.png')); - if (!dol_is_file($dirthumb . $photo_vignette)) { - $photo_vignette = ''; - } - - // Get filesize of original file - $imgarray = dol_getImageSize($dir . $photo); - - if ($nbbyrow > 0) { - if ($nbphoto == 1) { - $return .= ''; - } - - if ($nbphoto % $nbbyrow == 1) { - $return .= ''; - } - - $return .= ''; - if (($nbphoto % $nbbyrow) == 0) { - $return .= ''; - } - } elseif ($nbbyrow < 0) { - $return .= ''; - } - } - - if (empty($size)) { // Format origine - $return .= ''; - - if ($showfilename) { - $return .= '
' . $viewfilename; - } - - if ($showaction) { - if ($user->rights->produit->creer || $user->rights->service->creer) { - // Link to resize - $return .= '' . img_picto($langs->trans("Resize"), 'resize', '') . '   '; - - // Link to delete - $return .= ''; - $return .= img_delete() . ''; - } - } - } - - // On continue ou on arrete de boucler ? - if ($nbmax && $nbphoto >= $nbmax) { - break; - } - } - } - } - - if ($size == 1 || $size == 'small') { - if ($nbbyrow > 0) { - // Ferme tableau - while ($nbphoto % $nbbyrow) { - $return .= ''; - $nbphoto++; - } - - if ($nbphoto) { - $return .= '
'; - } elseif ($nbbyrow < 0) { - $return .= '
'; - } - - $return .= "\n"; - if (empty($nolink)) { - $return .= ''; - } - - // Show image (width height=$maxHeight) - // Si fichier vignette disponible et image source trop grande, on utilise la vignette, sinon on utilise photo origine - $alt = $langs->transnoentitiesnoconv('File') . ': ' . $pdir . $photo; - $alt .= ' - ' . $langs->transnoentitiesnoconv('Size') . ': ' . $imgarray['width'] . 'x' . $imgarray['height']; - - if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) { - $return .= ''; - $return .= 'dol_use_jmobile ? 'max-height' : 'height') . '="' . $maxHeight . '" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=ticketsup&entity=' . $this->entity . '&file=' . urlencode($pdirthumb . $photo_vignette) . '" title="' . dol_escape_htmltag($alt) . '">'; - } else { - $return .= ''; - $return .= 'dol_use_jmobile ? 'max-height' : 'height') . '="' . $maxHeight . '" src="' . DOL_URL_ROOT . '/viewimage.php?modulepart=ticketsup&entity=' . $this->entity . '&file=' . urlencode($pdir . $photo) . '" title="' . dol_escape_htmltag($alt) . '">'; - } - - if (empty($nolink)) { - $return .= ''; - } - - $return .= "\n"; - - if ($showfilename) { - $return .= '
' . $viewfilename; - } - - if ($showaction) { - $return .= '
'; - // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites - if ($photo_vignette && preg_match('/(' . $this->regeximgext . ')$/i', $photo) && ($this->imgWidth > $maxWidth || $this->imgHeight > $maxHeight)) { - $return .= '' . img_picto($langs->trans('GenerateThumb'), 'refresh') . '  '; - } - if ($user->rights->produit->creer || $user->rights->service->creer) { - // Link to resize - $return .= '' . img_picto($langs->trans("Resize"), 'resize', '') . '   '; - - // Link to delete - $return .= ''; - $return .= img_delete() . ''; - } - } - $return .= "\n"; - - if ($nbbyrow > 0) { - $return .= '
 
'; - } - } - } - - closedir($handle); - } - - $this->nbphoto = $nbphoto; - - return $return; - } } diff --git a/htdocs/ticketsup/contact.php b/htdocs/ticketsup/contact.php index 8199b6c84a5..7202cba8dd2 100644 --- a/htdocs/ticketsup/contact.php +++ b/htdocs/ticketsup/contact.php @@ -19,9 +19,9 @@ */ /** - * \file ticketsup/contact.php - * \ingroup ticketsup - * \brief Contacts of tickets + * \file htdocs/ticketsup/contact.php + * \ingroup ticketsup + * \brief Contacts of tickets */ require '../main.inc.php'; diff --git a/htdocs/ticketsup/document.php b/htdocs/ticketsup/document.php index cadb6731bfd..3ec98fe1635 100644 --- a/htdocs/ticketsup/document.php +++ b/htdocs/ticketsup/document.php @@ -20,7 +20,7 @@ */ /** - * \file /ticketsup/document.php + * \file htdocs/ticketsup/document.php * \ingroup ticketsup * \brief files linked to a ticket */ @@ -33,13 +33,13 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT . "/core/lib/company.lib.php"; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php'; -$langs->loadLangs(array("companies","other","ticketsup")); +$langs->loadLangs(array("companies","other","ticketsup","mails")); -$action = GETPOST('action','alpha'); -$confirm = GETPOST('confirm','alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); $track_id = GETPOST('track_id', 'alpha'); -$ref = GETPOST('ref', 'alpha'); +$action = GETPOST('action','alpha'); +$confirm = GETPOST('confirm','alpha'); // Security check if (!$user->rights->ticketsup->read) { @@ -50,18 +50,12 @@ if (!$user->rights->ticketsup->read) { $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); $page = GETPOST("page", 'int'); -if ($page == -1) { - $page = 0; -} +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -if (!$sortorder) { - $sortorder = "ASC"; -} -if (!$sortfield) { - $sortfield = "name"; -} +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="position_name"; $object = new Ticketsup($db); $result = $object->fetch($id, $ref, $track_id); @@ -97,15 +91,11 @@ $form = new Form($db); $help_url = ''; llxHeader('', $langs->trans("TicketDocumentsLinked") . ' - ' . $langs->trans("Files"), $help_url); -if ($object->id) { - /* - * Affichage onglets - */ - if (!empty($conf->notification->enabled)) { - $langs->load("mails"); - } - - $form = new Form($db); +if ($object->id) +{ + /* + * Show tabs + */ if ($socid > 0) { $object->fetch_thirdparty(); $head = societe_prepare_head($object->thirdparty); @@ -119,6 +109,7 @@ if ($object->id) { } elseif ($user->societe_id > 0) { $object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'"; } + $head = ticketsup_prepare_head($object); dol_fiche_head($head, 'tabTicketDocument', $langs->trans("Ticket"), 0, 'ticketsup'); @@ -153,16 +144,16 @@ if ($object->id) { $totalsize += $file['size']; } - // For compatibility we use track ID for directory - $object->ref = $object->track_id; + $object->ref = $object->track_id; // For compatibility we use track ID for directory $modulepart = 'ticketsup'; $permission = $user->rights->ticketsup->write; $permtoedit = $user->rights->ticketsup->write; + $param = '&id=' . $object->id; + include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - - - print "

"; -} else { +} +else +{ accessforbidden('', 0, 0); } diff --git a/htdocs/ticketsup/history.php b/htdocs/ticketsup/history.php index 4dda4c919e8..c6de1d7c3c6 100644 --- a/htdocs/ticketsup/history.php +++ b/htdocs/ticketsup/history.php @@ -16,9 +16,9 @@ */ /** - * History of ticket - * - * @package ticketsup + * \file htdocs/ticketsup/history.php + * \ingroup ticketsup + * \brief History of ticket */ require '../main.inc.php'; diff --git a/htdocs/ticketsup/index.php b/htdocs/ticketsup/index.php index cef4faa80ba..8881b8c3ad2 100644 --- a/htdocs/ticketsup/index.php +++ b/htdocs/ticketsup/index.php @@ -16,9 +16,8 @@ */ /** - * Index page for ticket module - * - * @package ticketsup + * \file htdocs/ticketsup/history.php + * \ingroup ticketsup */ require '../main.inc.php'; diff --git a/htdocs/ticketsup/list.php b/htdocs/ticketsup/list.php index 934a528763e..d4b5733ef55 100644 --- a/htdocs/ticketsup/list.php +++ b/htdocs/ticketsup/list.php @@ -1,6 +1,6 @@ - * 2016 Christophe Battarel +/* Copyright (C) 2013-2018 Jean-François FERRY + * Copyright (C) 2016 Christophe Battarel * * 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 @@ -17,9 +17,8 @@ */ /** - * Tickets List - * - * @package ticketsup + * \file htdocs/ticketsup/list.php + * \ingroup ticketsup */ require '../main.inc.php'; @@ -437,7 +436,7 @@ print ''; print ''; print ''; -$buttontocreate = ''; +$buttontocreate = '' . $langs->trans('NewTicket') . ''; print_barre_liste($langs->trans('TicketList'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_ticketsup', 0, $buttontocreate, '', $limit); diff --git a/htdocs/ticketsup/new.php b/htdocs/ticketsup/new.php index 605db702c4a..0428f5286c2 100644 --- a/htdocs/ticketsup/new.php +++ b/htdocs/ticketsup/new.php @@ -17,9 +17,8 @@ */ /** - * Display form to add new ticket - * - * @package ticketsup + * \file htdocs/ticketsup/new.php + * \ingroup ticketsup */ require '../main.inc.php'; From 68a4058387b4f3f3c4ca69f7cdac2016707a1a21 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 13:03:12 +0100 Subject: [PATCH 14/53] Fix translation --- htdocs/langs/en_US/projects.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 86d09ff3edc..1ecbf5f4179 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -216,6 +216,7 @@ LatestProjects=Latest %s projects LatestModifiedProjects=Latest %s modified projects OtherFilteredTasks=Other filtered tasks NoAssignedTasks=No assigned tasks (assign project/tasks the current user from the top select box to enter time on it) +ProjectValidatedInDolibarr=Project validated # Comments trans AllowCommentOnTask=Allow user comments on tasks AllowCommentOnProject=Allow user comments on projects From 4eec7db73108e3ea209397b4233f778b51f37d76 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 13:13:04 +0100 Subject: [PATCH 15/53] Prepare 7.0.1 --- ChangeLog | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/ChangeLog b/ChangeLog index 803225db301..2bf1a93f460 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,74 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 7.0.1 compared to 7.0.0 ***** +FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php +FIX: #8200 +FIX: #8219 +FIX: #8232 +FIX: #8269 +FIX: #8277 +FIX: #8285 Extrafields now reported by /api/index.php/agendaevents/{id} +FIX: #8289 add a configuration for stock calculation +FIX: Activate all also if there are inactive services +FIX: add planned delivery to order exports +FIX: approval date was not visible if leave was canceled after +FIX: avoid "Array" on screen +FIX: Avoid empty value to fk_multicurrency attribute +FIX: Bad var for substitution of free text +FIX: Can't activate tasks on projects configuration +FIX: Can use odx templates that does not include lines tags +FIX: check shipping on delete order +FIX: check verif exped on delete order +FIX: comment on tasks +FIX: country must not be mandatory for accounting report groups +FIX: css +FIX: Delete tasks on project delete will now trigger TASK_DELETE +FIX: Do not lose filter when editing comment of a time spent in task view +FIX: duplicate confirm message. Missing reposition class +FIX: Duplicate product_type asignement on order addline +FIX: email use the validate user instead of approver in holiday approval +FIX: Error management in leave request +FIX: for nondisplay of fk_element 's id in REST API response +FIX: Generic substitution of constant disabled for sensitive constant +FIX: if we make a mistake with situation_percent, now we can correct it. before situation_final was always set to 1 and no way to go back +FIX: Import process must stop after ending line nb to import +FIX: Infinite loop on deletion of temp file when there is symbolic links +FIX: Input of holiday for subordinates was ko +FIX: invoice creation fails when next date not defined +FIX: Label of event show twice +FIX: letter for month March +FIX: Look and feel v7 +FIX: Make a redirect after the remove_file action to avoid deletion done +FIX: migration script for product photo +FIX: missing email of customer in stripe info payments +FIX: missing object entity in fetch +FIX: Missing restore_lastsearch_values +FIX: multicompany compatibility and fix reports +FIX: natural search double quote +FIX: navigation and filters on holiday list +FIX: Parameter must be an array or an object that implements Countable +FIX: Payment mode not correctly set in donation and document +FIX: Permission in list of holiday +FIX: Properties updated if update successfull. +FIX: reverse field to have object loaded in doaction +FIX: Saving wrong localtax on order addline +FIX: Search criteria on vat +FIX: security report by DIGITEMIS CYBERSECURITY & PRIVACY +FIX: show status on societe banner +FIX: solve column mismatch in user card with multicompany transverse mode + code cleanup +FIX: Subscription events not recorded into agenda +FIX: Subscription not correctly log in blockedlog +FIX: Temporary dir for mail files must be cleaned at beginning of form +FIX: Trad and creation date in subscription create +FIX: translation of holiday types +FIX: Unknown column 'pl.amount_requested' in compta/prelevement/factures.php +FIX: Useless clean of tree +FIX: Use of undefined constant _ROWS_2 +FIX: warning when adding ECM files using old photo path + + ***** ChangeLog for 7.0.0 compared to 6.0.5 ***** For users: NEW: Add a preview icon after files that can be previewed (pdf + images) From 658b145ff448870e33db2afa6d07af95a9f6cc0d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 13:16:38 +0100 Subject: [PATCH 16/53] Missing translation --- .../core/triggers/interface_50_modAgenda_ActionsAuto.class.php | 2 +- htdocs/langs/en_US/projects.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 78053a0631c..a3b11222a0f 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -760,7 +760,7 @@ class InterfaceActionsAuto extends DolibarrTriggers $langs->load("projects"); if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectModifiedInDolibarr",$object->ref); - $object->actionmsg=$langs->transnoentities("ProjectModifieddInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("ProjectModifiedInDolibarr",$object->ref); $object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref; $object->sendtoid=0; diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 1ecbf5f4179..879382bd070 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -137,6 +137,7 @@ ProjectReportDate=Change task dates according to new project start date ErrorShiftTaskDate=Impossible to shift task date according to new project start date ProjectsAndTasksLines=Projects and tasks ProjectCreatedInDolibarr=Project %s created +ProjectValidatedInDolibarr=Project %s validated ProjectModifiedInDolibarr=Project %s modified TaskCreatedInDolibarr=Task %s created TaskModifiedInDolibarr=Task %s modified @@ -216,7 +217,6 @@ LatestProjects=Latest %s projects LatestModifiedProjects=Latest %s modified projects OtherFilteredTasks=Other filtered tasks NoAssignedTasks=No assigned tasks (assign project/tasks the current user from the top select box to enter time on it) -ProjectValidatedInDolibarr=Project validated # Comments trans AllowCommentOnTask=Allow user comments on tasks AllowCommentOnProject=Allow user comments on projects From 3793fd69e64025899fac96eba7c942ca9a41359c Mon Sep 17 00:00:00 2001 From: vabeltran Date: Thu, 22 Mar 2018 13:18:06 +0100 Subject: [PATCH 17/53] FIX PropalStatusValidatedShort missing in langs/en_US/propal.lang Added PropalStatusValidatedShort value, missing in lang/en_US/propal.lang file. --- htdocs/langs/en_US/propal.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 29c4fe16b64..c934bd50ab6 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -33,6 +33,7 @@ PropalStatusSigned=Signed (needs billing) PropalStatusNotSigned=Not signed (closed) PropalStatusBilled=Billed PropalStatusDraftShort=Draft +PropalStatusValidatedShort=Open PropalStatusClosedShort=Closed PropalStatusSignedShort=Signed PropalStatusNotSignedShort=Not signed From 2ee0e68d67b531fbc20605bebfaa81f585cafd80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 13:22:33 +0100 Subject: [PATCH 18/53] Fic packaging tools --- build/generate_filelist_xml.php | 8 +++++++- build/makepack-dolibarr.pl | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index e6336e30e97..f6790291811 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -17,7 +17,7 @@ */ /** - * \file build/generate_filecheck_xml.php + * \file build/generate_filelist_xml.php * \ingroup dev * \brief This script create a xml checksum file */ @@ -68,6 +68,12 @@ while ($i < $argc) $i++; } +// If release is auto, we take current version +if ($release == 'auto') +{ + $release = DOL_VERSION; +} + if (empty($includecustom)) { if (DOL_VERSION != $release) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 839a8092a7c..77d78da1dc5 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -388,7 +388,7 @@ if ($nboftargetok) { #----------------------- if ($CHOOSEDTARGET{'-CHKSUM'}) { - print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filecheck_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n"; + print 'Create xml check file with md5 checksum with command php '.$SOURCE.'/build/generate_filelist_xml.php release='.$MAJOR.'.'.$MINOR.'.'.$BUILD."\n"; $ret=`php $SOURCE/build/generate_filelist_xml.php release=$MAJOR.$MINOR.$BUILD`; print $ret."\n"; # Copy to final dir From 4c1dcc37d141aca1197489ec503d62e9573f91aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 13:38:28 +0100 Subject: [PATCH 19/53] Fix packager --- build/generate_filelist_xml.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/generate_filelist_xml.php b/build/generate_filelist_xml.php index f6790291811..5f54c95d7e0 100755 --- a/build/generate_filelist_xml.php +++ b/build/generate_filelist_xml.php @@ -45,7 +45,7 @@ $includeconstants=array(); if (empty($argv[1])) { - print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; + print "Usage: ".$script_file." release=auto|x.y.z[-mybuild] [includecustom=1] [includeconstant=CC:MY_CONF_NAME:value]\n"; print "Example: ".$script_file." release=6.0.0 includecustom=1 includeconstant=FR:INVOICE_CAN_ALWAYS_BE_REMOVED:0 includeconstant=all:MAILING_NO_USING_PHPMAIL:1\n"; exit -1; } @@ -69,16 +69,19 @@ while ($i < $argc) } // If release is auto, we take current version -if ($release == 'auto') +$tmpver=explode('-', $release, 2); +if ($tmpver[0] == 'auto') { - $release = DOL_VERSION; + $release=DOL_VERSION; + if ($tmpver[1]) $release.='-'.$tmpver[1]; } if (empty($includecustom)) { - if (DOL_VERSION != $release) + $tmpver=explode('-', $release, 2); + if (DOL_VERSION != $tmpver[0]) { - print 'Error: When parameter "includecustom" is not set, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$release.')'."\n"; + print 'Error: When parameter "includecustom" is not set and there is no suffix in release parameter, version declared into filefunc.in.php ('.DOL_VERSION.') must be exact same value than "release" parameter ('.$tmpver[0].')'."\n"; print "Usage: ".$script_file." release=x.y.z[-...] [includecustom=1]\n"; exit -1; } From 0bb7d4d494d5fa93b5250e35673cdbf70d0430ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 14:04:33 +0100 Subject: [PATCH 20/53] Update propal.lang --- htdocs/langs/en_US/propal.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index c934bd50ab6..7745dde08da 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -33,7 +33,7 @@ PropalStatusSigned=Signed (needs billing) PropalStatusNotSigned=Not signed (closed) PropalStatusBilled=Billed PropalStatusDraftShort=Draft -PropalStatusValidatedShort=Open +PropalStatusValidatedShort=Validated PropalStatusClosedShort=Closed PropalStatusSignedShort=Signed PropalStatusNotSignedShort=Not signed From 5efb94b06f1b529d33be4ccf4aa52b9eaafdccc9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 14:13:58 +0100 Subject: [PATCH 21/53] Prepare 5.0.6 --- ChangeLog | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/ChangeLog b/ChangeLog index 849d8b38855..dcc363d03a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,41 @@ English Dolibarr ChangeLog -------------------------------------------------------------- + +***** ChangeLog for 6.0.6 compared to 6.0.6 ***** +FIX: #7974 Contract - Invalid reference on the document +FIX: #8139 +FIX: #8139 User search does not work if MAIN_USE_OLD_SEARCH_FORM, missing list.php +FIX: #8151 +FIX: #8200 +FIX: add planned delivery to order exports +FIX: a discount is a percent, not an amount, so we use vatrate not price +FIX: Avoid empty value to fk_multicurrency attribute +FIX: Bad localtaxes assignment in cashdesk +FIX: check shipping on delete order +FIX: check verif exped on delete order +FIX: creer into lire +FIX: Delete tasks on project delete will now trigger TASK_DELETE +FIX: Global on $user parameter reset the variable +FIX: if we make a mistake with situation_percent, now we can correct… +FIX: if we make a mistake with situation_percent, now we can correct it. before situation_final was always set to 1 and no way to go back +FIX: Import process must stop after ending line nb to import +FIX: migration script for product photo +FIX: natural search double quote +FIX: reverse field to have object loaded in doaction +FIX: Saving wrong localtax on order addline +FIX: show status on societe banner +FIX: solve column mismatch in user card's usergroup list + code cleanup +FIX: solve column mismatch in user card with multicompany transverse mode + code cleanup +FIX: unset categorie +FIX: update_extras on fourn card +FIX: warning when adding ECM files using old photo path +FIX: Withdrawals lines not filter by company name and not respect dropdown limit lines by page +NEW: Add sale representative einstein_pdf_modules +NEW_einstein_pdf_modules +NEW: field commerciaux and categ export CustomersInvoicesAndPayments + + ***** ChangeLog for 6.0.5 compared to 6.0.4 ***** FIX: security vulnerability reported by ADLab of Venustech CVE-2017-17897, CVE-2017-17898, CVE-2017-17899, CVE-2017-17900 From d6f3fc9fe7dcf1ec2cb13b75b04eda2dc889c0b7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 22 Mar 2018 16:05:50 +0100 Subject: [PATCH 22/53] Fix use the getSalesRepresentative function instead of get_users --- htdocs/societe/card.php | 8 ++-- htdocs/societe/class/societe.class.php | 55 +++++++++++--------------- 2 files changed, 26 insertions(+), 37 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index f93a27bdb0f..920dee364c7 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -538,7 +538,7 @@ if (empty($reshook)) $error++; } } - + // Links with users $salesreps = GETPOST('commercial', 'array'); $result = $object->setSalesRep($salesreps); @@ -676,7 +676,7 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); $error++; } - + // Links with users $salesreps = GETPOST('commercial', 'array'); $result = $object->setSalesRep($salesreps); @@ -1949,14 +1949,14 @@ else // Capital print '
'.fieldLabel('Capital','capital').' '.$langs->trans("Currency".$conf->currency).'
'.fieldLabel('AllocateCommercial','commercial_id').''; $userlist = $form->select_dolusers('', '', 0, null, 0, '', '', 0, 0, 0, '', 0, '', '', 0, 1); $arrayselected = GETPOST('commercial', 'array'); - if(empty($arrayselected)) $arrayselected = $object->get_users(); + if (empty($arrayselected)) $arrayselected = $object->getSalesRepresentatives($user, 1); print $form->multiselectarray('commercial', $userlist, $arrayselected, null, null, null, null, "90%"); print '
' . $langs->trans("Statistics") . ' ' . img_ print '
'; // don't display graph if no series -if (count($dataseries) >1) { +if (! empty($dataseries) && count($dataseries) > 1) { $data = array(); foreach ($dataseries as $key => $value) { $data[] = array($value['label'], $value['data']); From 47ea5a84fee484c3a6ccda0cd9a3f821f30dad3a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 23 Mar 2018 11:11:14 +0100 Subject: [PATCH 32/53] Fix: wrong var name --- htdocs/ticketsup/class/ticketsup.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticketsup/class/ticketsup.class.php b/htdocs/ticketsup/class/ticketsup.class.php index 60edf6471ad..76902714a9e 100644 --- a/htdocs/ticketsup/class/ticketsup.class.php +++ b/htdocs/ticketsup/class/ticketsup.class.php @@ -1078,7 +1078,7 @@ class Ticketsup extends CommonObject { global $langs; - if (! empty($this->cache_types_tickets) && count($this->cache_category_tickets)) { + if (! empty($this->cache_category_ticket) && count($this->cache_category_tickets)) { return 0; } // Cache deja charge @@ -1118,7 +1118,7 @@ class Ticketsup extends CommonObject { global $langs; - if (! empty($this->cache_types_tickets) && count($this->cache_severity_tickets)) { + if (! empty($this->cache_severity_tickets) && count($this->cache_severity_tickets)) { return 0; } // Cache deja charge From 7363ae17ee82fb9765850eda81acb846b1b5266e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Mar 2018 16:09:46 +0100 Subject: [PATCH 33/53] Move setup of email for module module into email templates --- htdocs/adherents/admin/adherent_emails.php | 62 ++++--------- htdocs/adherents/card.php | 4 +- htdocs/adherents/class/adherent.class.php | 9 +- htdocs/admin/mails_templates.php | 15 ++-- htdocs/core/class/html.form.class.php | 34 +++---- htdocs/core/class/html.formmail.class.php | 3 +- htdocs/core/lib/admin.lib.php | 86 ++++++++++++------ htdocs/core/modules/modAdherent.class.php | 90 +++++++++---------- .../mysql/data/llx_c_email_templates.sql | 10 ++- .../install/mysql/migration/6.0.0-7.0.0.sql | 2 +- .../install/mysql/migration/7.0.0-8.0.0.sql | 21 +++-- htdocs/install/mysql/tables/llx_const.sql | 4 +- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/en_US/members.lang | 38 +++++--- 14 files changed, 206 insertions(+), 173 deletions(-) diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/adherent_emails.php index 292b9c77339..88514d83da3 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/adherent_emails.php @@ -39,7 +39,7 @@ $langs->load("members"); if (! $user->admin) accessforbidden(); -$type=array('yesno','texte','chaine'); +$oldtypetonewone=array('texte'=>'text','chaine'=>'string'); // old type to new ones $action = GETPOST('action','alpha'); @@ -53,20 +53,7 @@ if ($action == 'updateall') { $db->begin(); $res1=$res2=$res3=$res4=$res5=$res6=0; - $res1=dolibarr_set_const($db, 'ADHERENT_LOGIN_NOT_REQUIRED', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); - $res2=dolibarr_set_const($db, 'ADHERENT_MAIL_REQUIRED', GETPOST('ADHERENT_MAIL_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); - $res3=dolibarr_set_const($db, 'ADHERENT_DEFAULT_SENDINFOBYMAIL', GETPOST('ADHERENT_DEFAULT_SENDINFOBYMAIL', 'alpha'), 'chaine', 0, '', $conf->entity); - $res4=dolibarr_set_const($db, 'ADHERENT_BANK_USE', GETPOST('ADHERENT_BANK_USE', 'alpha'), 'chaine', 0, '', $conf->entity); - // Use vat for invoice creation - if ($conf->facture->enabled) - { - $res4=dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); - $res5=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); - if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) - { - $res6=dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); - } - } + $res1=dolibarr_set_const($db, 'XXXX', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) { setEventMessages('ErrorFailedToSaveDate', null, 'errors'); @@ -82,19 +69,16 @@ if ($action == 'updateall') // Action mise a jour ou ajout d'une constante if ($action == 'update' || $action == 'add') { + $constlineid = GETPOST('rowid','int'); $constname=GETPOST('constname','alpha'); - $constvalue=(GETPOST('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname) : GETPOST('constvalue')); - if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE' || $constname=='ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && $constvalue == -1) $constvalue=''; - if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice - { - if ($constvalue) $constvalue=0; - else $constvalue=1; - } + $constvalue=(GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alpha') : GETPOST('constvalue')); + $consttype=(GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype')); + $constnote=(GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'none') : GETPOST('constnote')); - $consttype=GETPOST('consttype','alpha'); - $constnote=GETPOST('constnote'); - $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); + $typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype]; + + $res=dolibarr_set_const($db,$constname, $constvalue, $typetouse, 0, $constnote, $conf->entity); if (! $res > 0) $error++; @@ -111,7 +95,7 @@ if ($action == 'update' || $action == 'add') // Action activation d'un sous module du module adherent if ($action == 'set') { - $result=dolibarr_set_const($db, GETPOST('name','alpha'),GETPOST('value'),'',0,'',$conf->entity); + $result=dolibarr_set_const($db, GETPOST('name','alpha'), GETPOST('value'), '', 0, '', $conf->entity); if ($result < 0) { print $db->error(); @@ -157,23 +141,15 @@ print ''; * Editing global variables not related to a specific theme */ $constantes=array( - 'ADHERENT_MAIL_FROM', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT', - 'ADHERENT_AUTOREGISTER_NOTIF_MAIL', - 'ADHERENT_AUTOREGISTER_MAIL_SUBJECT', - 'ADHERENT_AUTOREGISTER_MAIL', - 'ADHERENT_MAIL_VALID_SUBJECT', - 'ADHERENT_MAIL_VALID', - 'ADHERENT_MAIL_COTIS_SUBJECT', - 'ADHERENT_MAIL_COTIS', - 'ADHERENT_MAIL_RESIL_SUBJECT', - 'ADHERENT_MAIL_RESIL', - ); - -$helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; -$helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; -$helptext.='__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, '; -$helptext.='__YEAR__, __MONTH__, __DAY__'; + 'ADHERENT_MAIL_FROM'=>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string', + 'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html', + 'ADHERENT_EMAIL_TEMPLATE_AUTOREGISTER' =>'emailtemplate:member', /* old was ADHERENT_AUTOREGISTER_MAIL */ + 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */ + 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */ + 'ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION' =>'emailtemplate:member', + 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */ +); $helptext='*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; $helptext.='__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 81757aab9e0..41a49bd386d 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1353,7 +1353,7 @@ else $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_VALID_SUBJECT); $texttosend=$object->makeSubstitution($adht->getMailOnValid()); - $tmp=$langs->trans("SendAnEMailToMember"); + $tmp=$langs->trans("SendingAnEMailToMember"); $tmp.='
'.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; $tmp.='
'.$langs->trans("MailRecipient").': '.$object->email.''; $helpcontent=''; @@ -1395,7 +1395,7 @@ else $subjecttosend=$object->makeSubstitution($conf->global->ADHERENT_MAIL_RESIL_SUBJECT); $texttosend=$object->makeSubstitution($adht->getMailOnResiliate()); - $tmp=$langs->trans("SendAnEMailToMember"); + $tmp=$langs->trans("SendingAnEMailToMember"); $tmp.='
('.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; $tmp.=$langs->trans("MailRecipient").': '.$object->email.')'; $helpcontent=''; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a22a2d57c0d..3ef7af75ceb 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2562,9 +2562,12 @@ class Adherent extends CommonObject $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); $outputlangs->loadLangs(array("main", "members")); - $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, '(SendReminderForExpiredSubscriptionTitle)'); + $arraydefaultmessage=null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION; - if (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + if (! empty($labeltouse)) $arraydefaultmessage=$formmail->getEMailTemplate($this->db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + + if (! empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $substitutionarray=getCommonSubstitutionArray($outputlangs, 0, null, $adherent); //if (is_array($adherent->thirdparty)) $substitutionarraycomp = ... @@ -2591,7 +2594,7 @@ class Adherent extends CommonObject } else { - $blockingerrormsg="Can't find email template '(SendReminderForExpiredSubscriptionTitle)'"; + $blockingerrormsg="Can't find email template, defined into member module setup, to use for reminding"; $nbko++; break; } diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 21d3cb2eae5..79c4d4765be 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -91,17 +91,17 @@ $tabsqlsort[25]="label ASC, lang ASC, position ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); -$tabfield[25]= "label,type_template,lang,fk_user,private,position,topic,joinfiles,content"; +$tabfield[25]= "label,lang,type_template,fk_user,private,position,topic,joinfiles,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfield[25].=',content_lines'; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue=array(); -$tabfieldvalue[25]= "label,type_template,fk_user,lang,private,position,topic,joinfiles,content"; +$tabfieldvalue[25]= "label,lang,type_template,fk_user,private,position,topic,joinfiles,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldvalue[25].=',content_lines'; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert=array(); -$tabfieldinsert[25]= "label,type_template,fk_user,lang,private,position,topic,joinfiles,content"; +$tabfieldinsert[25]= "label,lang,type_template,fk_user,private,position,topic,joinfiles,content"; if (! empty($conf->global->MAIN_EMAIL_TEMPLATES_FOR_OBJECT_LINES)) $tabfieldinsert[25].=',content_lines'; $tabfieldinsert[25].=',entity'; // Must be at end because not into other arrays @@ -233,8 +233,7 @@ if (empty($reshook)) $ok=0; $fieldnamekey=$listfield[$f]; // We take translate key of field - if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Label'; - if ($fieldnamekey == 'libelle_facture') $fieldnamekey = 'LabelOnDocuments'; + if ($fieldnamekey == 'libelle' || ($fieldnamekey == 'label')) $fieldnamekey='Code'; if ($fieldnamekey == 'code') $fieldnamekey = 'Code'; if ($fieldnamekey == 'note') $fieldnamekey = 'Note'; if ($fieldnamekey == 'type_template') $fieldnamekey = 'TypeOfTemplate'; @@ -478,7 +477,7 @@ foreach ($fieldlist as $field => $value) if ($fieldlist[$field]=='lang') { $valuetoshow=(empty($conf->global->MAIN_MULTILANGS) ? ' ' : $langs->trans("Language")); } if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); } - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } if ($fieldlist[$field]=='private') { $align='center'; } if ($fieldlist[$field]=='position') { $align='center'; } @@ -695,7 +694,7 @@ if ($resql) if ($fieldlist[$field]=='fk_user') { $valuetoshow=$langs->trans("Owner"); } if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } if ($fieldlist[$field]=='type') { $valuetoshow=$langs->trans("Type"); } - if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Label"); } + if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { $valuetoshow=$langs->trans("Code"); } if ($fieldlist[$field]=='type_template') { $valuetoshow=$langs->trans("TypeOfTemplate"); } if ($fieldlist[$field]=='private') { $align='center'; } if ($fieldlist[$field]=='position') { $align='center'; } @@ -990,7 +989,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') { $selectedlang = $langs->defaultlang; if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]}; - print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1); + print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150'); } else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 32172ea60f0..8c575b6478e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5421,23 +5421,23 @@ class Form * Return a HTML select string, built from an array of key+value. * Note: Do not apply langs->trans function on returned content, content may be entity encoded twice. * - * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect - * @param array $array Array (key => value) - * @param string|string[] $id Preselected key or preselected keys for multiselect - * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value. - * @param int $key_in_label 1 to show key into label with format "[key] value" - * @param int $value_as_key 1 to use value as key - * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container - * @param int $translate 1=Translate and encode value - * @param int $maxlen Length maximum for labels - * @param int $disabled Html select box is disabled - * @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order - * @param string $morecss Add more class to css styles - * @param int $addjscombo Add js combo - * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set - * @param int $disablebademail Check if an email is found into value and if not disable and colorize entry - * @param int $nohtmlescape No html escaping. - * @return string HTML select string. + * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect + * @param array $array Array (key => value) + * @param string|string[] $id Preselected key or preselected keys for multiselect + * @param int|string $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (key is -1 and value is '' or ' ' if 1, key is -1 and value is text if string), <0 to add an empty value with key that is this value. + * @param int $key_in_label 1 to show key into label with format "[key] value" + * @param int $value_as_key 1 to use value as key + * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container + * @param int $translate 1=Translate and encode value + * @param int $maxlen Length maximum for labels + * @param int $disabled Html select box is disabled + * @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' or 'POS' = Do not sort, we keep original order + * @param string $morecss Add more class to css styles + * @param int $addjscombo Add js combo + * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set + * @param int $disablebademail Check if an email is found into value and if not disable and colorize entry + * @param int $nohtmlescape No html escaping. + * @return string HTML select string. * @see multiselectarray */ static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='',$disablebademail=0, $nohtmlescape=0) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 33aab58eb2e..2a93a3dc2b6 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -998,7 +998,7 @@ class FormMail extends Form * @param int $id Id of template to find, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found) * @param int $active 1=Only active template, 0=Only disabled, -1=All * @param string $label Label of template - * @return ModelMail + * @return ModelMail One instance of ModelMail */ public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id=0, $active=1, $label='') { @@ -1153,6 +1153,7 @@ class FormMail extends Form $line->topic=$obj->topic; $line->content=$obj->content; $line->content_lines=$obj->content_lines; + $this->lines_model[]=$line; } $this->db->free($resql); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 4bd9b097b3d..85a9be1f0fd 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1321,14 +1321,15 @@ function complete_elementList_with_modules(&$elementList) /** * Show array with constants to edit * - * @param array $tableau Array of constants + * @param array $tableau Array of constants array('key'=>type, ) where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (no form into table), 2=No form nor button at all * @param string $helptext Help * @return void */ function form_constantes($tableau, $strictw3c=0, $helptext='') { - global $db,$bc,$langs,$conf,$_Avery_Labels; + global $db,$bc,$langs,$conf,$user; + global $_Avery_Labels; $form = new Form($db); @@ -1343,11 +1344,20 @@ function form_constantes($tableau, $strictw3c=0, $helptext='') print '
'.$langs->trans("Action").'
'; - print ''; - print ''; + if (empty($strictw3c)) print ''; print ''; print ''; - print ''; + print ''; + print ''; print $langs->trans('Desc'.$const); @@ -1428,34 +1441,57 @@ function form_constantes($tableau, $strictw3c=0, $helptext='') } print $form->selectarray('constvalue'.(empty($strictw3c)?'':'[]'),$arrayoflabels,($obj->value?$obj->value:'CARD'),1,0,0); print ''; + print ''; print ''; - if (in_array($const,array('ADHERENT_CARD_TEXT','ADHERENT_CARD_TEXT_RIGHT','ADHERENT_ETIQUETTE_TEXT'))) + print ''; + print ''; + if ($obj->type == 'textarea' || in_array($const,array('ADHERENT_CARD_TEXT','ADHERENT_CARD_TEXT_RIGHT','ADHERENT_ETIQUETTE_TEXT'))) { print '\n"; - print ''; } - else if (in_array($const,array('ADHERENT_AUTOREGISTER_NOTIF_MAIL','ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) + elseif ($obj->type == 'html') { - require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('constvalue_'.$const.(empty($strictw3c)?'':'[]'),$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,ROWS_5,'90%'); - $doleditor->Create(); - print ''; + require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor('constvalue_'.$const.(empty($strictw3c)?'':'[]'),$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,ROWS_5,'90%'); + $doleditor->Create(); } - else if ($obj->type == 'yesno') + elseif ($obj->type == 'yesno') { - print $form->selectyesno('constvalue'.(empty($strictw3c)?'':'[]'),$obj->value,1); - print ''; + print $form->selectyesno('constvalue'.(empty($strictw3c)?'':'[]'),$obj->value,1); } - else + elseif (preg_match('/emailtemplate/', $obj->type)) + { + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + + $tmp=explode(':', $obj->type); + + $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user, null, -1); // We set lang=null to get in priority record with no lang + //$arraydefaultmessage = $formmail->getEMailTemplate($db, $tmp[1], $user, null, 0, 1, ''); + $arrayofmessagename=array(); + if (is_array($formmail->lines_model)) + { + foreach($formmail->lines_model as $modelmail) + { + //var_dump($modelmail); + $moreonlabel=''; + if (! empty($arrayofmessagename[$modelmail->label])) $moreonlabel=' ('.$langs->trans("SeveralLangugeVariatFound").')'; + $arrayofmessagename[$modelmail->label]=$langs->trans(preg_replace('/\(|\)/','',$modelmail->label)).$moreonlabel; + } + } + //var_dump($arraydefaultmessage); + //var_dump($arrayofmessagename); + print $form->selectarray('constvalue_'.$obj->name, $arrayofmessagename, $obj->value, 'None', 1, 0, '', 0, 0, 0, '', '', 1); + } + else // type = 'string' ou 'chaine' { print ''; - print ''; } print '
'; $checkbox_selected = ( GETPOST('send_email') == "1" ? ' checked' : ''); print ' '; @@ -839,7 +839,7 @@ class FormTicketsup print "
'; $checkbox_selected = ( GETPOST('private_message') == "1" ? ' checked' : ''); print ' '; @@ -902,7 +902,7 @@ class FormTicketsup // Intro // External users can't send message email - if ($user->rights->ticketsup->write && !$user->societe_id) { + if ($user->rights->ticketsup->write && !$user->socid) { $mail_intro = GETPOST('mail_intro') ? GETPOST('mail_intro') : $conf->global->TICKETS_MESSAGE_MAIL_INTRO; print '
'; @@ -727,8 +725,6 @@ if ($object->id > 0) */ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { - $commande_static=new Commande($db); - $sql = "SELECT s.nom, s.rowid"; $sql.= ", c.rowid as cid, c.total_ht"; $sql.= ", c.tva as total_tva"; @@ -744,9 +740,9 @@ if ($object->id > 0) $resql=$db->query($sql); if ($resql) { - $var=true; - $num = $db->num_rows($resql); + $commande_static=new Commande($db); + $num = $db->num_rows($resql); if ($num > 0) { // Check if there are orders billable @@ -808,9 +804,8 @@ if ($object->id > 0) /* * Last shipments */ - if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire) { - $sendingstatic = new Expedition($db); - + if (! empty($conf->expedition->enabled) && $user->rights->expedition->lire) + { $sql = 'SELECT e.rowid as id'; $sql.= ', e.ref'; $sql.= ', e.date_creation'; @@ -829,10 +824,11 @@ if ($object->id > 0) $sql.= " ORDER BY e.date_creation DESC"; $resql = $db->query($sql); - if ($resql) { - $var = true; - $num = $db->num_rows($resql); - $i = 0; + if ($resql) + { + $sendingstatic = new Expedition($db); + + $num = $db->num_rows($resql); if ($num > 0) { print '
'; @@ -843,12 +839,16 @@ if ($object->id > 0) print ''; } - while ($i < $num && $i < $MAXLIST) { + $i = 0; + while ($i < $num && $i < $MAXLIST) + { $objp = $db->fetch_object($resql); - print ''; - print ''; + print ''; if ($objp->date_creation > 0) { @@ -875,9 +875,7 @@ if ($object->id > 0) */ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { - $contratstatic=new Contrat($db); - - $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon, c.ref_supplier as refsup"; + $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; $sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " AND s.rowid = ".$object->id; @@ -887,9 +885,10 @@ if ($object->id > 0) $resql=$db->query($sql); if ($resql) { - $var=true; + $contrat=new Contrat($db); + $num = $db->num_rows($resql); - if ($num >0 ) + if ($num >0) { print '
'; + $sendingstatic->id = $objp->id; $sendingstatic->ref = $objp->ref; + + print '
'; print $sendingstatic->getNomUrl(1); print '
'; @@ -900,17 +899,19 @@ if ($object->id > 0) print '
'; - $contrat->id=$objp->id; - $contrat->ref=$objp->ref?$objp->ref:$objp->id; print $contrat->getNomUrl(1,12); print "'.dol_trunc($objp->refsup,12)."'.img_picto($langs->trans("Statistics"),'stats').'
'; print ''; - } + $i = 0; while ($i < $num && $i < $MAXLIST) { @@ -996,8 +996,6 @@ if ($object->id > 0) */ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { - $invoicetemplate = new FactureRec($db); - $sql = 'SELECT f.rowid as id, f.titre as ref, f.amount'; $sql.= ', f.total as total_ht'; $sql.= ', f.tva as total_tva'; @@ -1020,9 +1018,9 @@ if ($object->id > 0) $resql=$db->query($sql); if ($resql) { - $var=true; + $invoicetemplate = new FactureRec($db); + $num = $db->num_rows($resql); - $i = 0; if ($num > 0) { print ''; @@ -1033,12 +1031,11 @@ if ($object->id > 0) print ''; } + $i = 0; while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - print ''; - print ''; + print ''; if ($objp->frequency && $objp->date_last_gen > 0) @@ -1097,8 +1097,6 @@ if ($object->id > 0) */ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { - $facturestatic = new Facture($db); - $sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.amount'; $sql.= ', f.total as total_ht'; $sql.= ', f.tva as total_tva'; @@ -1118,9 +1116,9 @@ if ($object->id > 0) $resql=$db->query($sql); if ($resql) { - $var=true; + $facturestatic = new Facture($db); + $num = $db->num_rows($resql); - $i = 0; if ($num > 0) { print '
'; $invoicetemplate->id = $objp->id; $invoicetemplate->ref = $objp->ref; $invoicetemplate->suspended = $objp->suspended; @@ -1047,6 +1044,9 @@ if ($object->id > 0) $invoicetemplate->total_ht = $objp->total_ht; $invoicetemplate->total_tva = $objp->total_tva; $invoicetemplate->total_ttc = $objp->total_ttc; + + print '
'; print $invoicetemplate->getNomUrl(1); print '
'; @@ -1132,18 +1130,20 @@ if ($object->id > 0) print ''; } + $i = 0; while ($i < $num && $i < $MAXLIST) { $objp = $db->fetch_object($resql); - print ''; - print ''; + print ''; if ($objp->df > 0) From 6ef1dbbe0f34fef47a433bca2f3cb31fe4de5be0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 24 Mar 2018 18:28:06 +0100 Subject: [PATCH 49/53] FIX auto open contract if one result found --- htdocs/adherents/class/adherent.class.php | 5 +- htdocs/comm/action/class/actioncomm.class.php | 9 +- htdocs/contrat/list.php | 853 +++++++++--------- htdocs/core/class/utils.class.php | 1 - .../template/class/myobject.class.php | 11 +- htdocs/societe/class/societeaccount.class.php | 36 - 6 files changed, 451 insertions(+), 464 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index d6803b4ae17..4e6c540d2a5 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2500,7 +2500,6 @@ class Adherent extends CommonObject - /** * Send reminders by emails before subscription end * CAN BE A CRON TASK @@ -2512,6 +2511,7 @@ class Adherent extends CommonObject { global $conf, $langs, $mysoc, $user; + $error = 0; $this->output = ''; $this->error=''; @@ -2561,9 +2561,6 @@ class Adherent extends CommonObject $adherent->fetch_thirdparty(); // Send reminder email - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; - $formmail=new FormMail($db); - $outputlangs = new Translate('', $conf); $outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang); $outputlangs->loadLangs(array("main", "members")); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 682e66e8144..7960bbd764d 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1654,7 +1654,8 @@ class ActionComm extends CommonObject { global $conf, $langs; - $this->output = ''; + $error = 0; + $this->output = ''; $this->error=''; if (empty($conf->global->AGENDA_REMINDER_EMAIL)) @@ -1668,6 +1669,8 @@ class ActionComm extends CommonObject dol_syslog(__METHOD__, LOG_DEBUG); + $this->db->begin(); + // TODO Scan events of type 'email' into table llx_actioncomm_reminder with status todo, send email, then set status to done @@ -1676,7 +1679,9 @@ class ActionComm extends CommonObject $sql = "DELETE FROM ".MAIN_DB_PREFIX."actioncomm_reminder WHERE dateremind < '".$this->db->jdate($now - (3600 * 24 * 32))."'"; $this->db->query($sql); - return 0; + $this->db->commit(); + + return $error; } } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 94118d415bf..55dfacdf2c5 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -205,8 +205,6 @@ $formother = new FormOther($db); $socstatic = new Societe($db); $contracttmp = new Contrat($db); -llxHeader('', $langs->trans("Contracts")); - $sql = 'SELECT'; $sql.= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public,"; $sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client,'; @@ -309,489 +307,504 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $sql.= $db->plimit($limit + 1, $offset); $resql=$db->query($sql); -if ($resql) +if (! $resql) { - $num = $db->num_rows($resql); - $i = 0; + dol_print_error($db); + exit; +} - $arrayofselected=is_array($toselect)?$toselect:array(); +$num = $db->num_rows($resql); - if ($socid > 0) +// Direct jump if only one record found +if ($num == 1 && ! empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) +{ + $obj = $db->fetch_object($resql); + $id = $obj->rowid; + header("Location: ".DOL_URL_ROOT.'/contrat/card.php?id='.$id); + exit; +} + + +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $langs->trans("Contracts")); + +$i = 0; + +$arrayofselected=is_array($toselect)?$toselect:array(); + +if ($socid > 0) +{ + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_name)) $search_name = $soc->name; +} + +$param=''; +if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); +if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; +if ($sall != '') $param.='&sall='.urlencode($sall); +if ($search_contract != '') $param.='&search_contract='.urlencode($search_contract); +if ($search_name != '') $param.='&search_name='.urlencode($search_name); +if ($search_email != '') $param.='&search_email='.urlencode($search_email); +if ($search_ref_customer != '') $param.='&search_ref_customer='.urlencode($search_ref_customer); +if ($search_ref_supplier != '') $param.='&search_ref_supplier='.urlencode($search_ref_supplier); +if ($search_op2df != '') $param.='&search_op2df='.urlencode($search_op2df); +if ($search_dfyear != '') $param.='&search_dfyear='.urlencode($search_dfyear); +if ($search_dfmonth != '') $param.='&search_dfmonth='.urlencode($search_dfmonth); +if ($search_sale != '') $param.='&search_sale=' .urlencode($search_sale); +if ($search_user != '') $param.='&search_user=' .urlencode($search_user); +if ($search_product_category != '') $param.='&search_product_category=' .urlencode($search_product_category); +if ($show_files) $param.='&show_files=' .urlencode($show_files); +if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); +// Add $param from extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; + +// List of mass actions available +$arrayofmassactions = array( + 'presend'=>$langs->trans("SendByMail"), + 'builddoc'=>$langs->trans("PDFMerge"), +); +if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); +if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); +$massactionbutton=$form->selectMassAction('', $arrayofmassactions); + +print ''; +if ($optioncss != '') print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + +print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit); + +$topicmail="SendContractRef"; +$modelmail="contract"; +$objecttmp=new Contrat($db); +$trackid='con'.$object->id; +include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; + +if ($sall) +{ + foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); + print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); +} + +$moreforfilter=''; + +// If the user can view prospects other than his' +if ($user->rights->societe->client->voir || $socid) +{ + $langs->load("commercial"); + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; + $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user,0,1,'maxwidth200'); + $moreforfilter.='
'; +} +// If the user can view other users +if ($user->rights->user->user->lire) +{ + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; + $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); + $moreforfilter.='
'; +} +// If the user can view categories of products +if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire)) +{ + include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; + $moreforfilter.='
'; + $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); + $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); + $moreforfilter.='
'; +} + +$parameters=array(); +$reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook +if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; +else $moreforfilter = $hookmanager->resPrint; + +if (! empty($moreforfilter)) +{ + print '
'; + print $moreforfilter; + print '
'; +} + +$varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; +$selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); + +print '
'; +print '
'; $facturestatic->id = $objp->facid; $facturestatic->ref = $objp->facnumber; $facturestatic->type = $objp->type; - $facturestatic->total_ht = $objp->total_ht; - $facturestatic->total_tva = $objp->total_tva; - $facturestatic->total_ttc = $objp->total_ttc; + $facturestatic->total_ht = $objp->total_ht; + $facturestatic->total_tva = $objp->total_tva; + $facturestatic->total_ttc = $objp->total_ttc; + + print '
'; print $facturestatic->getNomUrl(1); print '
'."\n"; + +print ''; +if (! empty($arrayfields['c.ref']['checked'])) +{ + print ''; +} +if (! empty($arrayfields['c.ref_customer']['checked'])) +{ + print ''; +} +if (! empty($arrayfields['c.ref_supplier']['checked'])) +{ + print ''; +} +if (! empty($arrayfields['s.nom']['checked'])) +{ + print ''; +} +if (! empty($arrayfields['s.email']['checked'])) +{ + print ''; +} +// Town +if (! empty($arrayfields['s.town']['checked'])) print ''; +// Zip +if (! empty($arrayfields['s.zip']['checked'])) print ''; +// State +if (! empty($arrayfields['state.nom']['checked'])) +{ + print ''; +} +// Country +if (! empty($arrayfields['country.code_iso']['checked'])) +{ + print ''; +} +// Company type +if (! empty($arrayfields['typent.code']['checked'])) +{ + print ''; +} +if (! empty($arrayfields['sale_representative']['checked'])) +{ + print ''; +} +if (! empty($arrayfields['c.date_contrat']['checked'])) +{ + // Date contract + print ''; +} +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; + +// Fields from hook +$parameters=array('arrayfields'=>$arrayfields); +$reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +// Date creation +if (! empty($arrayfields['c.datec']['checked'])) +{ + print ''; +} +// Date modification +if (! empty($arrayfields['c.tms']['checked'])) +{ + print ''; +} +// First end date +if (! empty($arrayfields['lower_planned_end_date']['checked'])) +{ + print ''; +} +// Status +if (! empty($arrayfields['status']['checked'])) +{ + print ''; +} +print ''; +print "\n"; + +print ''; +if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref","","$param",'',$sortfield,$sortorder); +if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder); +if (! empty($arrayfields['c.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); +if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); +if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email","","$param",'',$sortfield,$sortorder); +if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); +if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); +if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); +if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "","","$param",'',$sortfield,$sortorder); +if (! empty($arrayfields['c.date_contrat']['checked'])) print_liste_field_titre($arrayfields['c.date_contrat']['label'], $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder); +// Extra fields +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; +// Hook fields +$parameters=array('arrayfields'=>$arrayfields); +$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); +if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); +if (! empty($arrayfields['lower_planned_end_date']['checked'])) print_liste_field_titre($arrayfields['lower_planned_end_date']['label'],$_SERVER["PHP_SELF"],"lower_planned_end_date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); +if (! empty($arrayfields['status']['checked'])) +{ + print_liste_field_titre($staticcontratligne->LibStatut(0,3), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(4,3,0), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(4,3,1), '', '', '', '', 'width="16"'); + print_liste_field_titre($staticcontratligne->LibStatut(5,3), '', '', '', '', 'width="16"'); +} +print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); +print "\n"; + +while ($i < min($num,$limit)) +{ + $obj = $db->fetch_object($resql); + + $contracttmp->ref=$obj->ref; + $contracttmp->id=$obj->rowid; + $contracttmp->ref_customer=$obj->ref_customer; + $contracttmp->ref_supplier=$obj->ref_supplier; + + if ($obj->socid > 0) { - $soc = new Societe($db); - $soc->fetch($socid); - if (empty($search_name)) $search_name = $soc->name; + $result=$socstatic->fetch($obj->socid); } - $param=''; - if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage); - if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - if ($sall != '') $param.='&sall='.urlencode($sall); - if ($search_contract != '') $param.='&search_contract='.urlencode($search_contract); - if ($search_name != '') $param.='&search_name='.urlencode($search_name); - if ($search_email != '') $param.='&search_email='.urlencode($search_email); - if ($search_ref_customer != '') $param.='&search_ref_customer='.urlencode($search_ref_customer); - if ($search_ref_supplier != '') $param.='&search_ref_supplier='.urlencode($search_ref_supplier); - if ($search_op2df != '') $param.='&search_op2df='.urlencode($search_op2df); - if ($search_dfyear != '') $param.='&search_dfyear='.urlencode($search_dfyear); - if ($search_dfmonth != '') $param.='&search_dfmonth='.urlencode($search_dfmonth); - if ($search_sale != '') $param.='&search_sale=' .urlencode($search_sale); - if ($search_user != '') $param.='&search_user=' .urlencode($search_user); - if ($search_product_category != '') $param.='&search_product_category=' .urlencode($search_product_category); - if ($show_files) $param.='&show_files=' .urlencode($show_files); - if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss); - // Add $param from extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; - - // List of mass actions available - $arrayofmassactions = array( - 'presend'=>$langs->trans("SendByMail"), - 'builddoc'=>$langs->trans("PDFMerge"), - ); - if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete"); - if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); - $massactionbutton=$form->selectMassAction('', $arrayofmassactions); - - print ''; - if ($optioncss != '') print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'title_commercial.png', 0, '', '', $limit); - - $topicmail="SendContractRef"; - $modelmail="contract"; - $objecttmp=new Contrat($db); - $trackid='con'.$object->id; - include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; - - if ($sall) - { - foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall); - } - - $moreforfilter=''; - - // If the user can view prospects other than his' - if ($user->rights->societe->client->voir || $socid) - { - $langs->load("commercial"); - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': '; - $moreforfilter.=$formother->select_salesrepresentatives($search_sale,'search_sale',$user,0,1,'maxwidth200'); - $moreforfilter.='
'; - } - // If the user can view other users - if ($user->rights->user->user->lire) - { - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': '; - $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200'); - $moreforfilter.='
'; - } - // If the user can view categories of products - if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire)) - { - include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $moreforfilter.='
'; - $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': '; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1); - $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1); - $moreforfilter.='
'; - } - - $parameters=array(); - $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook - if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint; - else $moreforfilter = $hookmanager->resPrint; - - if (! empty($moreforfilter)) - { - print '
'; - print $moreforfilter; - print '
'; - } - - $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; - $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1); - - print '
'; - print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print $form->select_country($search_country,'search_country','',0,'maxwidth100'); + print ''; + print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); + print ''; + //print $langs->trans('Month').': '; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + //print ' '.$langs->trans('Year').': '; + $syear = $year; + print $formother->selectyear($syear,'year',1, 20, 5, 0, 0, '', 'widthauto'); + print ''; + print ''; + print ''; + $arrayofoperators=array('0'=>'','='=>'=','<='=>'<=','>='=>'>='); + print $form->selectarray('search_op2df',$arrayofoperators,$search_op2df,0); + print '
'; + print $formother->select_month($search_dfmonth, 'search_dfmonth', 1); + print ' '; + $formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5); + print '
'; +$searchpicto=$form->showFilterButtons(); +print $searchpicto; +print '
'."\n"; - - print ''; + print ''; if (! empty($arrayfields['c.ref']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['c.ref_customer']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['c.ref_supplier']['checked'])) { - print ''; + print ''; } if (! empty($arrayfields['s.nom']['checked'])) { - print ''; } if (! empty($arrayfields['s.email']['checked'])) { - print ''; + print ''; } // Town - if (! empty($arrayfields['s.town']['checked'])) print ''; + if (! empty($arrayfields['s.town']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } // Zip - if (! empty($arrayfields['s.zip']['checked'])) print ''; + if (! empty($arrayfields['s.zip']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + } // State if (! empty($arrayfields['state.nom']['checked'])) { - print ''; + print "\n"; + if (! $i) $totalarray['nbfield']++; } // Country if (! empty($arrayfields['country.code_iso']['checked'])) { - print ''; + if (! $i) $totalarray['nbfield']++; } - // Company type + // Type ent if (! empty($arrayfields['typent.code']['checked'])) { - print ''; + if (! $i) $totalarray['nbfield']++; } if (! empty($arrayfields['sale_representative']['checked'])) { - print ''; - } - if (! empty($arrayfields['c.date_contrat']['checked'])) - { - // Date contract - print ''; } + // Date + if (! empty($arrayfields['c.date_contrat']['checked'])) + { + print ''; + } // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - + include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook + $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); + $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Date creation if (! empty($arrayfields['c.datec']['checked'])) { - print ''; + if (! $i) $totalarray['nbfield']++; } // Date modification if (! empty($arrayfields['c.tms']['checked'])) { - print ''; + if (! $i) $totalarray['nbfield']++; } - // First end date + // Date lower end date if (! empty($arrayfields['lower_planned_end_date']['checked'])) { - print ''; + print ''; + if (! $i) $totalarray['nbfield']++; } // Status if (! empty($arrayfields['status']['checked'])) { - print ''; + print ''; + print ''; + print ''; + print ''; + } + // Action column + print ''; + if (! $i) $totalarray['nbfield']++; + print "\n"; - - print ''; - if (! empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref","","$param",'',$sortfield,$sortorder); - if (! empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder); - if (! empty($arrayfields['c.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); - if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder); - if (! empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email","","$param",'',$sortfield,$sortorder); - if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder); - if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "","","$param",'',$sortfield,$sortorder); - if (! empty($arrayfields['c.date_contrat']['checked'])) print_liste_field_titre($arrayfields['c.date_contrat']['label'], $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder); - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; - // Hook fields - $parameters=array('arrayfields'=>$arrayfields); - $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['lower_planned_end_date']['checked'])) print_liste_field_titre($arrayfields['lower_planned_end_date']['label'],$_SERVER["PHP_SELF"],"lower_planned_end_date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder); - if (! empty($arrayfields['status']['checked'])) - { - print_liste_field_titre($staticcontratligne->LibStatut(0,3), '', '', '', '', 'width="16"'); - print_liste_field_titre($staticcontratligne->LibStatut(4,3,0), '', '', '', '', 'width="16"'); - print_liste_field_titre($staticcontratligne->LibStatut(4,3,1), '', '', '', '', 'width="16"'); - print_liste_field_titre($staticcontratligne->LibStatut(5,3), '', '', '', '', 'width="16"'); - } - print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch '); - print "\n"; - - while ($i < min($num,$limit)) - { - $obj = $db->fetch_object($resql); - - $contracttmp->ref=$obj->ref; - $contracttmp->id=$obj->rowid; - $contracttmp->ref_customer=$obj->ref_customer; - $contracttmp->ref_supplier=$obj->ref_supplier; - - if ($obj->socid > 0) - { - $result=$socstatic->fetch($obj->socid); - } - - print ''; - if (! empty($arrayfields['c.ref']['checked'])) - { - print ''; - - print ''; - } - if (! empty($arrayfields['c.ref_customer']['checked'])) - { - print ''; - } - if (! empty($arrayfields['c.ref_supplier']['checked'])) - { - print ''; - } - if (! empty($arrayfields['s.nom']['checked'])) - { - print ''; - } - if (! empty($arrayfields['s.email']['checked'])) - { - print ''; - } - // Town - if (! empty($arrayfields['s.town']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Zip - if (! empty($arrayfields['s.zip']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // State - if (! empty($arrayfields['state.nom']['checked'])) - { - print "\n"; - if (! $i) $totalarray['nbfield']++; - } - // Country - if (! empty($arrayfields['country.code_iso']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Type ent - if (! empty($arrayfields['typent.code']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - if (! empty($arrayfields['sale_representative']['checked'])) - { - // Sales representatives - print ''; - } - // Date - if (! empty($arrayfields['c.date_contrat']['checked'])) - { - print ''; - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - // Fields from hook - $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj); - $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Date creation - if (! empty($arrayfields['c.datec']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Date modification - if (! empty($arrayfields['c.tms']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Date lower end date - if (! empty($arrayfields['lower_planned_end_date']['checked'])) - { - print ''; - if (! $i) $totalarray['nbfield']++; - } - // Status - if (! empty($arrayfields['status']['checked'])) - { - print ''; - print ''; - print ''; - print ''; - } - // Action column - print ''; - if (! $i) $totalarray['nbfield']++; - - print "\n"; - $i++; - } - $db->free($resql); - - print '
'; - print ''; + print ''; + print $contracttmp->getNomUrl(1); + if ($obj->nb_late) print img_warning($langs->trans("Late")); + if (!empty($obj->note_private) || !empty($obj->note_public)) + { + print ' '; + print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; + print ''; + } + + $filename=dol_sanitizeFileName($obj->ref); + $filedir=$conf->contrat->dir_output . '/' . dol_sanitizeFileName($obj->ref); + $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; + print $formfile->getDocumentsLink($contracttmp->element, $filename, $filedir); + print ''; - print ''; - print ''.$obj->ref_customer.''; - print ''; - print ''.$obj->ref_supplier.''; - print ''; + print ''; + //print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''; + if ($obj->socid > 0) + { + print $socstatic->getNomUrl(1, ''); + } print ''; - print ''; - print ''.$obj->email.''; + print $obj->town; + print ''; + print $obj->zip; + print ''; - print ''; - print '".$obj->state_name."'; - print $form->select_country($search_country,'search_country','',0,'maxwidth100'); + print ''; + $tmparray=getCountry($obj->fk_pays,'all'); + print $tmparray['label']; print ''; - print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); + print ''; + if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); + print $typenArray[$obj->typent_code]; print ''; - //print $langs->trans('Month').': '; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; - //print ' '.$langs->trans('Year').': '; - $syear = $year; - print $formother->selectyear($syear,'year',1, 20, 5, 0, 0, '', 'widthauto'); + // Sales representatives + print ''; + if ($obj->socid > 0) + { + $listsalesrepresentatives=$socstatic->getSalesRepresentatives($user); + if ($listsalesrepresentatives < 0) dol_print_error($db); + $nbofsalesrepresentative=count($listsalesrepresentatives); + if ($nbofsalesrepresentative > 3) // We print only number + { + print ''; + print $nbofsalesrepresentative; + print ''; + } + else if ($nbofsalesrepresentative > 0) + { + $userstatic=new User($db); + $j=0; + foreach($listsalesrepresentatives as $val) + { + $userstatic->id=$val['id']; + $userstatic->lastname=$val['lastname']; + $userstatic->firstname=$val['firstname']; + $userstatic->email=$val['email']; + $userstatic->statut=$val['statut']; + $userstatic->entity=$val['entity']; + $userstatic->photo=$val['photo']; + + //print '
': + print $userstatic->getNomUrl(-2); + $j++; + if ($j < $nbofsalesrepresentative) print ' '; + //print '
'; + } + } + //else print $langs->trans("NoSalesRepresentativeAffected"); + } + else + { + print ' '; + } print '
'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').''; + print ''; + print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); print ''; + print ''; + print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); print ''; - $arrayofoperators=array('0'=>'','='=>'=','<='=>'<=','>='=>'>='); - print $form->selectarray('search_op2df',$arrayofoperators,$search_op2df,0); - print '
'; - print $formother->select_month($search_dfmonth, 'search_dfmonth', 1); - print ' '; - $formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5); - print '
'; + print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day', 'tzuser'); + print ''.($obj->nb_initial>0?$obj->nb_initial:'').''.($obj->nb_running>0?$obj->nb_running:'').''.($obj->nb_expired>0?$obj->nb_expired:'').''.($obj->nb_closed>0 ?$obj->nb_closed:'').''; + if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + { + $selected=0; + if (in_array($obj->rowid, $arrayofselected)) $selected=1; + print ''; } - print ''; - $searchpicto=$form->showFilterButtons(); - print $searchpicto; print '
'; - print $contracttmp->getNomUrl(1); - if ($obj->nb_late) print img_warning($langs->trans("Late")); - if (!empty($obj->note_private) || !empty($obj->note_public)) - { - print ' '; - print ''.img_picto($langs->trans("ViewPrivateNote"),'object_generic').''; - print ''; - } - - $filename=dol_sanitizeFileName($obj->ref); - $filedir=$conf->contrat->dir_output . '/' . dol_sanitizeFileName($obj->ref); - $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - print $formfile->getDocumentsLink($contracttmp->element, $filename, $filedir); - print ''.$obj->ref_customer.''.$obj->ref_supplier.''; - //print ''.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.''; - if ($obj->socid > 0) - { - print $socstatic->getNomUrl(1, ''); - } - print ''.$obj->email.''; - print $obj->town; - print ''; - print $obj->zip; - print '".$obj->state_name."'; - $tmparray=getCountry($obj->fk_pays,'all'); - print $tmparray['label']; - print ''; - if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1); - print $typenArray[$obj->typent_code]; - print ''; - if ($obj->socid > 0) - { - $listsalesrepresentatives=$socstatic->getSalesRepresentatives($user); - if ($listsalesrepresentatives < 0) dol_print_error($db); - $nbofsalesrepresentative=count($listsalesrepresentatives); - if ($nbofsalesrepresentative > 3) // We print only number - { - print ''; - print $nbofsalesrepresentative; - print ''; - } - else if ($nbofsalesrepresentative > 0) - { - $userstatic=new User($db); - $j=0; - foreach($listsalesrepresentatives as $val) - { - $userstatic->id=$val['id']; - $userstatic->lastname=$val['lastname']; - $userstatic->firstname=$val['firstname']; - $userstatic->email=$val['email']; - $userstatic->statut=$val['statut']; - $userstatic->entity=$val['entity']; - $userstatic->photo=$val['photo']; - - //print '
': - print $userstatic->getNomUrl(-2); - $j++; - if ($j < $nbofsalesrepresentative) print ' '; - //print '
'; - } - } - //else print $langs->trans("NoSalesRepresentativeAffected"); - } - else - { - print ' '; - } - print '
'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').''; - print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser'); - print ''; - print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day', 'tzuser'); - print ''.($obj->nb_initial>0?$obj->nb_initial:'').''.($obj->nb_running>0?$obj->nb_running:'').''.($obj->nb_expired>0?$obj->nb_expired:'').''.($obj->nb_closed>0 ?$obj->nb_closed:'').''; - if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - { - $selected=0; - if (in_array($obj->rowid, $arrayofselected)) $selected=1; - print ''; - } - print '
'; - print '
'; - - print ''; - - $hidegeneratedfilelistifempty=1; - if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0; - - // Show list of available documents - $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource.=str_replace('&','&',$param); - - $filedir=$diroutputmassaction; - $genallowed=$user->rights->contrat->lire; - $delallowed=$user->rights->contrat->lire; - - print $formfile->showdocuments('massfilesarea_contract','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty); -} -else -{ - dol_print_error($db); + $i++; } +$db->free($resql); + +print ''; +print '
'; + +print ''; + +$hidegeneratedfilelistifempty=1; +if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0; + +// Show list of available documents +$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; +$urlsource.=str_replace('&','&',$param); + +$filedir=$diroutputmassaction; +$genallowed=$user->rights->contrat->lire; +$delallowed=$user->rights->contrat->lire; + +print $formfile->showdocuments('massfilesarea_contract','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty); llxFooter(); diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 3314830b68a..3a7a79122c9 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -449,7 +449,6 @@ class Utils } } - return 0; } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 5024ec48d5d..376c9bcfc38 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -470,14 +470,23 @@ class MyObject extends CommonObject { global $conf, $langs; + //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log'; + + $error = 0; $this->output = ''; $this->error=''; dol_syslog(__METHOD__, LOG_DEBUG); + $now = dol_now(); + + $this->db->begin(); + // ... - return 0; + $this->db->commit(); + + return $error; } } diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 111da0c46ea..6b2199925be 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -504,40 +504,4 @@ class SocieteAccount extends CommonObject { $this->initAsSpecimenCommon(); } - - - /** - * Action executed by scheduler - * CAN BE A CRON TASK - * - * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK) - */ - public function doScheduledJob() - { - global $conf, $langs; - - $this->output = ''; - $this->error=''; - - dol_syslog(__METHOD__, LOG_DEBUG); - - // ... - - return 0; - } } - -/** - * Class societeAccountLine. You can also remove this and generate a CRUD class for lines objects. - */ -/* -class societeAccountLine -{ - // @var int ID - public $id; - // @var mixed Sample line property 1 - public $prop1; - // @var mixed Sample line property 2 - public $prop2; -} -*/ \ No newline at end of file From 04ca623ced13074f97dbf37f9ddef79ba8c58498 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Mar 2018 13:12:14 +0200 Subject: [PATCH 50/53] More tests --- test/phpunit/FunctionsLibTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index d2dce75b4a5..eb84f6cd348 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -345,6 +345,12 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase $input=''; $after=dol_textishtml($input); $this->assertTrue($after, 'Test with a tag'); + $input='This is a text with html spaces'; + $after=dol_textishtml($input); + $this->assertTrue($after, 'Test with a  '); + $input='This is a text with accent é'; + $after=dol_textishtml($input); + $this->assertTrue($after, 'Test with a é'); // False $input='xxx < br>'; From a5dd98701e7e781dce2ed7de527616087dc5b52e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Mar 2018 13:40:22 +0200 Subject: [PATCH 51/53] Too verbose log --- htdocs/core/class/interfaces.class.php | 4 ++-- .../triggers/interface_50_modTicketsup_TicketEmail.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index a34754b8d4c..655969d73f6 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -169,12 +169,12 @@ class Interfaces if (method_exists($objMod, 'runTrigger')) // New method to implement { - dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_INFO); + //dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_DEBUG); $result=$objMod->runTrigger($action,$object,$user,$langs,$conf); } elseif (method_exists($objMod, 'run_trigger')) // Deprecated method { - dol_syslog(get_class($this)."::run_triggers action=".$action." Launch run_trigger for file '".$files[$key]."'", LOG_INFO); + dol_syslog(get_class($this)."::run_triggers action=".$action." Launch old method run_trigger (rename your trigger into runTrigger) for file '".$files[$key]."'", LOG_WARNING); $result=$objMod->run_trigger($action,$object,$user,$langs,$conf); } else diff --git a/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php index 4a7ec9df711..b1dd9fb282a 100644 --- a/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicketsup_TicketEmail.class.php @@ -93,7 +93,7 @@ class InterfaceTicketEmail extends DolibarrTriggers /** * Function called when a Dolibarrr business event is done. - * All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers + * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers * * @param string $action Event action code * @param Object $object Object From 53dde8dc0c54d37b1e31c6d41cfc0d7f8076b8a4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Mar 2018 15:00:43 +0200 Subject: [PATCH 52/53] Fix confirmation email for membership payment --- htdocs/adherents/class/adherent.class.php | 4 +++- htdocs/core/lib/functions.lib.php | 6 +++++- htdocs/core/tpl/card_presend.tpl.php | 9 ++------- htdocs/public/payment/paymentok.php | 1 + 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 4e6c540d2a5..faba841e7c6 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -147,9 +147,11 @@ class Adherent extends CommonObject if ($msgishtml == -1) { $msgishtml = 0; - if (dol_textishtml($text,1)) $msgishtml = 1; + if (dol_textishtml($text,0)) $msgishtml = 1; } + dol_syslog('send_an_email msgishtml='.$msgishtml); + $texttosend=$this->makeSubstitution($text); $subjecttosend=$this->makeSubstitution($subject); if ($msgishtml) $texttosend=dol_htmlentitiesbr($texttosend); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e18a0f111ff..aee9ed61f62 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5686,6 +5686,7 @@ function dol_textishtml($msg,$option=0) elseif (preg_match('//i',$msg)) return true; elseif (preg_match('/&[A-Z0-9]{1,6};/i',$msg)) return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp) elseif (preg_match('/&#[0-9]{2,3};/i',$msg)) return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp) + return false; } } @@ -5775,6 +5776,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob '__MYCOMPANY_COUNTRY_ID__' => $mysoc->country_id )); } + if (($onlykey || is_object($object)) && (empty($exclude) || ! in_array('object', $exclude))) { if ($onlykey) @@ -5789,8 +5791,9 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__'; $substitutionarray['__THIRDPARTY_EMAIL__'] = '__THIRDPARTY_EMAIL__'; - if (is_object($object) && $object->element == 'shipping') + if (is_object($object) && $object->element == 'member') { + $substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__'; $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; $substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__'; $substitutionarray['__MEMBER_LASTNAME__'] = '__MEMBER_LASTNAME__'; @@ -5830,6 +5833,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob $birthday = dol_print_date($object->birth,'day'); + $substitutionarray['__MEMBER_ID__']=$object->id; if (method_exists($object, 'getCivilityLabel')) $substitutionarray['__MEMBER_CIVILITY__'] = $object->getCivilityLabel(); $substitutionarray['__MEMBER_FIRSTNAME__']=$msgishtml?dol_htmlentitiesbr($object->firstname):$object->firstname; $substitutionarray['__MEMBER_LASTNAME__']=$msgishtml?dol_htmlentitiesbr($object->lastname):$object->lastname; diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 43cacab0e1c..edeabc5865d 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -108,6 +108,7 @@ if ($action == 'presend') // Create form for email include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; $formmail = new FormMail($db); + $formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang); $formmail->fromtype = (GETPOST('fromtype')?GETPOST('fromtype'):(!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE)?$conf->global->MAIN_MAIL_DEFAULT_FROMTYPE:'user')); @@ -178,13 +179,7 @@ if ($action == 'presend') $formmail->param['returnurl'] = $_SERVER["PHP_SELF"] . '?id=' . $object->id; $formmail->param['fileinit'] = array($file); - // Init list of files - /*if (GETPOST('mode','alpha') == 'init') - { - $formmail->clear_attached_files(); - - $formmail->add_attached_files($file, basename($file), dol_mimetype($file)); - }*/ + $formmail->withsubstit = 1; // Show form print $formmail->get_form(); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 4eb22707bef..ec92989f031 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -512,6 +512,7 @@ if ($ispaymentok) } $result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1); + if ($result < 0) { $errmsg=$object->error; From e7edf41e19483a1b02010e624989c2016cc5e1d6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Mar 2018 15:21:32 +0200 Subject: [PATCH 53/53] More complete error message --- htdocs/public/payment/paymentok.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index ec92989f031..389daafcd15 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -529,7 +529,7 @@ if ($ispaymentok) } else { - $postactionmessages[] = 'Failed to get a valid value for "amount paid" or "payment type" to record the payment of subscription for member '.$tmptag['MEM']; + $postactionmessages[] = 'Failed to get a valid value for "amount paid" or "payment type" to record the payment of subscription for member '.$tmptag['MEM'].'. May be payment was already recorded.'; $ispostactionok = -1; } } @@ -646,7 +646,7 @@ if ($ispaymentok) } else { - $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['INV']; + $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['INV'].'. May be payment was already recorded.'; $ispostactionok = -1; } }