From ca7fa84d8018d08da968c8807bd21e7e5157ccdc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Apr 2012 10:27:42 +0200 Subject: [PATCH 1/3] Fix: eldy theme still works without css3 --- htdocs/core/class/conf.class.php | 6 +- htdocs/core/lib/functions.lib.php | 1 + htdocs/main.inc.php | 2 +- htdocs/theme/eldy/img/liste_titre.png | Bin 0 -> 312 bytes htdocs/theme/eldy/img/liste_titre2.png | Bin 0 -> 304 bytes htdocs/theme/eldy/style.css.php | 204 ++++++++++++++----------- 6 files changed, 122 insertions(+), 91 deletions(-) create mode 100644 htdocs/theme/eldy/img/liste_titre.png create mode 100755 htdocs/theme/eldy/img/liste_titre2.png diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index d876dad3a80..a2c19812434 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -357,11 +357,7 @@ class Conf $this->product->limit_size=$this->global->PRODUIT_LIMIT_SIZE; // conf->theme et $this->css - if (empty($this->global->MAIN_THEME)) - { - if (isset($_SERVER["HTTP_USER_AGENT"]) && preg_match('/(epiphany|iceweasel)/i',$_SERVER["HTTP_USER_AGENT"])) $this->global->MAIN_THEME="auguria"; - else $this->global->MAIN_THEME="eldy"; - } + if (empty($this->global->MAIN_THEME)) $this->global->MAIN_THEME="eldy"; $this->theme=$this->global->MAIN_THEME; $this->css = "/theme/".$this->theme."/style.css.php"; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0cc6ca201c9..c76924f5822 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -138,6 +138,7 @@ function getBrowserInfo() elseif (preg_match('/chrome(\/|\s)([\d\.]+)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='chrome'; $version=$reg[2]; } // we can have 'chrome (Mozilla...) chrome x.y' in one string elseif (preg_match('/chrome/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='chrome'; } elseif (preg_match('/iceweasel/i',$_SERVER["HTTP_USER_AGENT"])) { $name='iceweasel'; $version=$reg[2]; } + elseif (preg_match('/epiphany/i',$_SERVER["HTTP_USER_AGENT"])) { $name='epiphany'; $version=$reg[2]; } elseif ((empty($phone) || preg_match('/iphone/i',$_SERVER["HTTP_USER_AGENT"])) && preg_match('/safari(\/|\s)([\d\.]*)/i',$_SERVER["HTTP_USER_AGENT"], $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not. elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='opera'; $version=$reg[2]; } elseif (preg_match('/msie(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='ie'; $version=$reg[2]; } // MS products at end diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 309b93c9984..56d97ff11fc 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1222,7 +1222,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $loginhtmltext.='
'.$langs->trans("CurrentTheme").': '.$conf->theme; $s=picto_from_langcode($langs->getDefaultLang()); $loginhtmltext.='
'.$langs->trans("CurrentUserLanguage").': '.($s?$s.' ':'').$langs->getDefaultLang(); - $loginhtmltext.='
'.$langs->trans("Browser").': '.$conf->browser->name.' ('.$_SERVER['HTTP_USER_AGENT'].')'; + $loginhtmltext.='
'.$langs->trans("Browser").': '.$conf->browser->name.($conf->browser->version?' '.$conf->browser->version:'').' ('.$_SERVER['HTTP_USER_AGENT'].')'; if (! empty($conf->browser->phone)) $loginhtmltext.='
'.$langs->trans("Phone").': '.$conf->browser->phone; if (! empty($_SESSION["disablemodules"])) $loginhtmltext.='
'.$langs->trans("DisabledModules").':
'.join(', ',explode(',',$_SESSION["disablemodules"])); diff --git a/htdocs/theme/eldy/img/liste_titre.png b/htdocs/theme/eldy/img/liste_titre.png new file mode 100644 index 0000000000000000000000000000000000000000..7405550c08000d935e7c221df65770ca5630819b GIT binary patch literal 312 zcmeAS@N?(olHy`uVBq!ia0vp^%s{Nc!2~3?C|;KZQo1Fs5hcz=sfi_-`FRQEaktaVvE~ARn_Lhl^yv z`}$>dUnTasuintK!1vmZk46U!x~~6bZs?dLHF4%;iRK=0-$a*Ejia4eljJt3Tz&O= z|MMg9rI!oe&Gu=REc)j7cl9=-d~q?xGx^DBF(3OpUzU4Fbwx~SSoCs}>685?3maZ| z`$h>iuYRxfiRI?=#g2AT+_mq!9!DbnWCl=>CEd~2k%3`jKlh(RRv^F4)5S5Q;#O+^ML`xt4rk6A z_5R_9LO1m46iFSqD=lk(uZ2a~?ml-z#}+vy!O3@G7c9}VTE3T?e>uD1kN3OZ8-JXY z_o^=Ipzopr0AUSi-v9sr literal 0 HcmV?d00001 diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index bcd6caec7f6..4519a2756e3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -154,6 +154,10 @@ print 'colorbacklinepair1='.$colorbacklinepair1."\n"; print 'colorbacklinepair2='.$colorbacklinepair2."\n"; print '*/'."\n"; +$usecss3=true; +if ($conf->browser->name == 'ie' && round($conf->browser->version,2) < 10) $usecss3=false; +elseif ($conf->browser->name == 'iceweasel') $usecss3=false; +elseif ($conf->browser->name == 'epiphany') $usecss3=false; ?> /* ============================================================================== */ @@ -356,13 +360,17 @@ div.tmenu { font-weight: normal; height: px; -/* DYN */ -background-image: linear-gradient(bottom, rgb() 75%, rgb() 100%); -background-image: -o-linear-gradient(bottom, rgb() 75%, rgb() 100%); -background-image: -moz-linear-gradient(bottom, rgb() 75%, rgb() 100%); -background-image: -webkit-linear-gradient(bottom, rgb() 40%, rgb() 60%, rgb() 100%); -background-image: -ms-linear-gradient(bottom, rgb() 75%, rgb() 100%); - + + background-image: -o-linear-gradient(bottom, rgb() 75%, rgb() 100%); + background-image: -moz-linear-gradient(bottom, rgb() 75%, rgb() 100%); + background-image: -webkit-linear-gradient(bottom, rgb() 40%, rgb() 60%, rgb() 100%); + background-image: -ms-linear-gradient(bottom, rgb() 75%, rgb() 100%); + background-image: linear-gradient(bottom, rgb() 75%, rgb() 100%); + + background-image: url(); + background-position:top; + background-repeat:repeat-x; + color: #000000; text-decoration: none; @@ -704,13 +712,17 @@ div.blockvmenupair, div.blockvmenuimpair padding-bottom: 3px; margin: 1px 0px 8px 2px; -/* DYN */ -background-image: linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); - + + background-image: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: linear-gradient(bottom, rgb() 85%, rgb() 100%); + + background-image: url(); + background-position:top; + background-repeat:repeat-x; + border-left: 1px solid #CCCCCC; border-right: 1px solid #BBBBBB; border-bottom: 1px solid #BBBBBB; @@ -736,12 +748,13 @@ div.blockvmenusearch margin: 6px 0px 8px 2px; background: #E3E6E8; -/* DYN */ -background-image: linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + + background-image: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: linear-gradient(bottom, rgb() 85%, rgb() 100%); + border-left: 1px solid #CCCCCC; border-right: 1px solid #BBBBBB; @@ -769,12 +782,13 @@ div.blockvmenubookmarks margin: 6px 0px 8px 2px; background: #E3E6E8; -/* DYN */ -background-image: linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background-image: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + + background-image: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background-image: linear-gradient(bottom, rgb() 85%, rgb() 100%); + border-left: 1px solid #CCCCCC; border-right: 1px solid #BBBBBB; @@ -851,12 +865,16 @@ td.photo { /* ============================================================================== */ .toolbar { - background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%) !important; + background-image: -o-linear-gradient(bottom, rgb() 15%, rgb() 100%) !important; background-image: -moz-linear-gradient(bottom, rgb() 15%, rgb() 100%) !important; background-image: -webkit-linear-gradient(bottom, rgb() 15%, rgb() 100%) !important; background-image: -ms-linear-gradient(bottom, rgb() 15%, rgb() 100%) !important; - + background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%) !important; + + background-image: url(theme.'/img/tmenu2.jpg' ?>) !important; + background-repeat: repeat-x !important; + border: 1px solid #CCC !important; -moz-border-radius: 5px 5px 5px 5px !important; @@ -1100,13 +1118,15 @@ div.tabBar { border-left: 1px solid #D0D0D0; border-top: 1px solid #D8D8D8; - /* DYN */ - background-image: linear-gradient(bottom, rgb() 25%, rgb() 100%); + background-image: -o-linear-gradient(bottom, rgb() 25%, rgb() 100%); background-image: -moz-linear-gradient(bottom, rgb() 25%, rgb() 100%); background-image: -webkit-linear-gradient(bottom, rgb() 25%, rgb() 100%); background-image: -ms-linear-gradient(bottom, rgb() 25%, rgb() 100%); - + background-image: linear-gradient(bottom, rgb() 25%, rgb() 100%); + + background: #dee7ec url() repeat-x; + -moz-box-shadow: 4px 4px 4px #CCC; -webkit-box-shadow: 4px 4px 4px #CCC; box-shadow: 4px 4px 4px #CCC; @@ -1144,17 +1164,24 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active { border-: 1px solid #D8D8D8; border-top: 1px solid #D8D8D8; - /* DYN */ - background-image: linear-gradient(bottom, rgb() 35%, rgb() 100%); + background-image: -o-linear-gradient(bottom, rgb() 35%, rgb() 100%); background-image: -moz-linear-gradient(bottom, rgb() 35%, rgb() 100%); background-image: -webkit-linear-gradient(bottom, rgb() 35%, rgb() 100%); background-image: -ms-linear-gradient(bottom, rgb() 35%, rgb() 100%); + background-image: linear-gradient(bottom, rgb() 35%, rgb() 100%); + + background: #dee7ec; + } a.tab#active { + border-bottom: 1px solid rgb() !important; background-color: rgb() !important; + + background: #ffffff; + background-image: none !important; } a.tab:link, a.tab:visited, a.tab:hover, a.tab#active @@ -1412,13 +1439,16 @@ div.liste_titre, tr.liste_titre, tr.liste_titre_sel height: 20px !important; background-repeat: repeat-x; - /* DYN */ - background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%); + background-image: -o-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -moz-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -webkit-linear-gradient(bottom, rgb() 15%, rgb() 100%); background-image: -ms-linear-gradient(bottom, rgb() 15%, rgb() 100%); - + background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%); + + background: #7699A9; + background-image: url(); + color: #; font-family: ; font-weight: normal; @@ -1461,13 +1491,15 @@ tr.liste_total td { } .impair { - /* DYN */ + background: linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); - + + background: #eaeaea; + font-family: ; border: 0px; margin-bottom: 1px; @@ -1481,13 +1513,15 @@ tr.liste_total td { */ .pair { - /* DYN */ + background: linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); - + + background: #ffffff; + font-family: ; border: 0px; margin-bottom: 1px; @@ -1519,68 +1553,68 @@ div.tabBar .noborder { */ .boxtable { --moz-box-shadow: 4px 4px 4px #CCC; --webkit-box-shadow: 4px 4px 4px #CCC; -box-shadow: 4px 4px 4px #CCC; -margin-bottom: 8px !important; + -moz-box-shadow: 4px 4px 4px #CCC; + -webkit-box-shadow: 4px 4px 4px #CCC; + box-shadow: 4px 4px 4px #CCC; + margin-bottom: 8px !important; } .box { -padding-right: 0px; -padding-left: 0px; -padding-bottom: 4px; + padding-right: 0px; + padding-left: 0px; + padding-bottom: 4px; } tr.box_titre { -height: 20px; -background: #7699A9; + height: 20px; + background: #7699A9; -/* DYN */ -background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%); -background-image: -o-linear-gradient(bottom, rgb() 15%, rgb() 100%); -background-image: -moz-linear-gradient(bottom, rgb() 15%, rgb() 100%); -background-image: -webkit-linear-gradient(bottom, rgb() 15%, rgb() 100%); -background-image: -ms-linear-gradient(bottom, rgb() 15%, rgb() 100%); - -background-repeat: repeat-x; -color: #; -font-family: , sans-serif; -font-weight: normal; -border-bottom: 1px solid #FDFFFF; -white-space: nowrap; + + background-image: -o-linear-gradient(bottom, rgb() 15%, rgb() 100%); + background-image: -moz-linear-gradient(bottom, rgb() 15%, rgb() 100%); + background-image: -webkit-linear-gradient(bottom, rgb() 15%, rgb() 100%); + background-image: -ms-linear-gradient(bottom, rgb() 15%, rgb() 100%); + background-image: linear-gradient(bottom, rgb() 15%, rgb() 100%); + + background-image: url(); + + background-repeat: repeat-x; + color: #; + font-family: , sans-serif; + font-weight: normal; + border-bottom: 1px solid #FDFFFF; + white-space: nowrap; } tr.box_impair { -/* background: #e6ebed; */ -/* background: #f6f6f6; */ - -/* DYN */ -background: linear-gradient(bottom, rgb() 85%, rgb() 100%); -background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); - -font-family: ; + + background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: linear-gradient(bottom, rgb() 85%, rgb() 100%); + + background: #eaeaea; + + font-family: ; } tr.box_pair { -/* background: #d0d4d7; */ -/* background: #ffffff; */ - -/* DYN */ -background: linear-gradient(bottom, rgb() 85%, rgb() 100%); -background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); -background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); - -font-family: ; + + background: -o-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: -moz-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: -webkit-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: -ms-linear-gradient(bottom, rgb() 85%, rgb() 100%); + background: linear-gradient(bottom, rgb() 85%, rgb() 100%); + + background: #ffffff; + + font-family: ; } tr.fiche { -font-family: ; + font-family: ; } From 4ddb9023d765718da935b1c0f7f4305600635f39 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Apr 2012 01:04:26 +0200 Subject: [PATCH 2/3] Fix: restore broken features --- htdocs/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/document.php b/htdocs/document.php index d4a91010466..5758a13a0b4 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -54,7 +54,7 @@ $action=GETPOST('action','alpha'); $original_file=GETPOST('file','alpha'); // Do not use urldecode here ($_GET are already decoded by PHP). $modulepart=GETPOST('modulepart','alpha'); $urlsource=GETPOST('urlsource','alpha'); -$entity=GETPOST('entity','int'); +$entity=GETPOST('entity')?GETPOST('entity','int'):$conf->entity; // Security check if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); From 672dc991451b40f47af6b598c2f4807221d4cd4b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Apr 2012 12:15:14 +0200 Subject: [PATCH 3/3] Fix: project info are not lost when submiting actions on tasks --- htdocs/projet/tasks/contact.php | 13 +++--- htdocs/projet/tasks/document.php | 68 ++++++++++++++++---------------- htdocs/projet/tasks/time.php | 11 ++++-- 3 files changed, 50 insertions(+), 42 deletions(-) diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 4c19d85888b..f4b4d03fd23 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -66,7 +66,7 @@ if ($action == 'addcontact' && $user->rights->projet->creer) if ($result >= 0) { - Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); + Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject?'&withproject=1':'')); exit; } else @@ -104,7 +104,7 @@ if ($action == 'deleteline' && $user->rights->projet->creer) if ($result >= 0) { - Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); + Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id.($withproject?'&withproject=1':'')); exit; } else @@ -125,7 +125,8 @@ if (! empty($project_ref) && ! empty($withproject)) } else { - Header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode)?'':'&mode='.$mode)); + Header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject?'&withproject=1':'').(empty($mode)?'':'&mode='.$mode)); + exit; } } } @@ -282,6 +283,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; + print ''; // Ligne ajout pour contact interne print ""; @@ -418,7 +420,7 @@ if ($id > 0 || ! empty($ref)) // Statut print ''; // Activation desativation du contact - if ($object->statut >= 0) print ''; + if ($object->statut >= 0) print ''; print $contactstatic->LibStatut($tab[$i]['status'],3); if ($object->statut >= 0) print ''; print ''; @@ -428,7 +430,7 @@ if ($id > 0 || ! empty($ref)) if ($user->rights->projet->creer) { print ' '; - print ''; + print ''; print img_delete(); print ''; } @@ -449,5 +451,6 @@ if ($id > 0 || ! empty($ref)) llxFooter(); + $db->close(); ?> diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 37856acec08..f70fd9f135c 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -67,9 +67,9 @@ if ($id > 0 || ! empty($ref)) if ($object->fetch($id,$ref) > 0) { $projectstatic->fetch($object->fk_project); - + if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); - + $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); } else @@ -135,7 +135,8 @@ if (! empty($project_ref) && ! empty($withproject)) } else { - Header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode)?'':'&mode='.$mode)); + Header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject?'&withproject=1':'').(empty($mode)?'':'&mode='.$mode)); + exit; } } } @@ -152,20 +153,20 @@ llxHeader('',$langs->trans('Project')); if ($object->id > 0) { if (! empty($projectstatic->socid)) $projectstatic->societe->fetch($projectstatic->socid); - + $userWrite = $projectstatic->restrictedProjectArea($user,'write'); - + if (! empty($withproject)) { // Tabs for project $tab='tasks'; $head=project_prepare_head($projectstatic); dol_fiche_head($head, $tab, $langs->trans("Project"),0,($projectstatic->public?'projectpub':'project')); - + $param=($mode=='mine'?'&mode=mine':''); - + print ''; - + // Ref print ''; - + print ''; - + print ''; print ''; - + // Visibility print ''; - + // Statut print ''; - + print '
'; print $langs->trans("Ref"); @@ -178,37 +179,37 @@ if ($object->id > 0) } print $form->showrefnav($projectstatic,'project_ref','',1,'ref','ref','',$param.'&withproject=1'); print '
'.$langs->trans("Label").''.$projectstatic->title.'
'.$langs->trans("Company").''; if (! empty($projectstatic->societe->id)) print $projectstatic->societe->getNomUrl(1); else print ' '; print '
'.$langs->trans("Visibility").''; if ($projectstatic->public) print $langs->trans('SharedProject'); else print $langs->trans('PrivateProject'); print '
'.$langs->trans("Status").''.$projectstatic->getLibStatut(4).'
'; - + dol_fiche_end(); - + print '
'; } - + $head = task_prepare_head($object); dol_fiche_head($head, 'task_document', $langs->trans("Task"), 0, 'projecttask'); - + $param=(GETPOST('withproject')?'&withproject=1':''); $linkback=GETPOST('withproject')?''.$langs->trans("BackToList").'':''; - + // Files list constructor $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; @@ -216,9 +217,9 @@ if ($object->id > 0) { $totalsize+=$file['size']; } - + print ''; - + // Ref print ''; print ''; - + // Label print ''; - + // Project if (empty($withproject)) { print ''; - + // Third party print ''; } - + // Files infos print ''; print ''; - + print "
'; print $langs->trans("Ref"); @@ -232,42 +233,42 @@ if ($object->id > 0) print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param); print '
'.$langs->trans("Label").''.$object->label.'
'.$langs->trans("Project").''; print $projectstatic->getNomUrl(1); print '
'.$langs->trans("Company").''; if ($projectstatic->societe->id) print $projectstatic->societe->getNomUrl(1); else print ' '; print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
\n"; - + dol_fiche_end(); - + print '
'; - + dol_htmloutput_mesg($mesg); - - + + // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id,'',0,0,$user->rights->projet->creer); - - + $formfile->form_attach_new_file(DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.($withproject?'&withproject=1':''),'',0,0,$user->rights->projet->creer); + + // List of document $param='&id='.$object->id; $formfile->list_of_documents($filearray,$object,'projet',$param,0,dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref).'/'); @@ -280,5 +281,6 @@ else llxFooter(); + $db->close(); ?> diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index d6d592d21f8..2e0d8b66984 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -51,6 +51,7 @@ $projectstatic = new Project($db); /* * Actions */ + if ($action == 'addtimespent' && $user->rights->projet->creer) { $error=0; @@ -155,7 +156,8 @@ if (! empty($project_ref) && ! empty($withproject)) } else { - Header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode)?'':'&mode='.$mode)); + Header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.($withproject?'&withproject=1':'').(empty($mode)?'':'&mode='.$mode)); + exit; } } } @@ -236,7 +238,7 @@ if ($id > 0 || ! empty($ref)) if ($action == 'deleteline') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id.'&lineid='.$_GET["lineid"],$langs->trans("DeleteATimeSpent"),$langs->trans("ConfirmDeleteATimeSpent"),"confirm_delete",'','',1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id.'&lineid='.$_GET["lineid"].($withproject?'&withproject=1':''),$langs->trans("DeleteATimeSpent"),$langs->trans("ConfirmDeleteATimeSpent"),"confirm_delete",'','',1); if ($ret == 'html') print '
'; } @@ -291,6 +293,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; + print ''; print ''; @@ -451,12 +454,12 @@ if ($id > 0 || ! empty($ref)) else if ($user->rights->projet->creer) { print ' '; - print 'rowid.'">'; + print 'rowid.($withproject?'&withproject=1':'').'">'; print img_edit(); print ''; print ' '; - print 'rowid.'">'; + print 'rowid.($withproject?'&withproject=1':'').'">'; print img_delete(); print ''; }