From f08759a17e5a06b670e48cad779d90bf1a3f7270 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Oct 2014 11:59:52 +0200 Subject: [PATCH 1/3] Fix: area to generate doc must use half size not onethird. Fix: Missing maxwidthonsmartphone. Fix: Missing backtopage Fix: Missing translation key --- htdocs/contact/card.php | 27 ++++++++++++++--------- htdocs/contact/class/contact.class.php | 7 +++--- htdocs/core/class/html.formfile.class.php | 8 +++---- htdocs/core/lib/company.lib.php | 2 +- htdocs/langs/en_US/main.lang | 2 +- htdocs/societe/soc.php | 4 ++-- 6 files changed, 29 insertions(+), 21 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index f3abf9e2bfe..1ba775268a1 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -241,13 +241,20 @@ if (empty($reshook)) $result = $object->delete(); if ($result > 0) { - header("Location: ".DOL_URL_ROOT.'/contact/list.php'); - exit; + if ($backtopage) + { + header("Location: ".$backtopage); + exit; + } + else + { + header("Location: ".DOL_URL_ROOT.'/contact/list.php'); + exit; + } } else { - setEventMessage($object->error,'errors'); - setEventMessage($object->errors,'errors'); + setEventMessage($object->error,$object->errors,'errors'); } } @@ -360,7 +367,7 @@ else { if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id.($backtopage?'&backtopage='.$backtopage:''),$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); } } @@ -1082,27 +1089,27 @@ else { if ($user->rights->societe->contact->creer) { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } if (! $object->user_id && $user->rights->user->user->creer) { - print ''.$langs->trans("CreateDolibarrLogin").''; + print ''.$langs->trans("CreateDolibarrLogin").''; } if ($user->rights->societe->contact->supprimer) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } // Activer if ($object->statut == 0 && $user->rights->societe->contact->creer) { - print ''.$langs->trans("Reactivate").''; + print ''.$langs->trans("Reactivate").''; } // Desactiver if ($object->statut == 1 && $user->rights->societe->contact->creer) { - print ''.$langs->trans("DisableUser").''; + print ''.$langs->trans("DisableUser").''; } } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 9e93523a654..3f81608c415 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -877,20 +877,21 @@ class Contact extends CommonObject * @param int $withpicto Include picto with link * @param string $option Where the link point to * @param int $maxlen Max length of + * @param string $moreparam Add more param into URL * @return string String with URL */ - function getNomUrl($withpicto=0,$option='',$maxlen=0) + function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='') { global $langs; $result=''; - $lien = ''; + $lien = ''; $lienfin=''; if ($option == 'xxx') { - $lien = ''; + $lien = ''; $lienfin=''; } diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 8c53356fa67..50c681d8366 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -474,14 +474,14 @@ class FormFile // Model if (! empty($modellist)) { - $out.= ''; + $out.= ''; $out.= ''.$langs->trans('Model').' '; if (is_array($modellist) && count($modellist) == 1) // If there is only one element { $arraykeys=array_keys($modellist); $modelselected=$arraykeys[0]; } - $out.= $form->selectarray('model',$modellist,$modelselected,$showempty,0,0); + $out.= $form->selectarray('model', $modellist, $modelselected, $showempty, 0, 0, '', 0, 0, 0, '', ''); $out.= ''; } else @@ -492,7 +492,7 @@ class FormFile } // Language code (if multilang) - $out.= ''; + $out.= ''; if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang && (! empty($modellist) || $showempty)) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; @@ -508,7 +508,7 @@ class FormFile // Button $addcolumforpicto=($delallowed || $printer || $morepicto); - $out.= ''; + $out.= ''; $genbutton = 'lastname = $obj->lastname; $contactstatic->firstname = $obj->firstname; $contactstatic->civility_id = $obj->civility_id; - print $contactstatic->getNomUrl(1); + print $contactstatic->getNomUrl(1,'',0,'&backtopage='.urlencode($backtopage)); print ''; print ''.$obj->poste.''; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 7663f520667..fd2a7d94c76 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -680,7 +680,7 @@ ViewPrivateNote=View notes XMoreLines=%s line(s) hidden PublicUrl=Public URL AddBox=Add box - +SelectElementAndClickRefresh=Select an element and click Refresh # Week day Monday=Monday Tuesday=Tuesday diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index c6909aa7cae..e9e79d52130 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -2157,7 +2157,7 @@ else if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC)) { - print '
'; + print '
'; print ''; // ancre /* @@ -2172,7 +2172,7 @@ else $somethingshown=$formfile->show_documents('company',$object->id,$filedir,$urlsource,$genallowed,$delallowed,'',0,0,0,28,0,'',0,'',$object->default_lang); - print '
'; + print '
'; print '
'; From 65f47f7d10c0eacedeb0c453284175238ed47f24 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Oct 2014 12:22:45 +0200 Subject: [PATCH 2/3] New: Add number of active notification into tab title (like we do for notes and documents) --- ChangeLog | 1 + htdocs/core/lib/company.lib.php | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d531ec987b3..0526cd214a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: +- New: Add number of active notification into tab title (like we do for notes and documents) - New: Can add product into category from category card. - New: PDF event report show project and status of event. - New: Can filter on status on interventions. diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index d897dc766e0..c5ba612b60f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -37,7 +37,7 @@ */ function societe_prepare_head($object) { - global $langs, $conf, $user; + global $db, $langs, $conf, $user; $h = 0; $head = array(); @@ -109,8 +109,29 @@ function societe_prepare_head($object) // Notifications if (! empty($conf->notification->enabled)) { + $nbNote = 0; + $sql = "SELECT COUNT(n.rowid) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n"; + $sql.= " WHERE fk_soc = ".$object->id; + $resql=$db->query($sql); + if ($resql) + { + $num = $db->num_rows($resql); + $i = 0; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + $nbNote=$obj->nb; + $i++; + } + } + else { + dol_print_error($db); + } + $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id; $head[$h][1] = $langs->trans("Notifications"); + if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; $head[$h][2] = 'notify'; $h++; } From bba6dc6398fc94c9dad8a7512f235d91c19a5018 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 12 Oct 2014 14:11:16 +0200 Subject: [PATCH 3/3] Better contrast --- htdocs/theme/eldy/style.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 43aee0161af..d9ddc1c0a07 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1692,7 +1692,7 @@ table.noborder, table.formdoc, div.noborder { border-right-style: solid; border-left-width: 1px; - border-left-color: #CCCCCC; + border-left-color: #B0B0B0; border-left-style: solid; border-bottom-width: 1px;