diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 8c5fe0c7dbf..9c075a36cd7 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -871,7 +871,7 @@ else $var=!$var; print ''.$langs->trans("FiscalMonthStart").''; $monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1; - print monthArrayOrSelected($monthstart) . ''; + print dol_print_date(dol_mktime(12,0,0,$monthstart,1,2000,1),'%B','gm') . ''; print ""; diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 65d6f098aa3..16682a7b7a2 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -542,16 +542,18 @@ class FormOther */ function select_month($selected='',$htmlname='monthid',$useempty=0) { + global $langs; + require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); - $month = monthArrayOrSelected(-1); // Get array + $montharray = monthArray($langs); // Get array $select_month = ''; print ''; - if ($_GET['id']) print ''; - if ($_GET['mode']) print ''; + if (! empty($object->id)) print ''; + if (! empty($mode)) print ''; print ''; print ''; // List of projects print ''; print '
'.$langs->trans("Label").''; - print ''; + print ''; print '
'.$langs->trans("ChildOfTask").''; - print $formother->selectProjectTasks('',$projectid?$projectid:$_GET["id"], 'task_parent', 0, 0, 1, 1); + print $formother->selectProjectTasks('',$projectid?$projectid:$object->id, 'task_parent', 0, 0, 1, 1); print '
'.$langs->trans("AffectedTo").''; @@ -220,10 +222,10 @@ else $tab='tasks'; - $head=project_prepare_head($project); - dol_fiche_head($head, $tab, $langs->trans("Project"),0,($project->public?'projectpub':'project')); + $head=project_prepare_head($object); + dol_fiche_head($head, $tab, $langs->trans("Project"),0,($object->public?'projectpub':'project')); - $param=($_REQUEST["mode"]=='mine'?'&mode=mine':''); + $param=($mode=='mine'?'&mode=mine':''); print ''; @@ -232,27 +234,27 @@ else print $langs->trans("Ref"); print ''; - print ''; + print ''; print ''; print ''; // Visibility print ''; // Statut - print ''; + print ''; print '
'; // Define a complementary filter for search of next/prev ref. - $projectsListId = $project->getProjectsAuthorizedForUser($user,$mine,1); - $project->next_prev_filter=" rowid in (".$projectsListId.")"; - print $form->showrefnav($project,'ref','',1,'ref','ref','',$param); + $projectsListId = $object->getProjectsAuthorizedForUser($user,$mine,1); + $object->next_prev_filter=" rowid in (".$projectsListId.")"; + print $form->showrefnav($object,'ref','',1,'ref','ref','',$param); print '
'.$langs->trans("Label").''.$project->title.'
'.$langs->trans("Label").''.$object->title.'
'.$langs->trans("Company").''; - if (! empty($project->societe->id)) print $project->societe->getNomUrl(1); + if (! empty($object->societe->id)) print $object->societe->getNomUrl(1); else print ' '; print '
'.$langs->trans("Visibility").''; - if ($project->public) print $langs->trans('SharedProject'); + if ($object->public) print $langs->trans('SharedProject'); else print $langs->trans('PrivateProject'); print '
'.$langs->trans("Status").''.$project->getLibStatut(4).'
'.$langs->trans("Status").''.$object->getLibStatut(4).'
'; @@ -265,9 +267,9 @@ else if ($user->rights->projet->all->creer || $user->rights->projet->creer) { - if ($project->public || $userAccess) + if ($object->public || $userAccess) { - print ''.$langs->trans('AddTask').''; + print ''.$langs->trans('AddTask').''; } else { @@ -286,9 +288,9 @@ else // Link to switch in "my task" / "all task" print '
'; - if ($_REQUEST["mode"] == 'mine') + if ($mode == 'mine') { - print ''.$langs->trans("DoNotShowMyTasksOnly").''; + print ''.$langs->trans("DoNotShowMyTasksOnly").''; //print ' - '; //print $langs->trans("ShowMyTaskOnly"); } @@ -296,22 +298,22 @@ else { //print $langs->trans("DoNotShowMyTaskOnly"); //print ' - '; - print ''.$langs->trans("ShowMyTasksOnly").''; + print ''.$langs->trans("ShowMyTasksOnly").''; } print '
'; // Get list of tasks in tasksarray and taskarrayfiltered // We need all tasks (even not limited to a user because a task to user // can have a parent that is not affected to him). - $tasksarray=$task->getTasksArray(0, 0, $project->id, $socid, 0); + $tasksarray=$taskstatic->getTasksArray(0, 0, $object->id, $socid, 0); // We load also tasks limited to a particular user - $tasksrole=($_REQUEST["mode"]=='mine' ? $task->getUserRolesForProjectsOrTasks(0,$user,$project->id,0) : ''); + $tasksrole=($mode=='mine' ? $taskstatic->getUserRolesForProjectsOrTasks(0,$user,$object->id,0) : ''); //var_dump($tasksarray); //var_dump($tasksrole); print ''; print ''; - if ($projectstatic->id) print ''; + if (! empty($object->id)) print ''; print ''; print ''; print ''; @@ -325,14 +327,14 @@ else } else { - print ''; + print ''; } print "
'.$langs->trans("Project").''.$langs->trans("Project").''.$langs->trans("RefTask").''.$langs->trans("LabelTask").''.$langs->trans("Progress").'
'.$langs->trans("NoTasks").'
'.$langs->trans("NoTasks").'
"; // Test if database is clean. If not we clean it. //print 'mode='.$_REQUEST["mode"].' $nboftaskshown='.$nboftaskshown.' count($tasksarray)='.count($tasksarray).' count($tasksrole)='.count($tasksrole).'
'; - if ($_REQUEST["mode"]=='mine') + if ($mode=='mine') { if ($nboftaskshown < count($tasksrole)) clean_orphelins($db); } @@ -342,7 +344,8 @@ else } } +llxFooter(); + $db->close(); -llxFooter(); ?> diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index e2b23ef9cde..bd2a80350a8 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2010-2012 Laurent Destailleur + * Copyright (C) 2012 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 @@ -42,7 +43,7 @@ require_once dirname(__FILE__).'/../../htdocs/core/modules/propale/doc/pdf_jaune require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/pdf_edison.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/commande/pdf_einstein.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/project/pdf/pdf_baleine.modules.php'; -require_once dirname(__FILE__).'/../../htdocs/core/modules/fichinter/pdf_soleil.modules.php'; +require_once dirname(__FILE__).'/../../htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php'; require_once dirname(__FILE__).'/../../htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php'; // Mother classes of pdf generators