From 98a46fd335221f55d7f52012752b0737b6ead828 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 28 Mar 2016 08:21:02 +0200 Subject: [PATCH 1/6] NEW: Accountancy Use clean_account to remove 0 at the right when we create an account in chart of accounts --- htdocs/accountancy/admin/card.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 7810ad4f3ef..c07c1f6b301 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -1,6 +1,6 @@ - - * Copyright (C) 2013-2015 Alexandre Spangaro + * Copyright (C) 2013-2016 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -18,9 +18,9 @@ */ /** - * \file htdocs/accountancy/admin/card.php - * \ingroup Accounting Expert - * \brief Card accounting account + * \file htdocs/accountancy/admin/card.php + * \ingroup Advanced accountancy + * \brief Card of accounting account */ require '../../main.inc.php'; @@ -55,11 +55,14 @@ if ($action == 'add') { dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); $result = $db->query($sql); $obj = $db->fetch_object($result); + + // Clean code + $account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right $accounting->fk_pcg_version = $obj->pcg_version; $accounting->pcg_type = GETPOST('pcg_type'); $accounting->pcg_subtype = GETPOST('pcg_subtype'); - $accounting->account_number = GETPOST('account_number'); + $accounting->account_number = $account_number; $accounting->account_parent = GETPOST('account_parent', 'int'); $accounting->label = GETPOST('label', 'alpha'); $accounting->active = 1; @@ -89,10 +92,13 @@ if ($action == 'add') { $result2 = $db->query($sql); $obj = $db->fetch_object($result2); + // Clean code + $account_number = clean_account(GETPOST('account_number')); // Accounting account without zero on the right + $accounting->fk_pcg_version = $obj->pcg_version; $accounting->pcg_type = GETPOST('pcg_type'); $accounting->pcg_subtype = GETPOST('pcg_subtype'); - $accounting->account_number = GETPOST('account_number'); + $accounting->account_number = $account_number; $accounting->account_parent = GETPOST('account_parent', 'int'); $accounting->label = GETPOST('label', 'alpha'); From 2e5cc98e5974f4b1ffce583d8456a06f8d0752c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Mar 2016 20:06:01 +0200 Subject: [PATCH 2/6] Fix into badges visibility --- htdocs/contact/perso.php | 6 +++--- htdocs/core/lib/project.lib.php | 14 ++++++++++--- htdocs/projet/tasks/time.php | 37 ++++++++++++++++++--------------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 89b8be57e35..dc5db9445bb 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -59,7 +59,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact $object->old_name=''; $object->old_firstname=''; // Logo/Photo save - $dir= $conf->societe->dir_output.'/contact/' . get_exdir($object->id,2,0,1,$object,'contact').'/photos'; + $dir= $conf->societe->dir_output.'/contact/' . get_exdir($object->id,0,0,1,$object,'contact').'/photos'; $file_OK = is_uploaded_file($_FILES['photo']['tmp_name']); if ($file_OK) @@ -68,8 +68,8 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact if (GETPOST('deletephoto')) { require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; - $fileimg=$conf->societe->dir_output.'/contact/'.get_exdir($object->id,2,0,1,$object,'contact').'/photos/'.$object->photo; - $dirthumbs=$conf->societe->dir_output.'/contact/'.get_exdir($object->id,2,0,1,$object,'contact').'/photos/thumbs'; + $fileimg=$conf->societe->dir_output.'/contact/'.get_exdir($object->id,0,0,1,$object,'contact').'/photos/'.$object->photo; + $dirthumbs=$conf->societe->dir_output.'/contact/'.get_exdir($object->id,0,0,1,$object,'contact').'/photos/thumbs'; dol_delete_file($fileimg); dol_delete_dir_recursive($dirthumbs); } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 92229a72d23..479e46258be 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -93,11 +93,17 @@ function project_prepare_head($object) // Then tab for sub level of projet, i mean tasks $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$object->id; $head[$h][1] = $langs->trans("Tasks"); + + require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; + $taskstatic=new Task($db); + $nbTasks=count($taskstatic->getTasksArray(0, 0, $object->id, 0, 0)); + if ($nbTasks > 0) $head[$h][1].= ' '.($nbTasks).''; $head[$h][2] = 'tasks'; $h++; $head[$h][0] = DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id; $head[$h][1] = $langs->trans("Gantt"); + if ($nbTasks > 0) $head[$h][1].= ' '.($nbTasks).''; $head[$h][2] = 'gantt'; $h++; } @@ -116,7 +122,7 @@ function project_prepare_head($object) */ function task_prepare_head($object) { - global $langs, $conf, $user; + global $db, $langs, $conf, $user; $h = 0; $head = array(); @@ -156,8 +162,10 @@ function task_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':''); $filesdir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->project->ref) . '/' .dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $listoffiles=dol_dir_list($filesdir,'files',1,'','thumbs'); - $head[$h][1] = (count($listoffiles)?$langs->trans('DocumentsNb',count($listoffiles)):$langs->trans('Documents')); + $nbFiles = count(dol_dir_list($filesdir,'files',0,'','(\.meta|_preview\.png)$')); + $nbLinks=Link::count($db, $object->element, $object->id); + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; $head[$h][2] = 'task_document'; $h++; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 976e0013431..29c3cd85bad 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -299,25 +299,28 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) /* * Actions */ - print '
'; - - if ($user->rights->projet->all->creer || $user->rights->projet->creer) + if (empty($id)) { - if ($object->public || $userWrite > 0) - { - print ''.$langs->trans('AddTask').''; - } - else - { - print ''.$langs->trans('AddTask').''; - } + print '
'; + + if ($user->rights->projet->all->creer || $user->rights->projet->creer) + { + if ($object->public || $userWrite > 0) + { + print ''.$langs->trans('AddTask').''; + } + else + { + print ''.$langs->trans('AddTask').''; + } + } + else + { + print ''.$langs->trans('AddTask').''; + } + + print '
'; } - else - { - print ''.$langs->trans('AddTask').''; - } - - print '
'; } } From 83dd3081d5f39139b16f71f67ad0bdffdc41a71b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Mar 2016 21:07:53 +0200 Subject: [PATCH 3/6] FIX #4880. Lang should not be requied to fetch a user --- htdocs/user/class/user.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 602d70d540d..dc1cb5ebf34 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -162,7 +162,7 @@ class User extends CommonObject */ function fetch($id='', $login='',$sid='',$loadpersonalconf=1, $entity=-1) { - global $langs, $conf, $user; + global $conf, $user; // Clean parameters $login=trim($login); @@ -256,7 +256,7 @@ class User extends CommonObject $this->country_id = $obj->country_id; $this->country_code = $obj->country_id?$obj->country_code:''; - $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; + //$this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->transnoentities('Country'.$obj->country_code):$obj->country):''; $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; From 32080e99ddb0304be304c255c84bdefb9543eba7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Mar 2016 21:14:12 +0200 Subject: [PATCH 4/6] Fix dolistore url --- htdocs/admin/tools/update.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index cb4890f77f1..45b20588121 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -40,8 +40,8 @@ if (GETPOST('msg','alpha')) { $urldolibarr='http://www.dolibarr.org/downloads/'; -$urldolibarrmodules='http://www.dolistore.com/'; -$urldolibarrthemes='http://www.dolistore.com/'; +$urldolibarrmodules='https://www.dolistore.com/'; +$urldolibarrthemes='https://www.dolistore.com/'; $dolibarrroot=preg_replace('/([\\/]+)$/i','',DOL_DOCUMENT_ROOT); $dolibarrroot=preg_replace('/([^\\/]+)$/i','',$dolibarrroot); $dolibarrdataroot=preg_replace('/([\\/]+)$/i','',DOL_DATA_ROOT); From ff96ebf3814163f5a1e2ca30899c453d3ae0e041 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Mar 2016 22:09:13 +0200 Subject: [PATCH 5/6] Enahnce navigation --- htdocs/core/class/html.form.class.php | 4 ++-- htdocs/theme/eldy/style.css.php | 10 ++++++++++ htdocs/theme/md/style.css.php | 2 ++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 25775c36a77..6181f6eb6bf 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5501,8 +5501,8 @@ class Form //$previous_ref = $object->ref_previous?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Previous"),'previous.png'):' ').'':''; //$next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?img_picto($langs->trans("Next"),'next.png'):' ').'':''; - $previous_ref = $object->ref_previous?''.(empty($conf->dol_use_jmobile)?'<':' ').'':''; - $next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?'>':' ').'':''; + $previous_ref = $object->ref_previous?''.(empty($conf->dol_use_jmobile)?'<':' ').'':''.(empty($conf->dol_use_jmobile)?'<':' ').''; + $next_ref = $object->ref_next?''.(empty($conf->dol_use_jmobile)?'>':' ').'':''.(empty($conf->dol_use_jmobile)?'>':' ').''; //print "xx".$previous_ref."x".$next_ref; $ret.='
'; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 17187fba7fc..00701e9621d 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2292,6 +2292,16 @@ div.pagination li.pagination span { } div.pagination li.pagination span.inactive { cursor: default; + color: #ccc; +} +div.pagination li a.inactive:hover, +div.pagination li span.inactive:hover { + background-color: #f5f5f5; + background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6)); + background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6); + background-image: -o-linear-gradient(top, #ffffff, #e6e6e6); + background-image: linear-gradient(to bottom, #ffffff, #e6e6e6); } /*div.pagination li.litext { padding-top: 8px; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 15f763ef901..e4a4eb58107 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2134,7 +2134,9 @@ div.pagination li.pagination span { } div.pagination li.pagination span.inactive { cursor: default; + color: #ccc; } + div.pagination li.litext a { border: none; padding-right: 10px; From 0d9a86db3fe8f86aab7dcf5a376e702019f3b20a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 30 Mar 2016 00:06:55 +0200 Subject: [PATCH 6/6] Minor lool enhancement --- htdocs/comm/action/card.php | 2 +- htdocs/contact/card.php | 2 +- htdocs/theme/eldy/style.css.php | 5 ++++- htdocs/theme/md/img/object_category.png | Bin 104 -> 214 bytes htdocs/theme/md/style.css.php | 7 +++++-- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 19633aa13d7..991e0c4a148 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -656,7 +656,7 @@ if ($action == 'create') } // Title - print 'global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").''; + print 'global->AGENDA_USE_EVENT_TYPE)?' class="fieldrequired"':'').'>'.$langs->trans("Title").''; // Full day print ''.$langs->trans("EventOnFullDay").''; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index fca007bfd1f..cc67393d679 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -797,7 +797,7 @@ else { print ''; print ''; - print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):($object->socid?$object->socid:-1),'socid','',1); + print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):($object->socid?$object->socid:-1), 'socid', '', $langs->trans("SelectThirdParty")); print ''; print ''; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 00701e9621d..1601302c046 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -438,6 +438,9 @@ th .button { .quatrevingtpercent, .inputsearch { width: 80%; } +.soixantepercent { + width: 60%; +} textarea.centpercent { width: 96%; } @@ -3832,7 +3835,7 @@ dl.dropdown { position:absolute; top:2px; list-style:none; - max-height: 200px; + max-height: 300px; overflow: auto; } .dropdown span.value { diff --git a/htdocs/theme/md/img/object_category.png b/htdocs/theme/md/img/object_category.png index b0292d92aaec99817b1a0dff1c1c354cd715f10c..389277f400496cdd478a2daba2daf816cea10a0f 100644 GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^0zk~i!2%?E)Iu166jPG7y9>kr_Wm>bfjrIvkH}&M z25w;xW@MN(M*=9wUgGKN%Km^^R@8#+c96|eppayVYeb22er|4RUI~M9QEFmIYKlU6 zW=V#EyQgnJcq5-UP?3|Ti(`ny<>Ukfra37;_}h7Ji2QMHbP0l+XkK DMT0yQ literal 104 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|m^gUf1Ln;`PB{&KuJ+zlGdl0}p zNoCC&d%ub%3D^IDqKS-$-31>iSTqKo3}pMo%up#7bIe~t{RvPjgQu&X%Q~loCIBni B9XbF2 diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index e4a4eb58107..55f4e72cb85 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -425,6 +425,9 @@ th .button { .quatrevingtpercent, .inputsearch { width: 80%; } +.soixantepercent { + width: 60%; +} textarea.centpercent { width: 96%; } @@ -3613,7 +3616,7 @@ span.noborderoncategories a, li.noborderoncategories a { line-height: normal; } span.noborderoncategories { - padding: 5px 5px 0px 5px; + padding: 3px 5px 0px 5px; } .categtextwhite, .treeview .categtextwhite.hover { color: #fff !important; @@ -3664,7 +3667,7 @@ dl.dropdown { position:absolute; top:2px; list-style:none; - max-height: 200px; + max-height: 300px; overflow: auto; } .dropdown span.value {