From 27ff111e51ab11859c765a60dc98f71d103d482d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 26 Apr 2012 15:47:21 +0200 Subject: [PATCH 01/10] =?UTF-8?q?Typo:=20instantan=C3=A9e=20ne=20prend=20q?= =?UTF-8?q?u'un=20n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/langs/fr_FR/main.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 81484ba7c2ea1..7102d977e9272 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -603,7 +603,7 @@ Before=Avant After=Après IPAddress=Adresse IP Frequency=Fréquence -IM=Messagerie instantannée +IM=Messagerie instantanée NewAttribute=Nouvel attribut AttributeCode=Code de l'attribut OptionalFieldsSetup=Configuration des attributs complémentaires From 75cefe53cf43e09079d46a785d84f614cba2a1bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 May 2012 18:30:35 +0200 Subject: [PATCH 02/10] Fix: Set payment term --- htdocs/compta/facture.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b2f625d972ecb..bcf9d6581f99b 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -94,6 +94,7 @@ $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + // Action clone object if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->facture->creer) { @@ -248,7 +249,6 @@ $result = $object->setPaymentMethods(GETPOST('mode_reglement_id','int')); if ($result < 0) dol_print_error($db,$object->error); } - else if ($action == 'setinvoicedate' && $user->rights->facture->creer) { $object->fetch($id); @@ -257,7 +257,14 @@ $result=$object->update($user); if ($result < 0) dol_print_error($db,$object->error); } - +else if ($action == 'setpaymentterm' && $user->rights->facture->creer) +{ + $object->fetch($id); + $object->date_lim_reglement=dol_mktime(12,0,0,$_POST['paymenttermmonth'],$_POST['paymenttermday'],$_POST['paymenttermyear']); + if ($object->date_lim_reglement < $object->date) $object->date_lim_reglement=$object->date; + $result=$object->update($user); + if ($result < 0) dol_print_error($db,$object->error); +} else if ($action == 'setconditions' && $user->rights->facture->creer) { $object->fetch($id); From af7dc508cdaa12ba2f60222089659343a3885970 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 7 May 2012 09:58:44 +0200 Subject: [PATCH 03/10] Fix: [Bug #384] Gantt doesn't display beyond 20 tasks --- htdocs/projet/ganttview.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index bd759d27bbeb2..10daa2be3d461 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2005-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 @@ -31,7 +31,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php"); $id=GETPOST('id','int'); -$ref=GETPOST('ref'); +$ref=GETPOST('ref','alpha'); $mine = $_REQUEST['mode']=='mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects @@ -185,7 +185,7 @@ $tasks[$taskcursor]['task_milestone']=0; $tasks[$taskcursor]['task_percent_complete']=$val->progress; //$tasks[$taskcursor]['task_name']=$task->getNomUrl(1); - $tasks[$taskcursor]['task_name']=$val->label; + $tasks[$taskcursor]['task_name']=dol_escape_js($val->label); $tasks[$taskcursor]['task_start_date']=$val->date_start; $tasks[$taskcursor]['task_end_date']=$val->date_end; $tasks[$taskcursor]['task_color']='b4d1ea'; From 412cbf2dfd6b073d1d840467c3b40e613f405dd5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 7 May 2012 11:15:14 +0200 Subject: [PATCH 04/10] Fix: wrong permission --- htdocs/user/perms.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 3cb1abffccbb8..0ee185c043201 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -46,7 +46,7 @@ { $canreaduser=($user->admin || ($user->rights->user->user->lire && $user->rights->user->user_advance->readperms)); $caneditselfperms=($user->id == $id && $user->rights->user->self_advance->writeperms); - $caneditperms = (($caneditperms || $caneditselfperms) ? 0 : 1); + $caneditperms = (($caneditperms || $caneditselfperms) ? 1 : 0); } // Security check From 792c0a33f3b14ae9d7a802b8d4bc392facb89ee1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 May 2012 17:04:35 +0200 Subject: [PATCH 05/10] Fix: Works with checkbox htdocs/core/class/html.form.class.php --- htdocs/core/class/html.form.class.php | 5 +- htdocs/langs/en_US/projects.lang | 6 +- htdocs/langs/fr_FR/projects.lang | 6 +- htdocs/projet/class/project.class.php | 85 ++++++++------------------- htdocs/projet/class/task.class.php | 31 ++-------- htdocs/projet/fiche.php | 51 +++++++--------- 6 files changed, 63 insertions(+), 121 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 971ab45376b91..cbf6a1b7bf6ff 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2254,7 +2254,10 @@ function formconfirm($page, $title, $question, $action, $formquestion='', $selec if ($inputarray.length>0) { $.each($inputarray, function() { var inputname = this; - var inputvalue = $("#" + this).val(); + var more = \'\'; + if ($("#" + this).attr("type") == \'checkbox\') { more = \':checked\'; } + var inputvalue = $("#" + this + more).val(); + if (typeof inputvalue == \'undefined\') { inputvalue=\'\'; } options += \'&\' + inputname + \'=\' + inputvalue; }); //alert(options); diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 75082f8012c46..18844f9186812 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -85,7 +85,11 @@ TaskIsNotAffectedToYou=Task not allocated to you ErrorTimeSpentIsEmpty=Time spent is empty ThisWillAlsoRemoveTasks=This action will also delete all tasks of project (%s tasks at the moment) and all inputs of time spent. IfNeedToUseOhterObjectKeepEmpty=If some objects (invoice, order, ...), belonging to another third party, must be linked to the project to create, keep this empty to have the project being multi third parties. -CloneProject=Clone project (associated task will be duplicated too) +CloneProject=Clone project +CloneTasks=Clone tasks +CloneContacts=Clone contacts +CloneNotes=Clone notes +CloneFiles=Clone joined files ConfirmCloneProject=Are you sure to clone this project ? ProjectReportDate=Change task date according project start date ErrorShiftTaskDate=Impossible to shift task date according to new project start date diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index 0c3a21e4cdbad..01c6b337e98c0 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -85,7 +85,11 @@ TaskIsNotAffectedToYou=Tâche qui ne vous est pas affectée ErrorTimeSpentIsEmpty=Le temps consommé n'est pas renseigné ThisWillAlsoRemoveTasks=Cette opération détruira également les tâches du projet (%s tâches actuellement) et le suivi des consommés. IfNeedToUseOhterObjectKeepEmpty=Si des objets (facture, commande, ...), appartenant à un autre tiers que celui choisi, doivent être liés au projet à créer, laisser vide afin de laisser le projet multi-tiers. -CloneProject=Cloner le projet (les taches associées sont dupliquées également) +CloneProject=Cloner le projet +CloneTasks=Cloner les taches +CloneContacts=Cloner les contacts +CloneNotes=Cloner les notes +CloneFiles=Cloner les pièces jointes ConfirmCloneProject=Êtes-vous sûr de vouloir cloner ce projet ? ProjectReportDate=Reporter les dates des taches en fonction de la date de départ. ErrorShiftTaskDate=Une erreur c'est produite dans le report des dates des taches. diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 823ba1057f88d..db565f2097d79 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -883,21 +883,24 @@ function getProjectsAuthorizedForUser($user, $mode=0, $list=0, $socid=0) return $projects; } - /** Load an object from its id and create a new one in database - * - * @param int $fromid Id of object to clone - * @param bool $clone_contact clone contact of project - * @param bool $clone_task clone task of project - * @param bool $clone_file clone file of project - * @param bool $clone_note clone note of project - * @return int New id of clone - */ - function createFromClone($fromid,$clone_contact=false,$clone_task=true,$clone_file=true,$clone_note=true) + /** + * Load an object from its id and create a new one in database + * + * @param int $fromid Id of object to clone + * @param bool $clone_contact clone contact of project + * @param bool $clone_task clone task of project + * @param bool $clone_file clone file of project + * @param bool $clone_note clone note of project + * @return int New id of clone + */ + function createFromClone($fromid,$clone_contact=false,$clone_task=true,$clone_file=false,$clone_note=true) { global $user,$langs,$conf; $error=0; + dol_syslog("createFromClone clone_contact=".$clone_contact." clone_task=".$clone_task." clone_file=".$clone_file." clone_note=".$clone_note); + $now = dol_mktime(0,0,0,idate('m',dol_now()),idate('d',dol_now()),idate('Y',dol_now())); $clone_project=new Project($this->db); @@ -908,30 +911,18 @@ function createFromClone($fromid,$clone_contact=false,$clone_task=true,$clone_fi $clone_project->fetch($fromid); $orign_dt_start=$clone_project->date_start; - - $orign_project_ref=$clone_project->ref; $clone_project->id=0; $clone_project->date_start = $now; if (!(empty($clone_project->date_end))) { - //Calculate new project end date ragarding difference between original project start date and new start date (now) - $datetime_start = new DateTime(); - $datetime_start->setTimestamp($orign_dt_start); - $datetime_now = new DateTime(); - $datetime_now->setTimestamp($now); - $diff_dt = $datetime_start->diff($datetime_now); - - $datetime_end = new DateTime(); - $datetime_end->setTimestamp($clone_project->date_end); - $datetime_end->add($diff_dt); - $clone_project->date_end = $datetime_end->getTimestamp(); + $clone_project->date_end = $clone_project->date_end + ($now - $orign_dt_start); } $clone_project->datec = $now; - if (!$clone_note) + if (! $clone_note) { $clone_project->note_private=''; $clone_project->note_public=''; @@ -1139,11 +1130,12 @@ function createFromClone($fromid,$clone_contact=false,$clone_task=true,$clone_fi } - /** Shift project task date from current date to delta - * - * @param timestamp $old_project_dt_start old project start date - * @return int 1 if OK or < 0 if KO - */ + /** + * Shift project task date from current date to delta + * + * @param timestamp $old_project_dt_start old project start date + * @return int 1 if OK or < 0 if KO + */ function shiftTaskDate($old_project_dt_start) { global $user,$langs,$conf; @@ -1156,11 +1148,6 @@ function shiftTaskDate($old_project_dt_start) $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; - //convert timestamp to datetime - $old_project_dt_st = new DateTime(); - $old_project_dt_st->setTimestamp($old_project_dt_start); - $old_project_dt_st->setTime(0,0,0); //Use 00:00:00 as time to be sure to not have side - $tasksarray=$taskstatic->getTasksArray(0, 0, $this->id, $socid, 0); foreach ($tasksarray as $tasktoshiftdate) @@ -1183,39 +1170,13 @@ function shiftTaskDate($old_project_dt_start) //Calcultate new task start date with difference between old proj start date and origin task start date if (!empty($tasktoshiftdate->date_start)) { - dol_syslog(get_class($this)."::shiftTaskDate to_update", LOG_DEBUG); - $orign_task_datetime_start = new DateTime(); - $orign_task_datetime_start->setTimestamp($tasktoshiftdate->date_start); - $orign_task_datetime_start->setTime(0,0,0); //Use 00:00:00 as time to be sure to not have side effect - $diff_dt_st = $old_project_dt_st->diff($orign_task_datetime_start); - - //Project new start date - $datetime_start = new DateTime(); - $datetime_start->setTimestamp($this->date_start); - $datetime_start->setTime(0,0,0); //Use 00:00:00 as time to be sure to not have side - - //New task start date - $datetime_start->add($diff_dt_st); - $task->date_start = $datetime_start->getTimestamp(); + $task->date_start = $this->date_start + ($tasktoshiftdate->date_start - $old_project_dt_st); } //Calcultate new task end date with difference between origin proj end date and origin task end date if (!empty($tasktoshiftdate->date_end)) { - $orign_task_datetime_end = new DateTime(); - $orign_task_datetime_end->setTimestamp($tasktoshiftdate->date_end); - $orign_task_datetime_end->setTime(0,0,0); //Use 00:00:00 as hour to be sure to not have side effect - - $diff_dt_end = $old_project_dt_st->diff($orign_task_datetime_end); - - //Project new start date - $datetime_end = new DateTime(); - $datetime_end->setTimestamp($this->date_start); - $datetime_end->setTime(0,0,0); //Use 00:00:00 as time to be sure to not have side - - //New task start date - $datetime_end->add($diff_dt_end); - $task->date_end = $datetime_end->getTimestamp(); + $task->date_end = $this->date_start + ($tasktoshiftdate->date_end - $old_project_dt_st); } if ($to_update) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index d1fdc88aedf01..ab6a5a6840c93 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -957,7 +957,7 @@ function createFromClone($fromid,$project_id,$parent_task_id,$clone_change_dt=fa $now=dol_now(); - $datec = dol_mktime(0,0,0,idate('m',$now),idate('d',$now),idate('Y',$now)); + $datec = $now; $clone_task=new Task($this->db); @@ -980,41 +980,18 @@ function createFromClone($fromid,$project_id,$parent_task_id,$clone_change_dt=fa $projectstatic->fetch($ori_project_id); //Origin project strat date - $orign_project_dt_start = new DateTime(); - $orign_project_dt_start->setTimestamp($projectstatic->date_start); + $orign_project_dt_start = $projectstatic->date_start; //Calcultate new task start date with difference between origin proj start date and origin task start date if (!empty($clone_task->date_start)) { - $orign_task_datetime_start = new DateTime(); - $orign_task_datetime_start->setTimestamp($clone_task->date_start); - $orign_task_datetime_start->setTime(0,0,0); //Use 00:00:00 as hour to be sure to not have side effect - $diff_dt_st = $orign_project_dt_start->diff($orign_task_datetime_start); - - //cloned project start date - $datetime_start = new DateTime(); - $datetime_start->setTimestamp($now); - - //New task start date - $datetime_start->add($diff_dt_st); - $clone_task->date_start = $datetime_start->getTimestamp(); + $clone_task->date_start = $now + $clone_task->date_start - $orign_project_dt_start; } //Calcultate new task end date with difference between origin proj end date and origin task end date if (!empty($clone_task->date_end)) { - $orign_task_datetime_end = new DateTime(); - $orign_task_datetime_end->setTimestamp($clone_task->date_end); - $orign_task_datetime_end->setTime(0,0,0); //Use 00:00:00 as hour to be sure to not have side effect - $diff_dt_end = $orign_project_dt_start->diff($orign_task_datetime_end); - - //cloned project start date - $datetime_end = new DateTime(); - $datetime_end->setTimestamp($now); - - //New task start date - $datetime_end->add($diff_dt_end); - $clone_task->date_end = $datetime_end->getTimestamp(); + $clone_task->date_end = $now + $clone_task->date_end - $orign_project_dt_start; } } diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index 1c6b0626ad100..d4293bea9ef69 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -80,7 +80,7 @@ //if cancel and come from clone then delete the cloned project if (GETPOST("cancel") && (GETPOST("comefromclone")==1)) -{ +{ $project = new Project($db); $project->fetch($id); $result=$project->delete($user); @@ -200,7 +200,7 @@ $result=$project->update($user); $id=$project->id; // On retourne sur la fiche projet - + if (GETPOST("reportdate") && ($project->date_start!=$old_start_date)) { $result=$project->shiftTaskDate($old_start_date); @@ -303,25 +303,11 @@ $idtoclone=$id; $project = new Project($db); $project->fetch($idtoclone); - $result=$project->createFromClone($idtoclone,true,true,true,true); - if ($result <= 0) - { - $mesg='
'.$project->error.'
'; - } - else - { - $id=$result; - $action='edit'; - $comefromclone=true; - } -} - -if ($action == 'confirm_clone' && $user->rights->projet->creer && GETPOST('confirm') == 'yes') -{ - $idtoclone=$id; - $project = new Project($db); - $project->fetch($idtoclone); - $result=$project->createFromClone($idtoclone,true,true,true,true); + $clone_contacts=GETPOST('clone_contacts')?1:0; + $clone_tasks=GETPOST('clone_tasks')?1:0; + $clone_files=GETPOST('clone_files')?1:0; + $clone_notes=GETPOST('clone_notes')?1:0; + $result=$project->createFromClone($idtoclone,$clone_contacts,$clone_tasks,$clone_files,$clone_notes); if ($result <= 0) { $mesg='
'.$project->error.'
'; @@ -372,7 +358,7 @@ { require_once(DOL_DOCUMENT_ROOT ."/core/modules/project/".$conf->global->PROJECT_ADDON.".php"); $modProject = new $obj; - $defaultref = $modProject->getNextValue($soc,$project); + $defaultref = $modProject->getNextValue($soc,$project); } if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; @@ -482,10 +468,17 @@ // Clone confirmation if ($action == 'clone') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$project->id,$langs->trans("CloneProject"),$langs->trans("ConfirmCloneProject"),"confirm_clone",'','',1); - if ($ret == 'html') print '
'; + $formquestion=array( + 'text' => $langs->trans("ConfirmClone"), + array('type' => 'checkbox', 'name' => 'clone_contacts','label' => $langs->trans("CloneContacts"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_tasks', 'label' => $langs->trans("CloneTasks"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_notes', 'label' => $langs->trans("CloneNotes"), 'value' => true), + array('type' => 'checkbox', 'name' => 'clone_files', 'label' => $langs->trans("CloneFiles"), 'value' => false) + ); + + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$project->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 240); } - + if ($action == 'edit' && $userWrite > 0) { print '
'; @@ -522,7 +515,7 @@ print ''.$langs->trans("DateStart").''; print $form->select_date($project->date_start,'project'); print ''. $langs->trans("ProjectReportDate"); print ''; @@ -542,7 +535,7 @@ print '

'; print '   '; print '
'; - + print '
'; } else @@ -580,7 +573,7 @@ // Date start print ''.$langs->trans("DateStart").''; - print dol_print_date($project->date_start,'day'); + print dol_print_date($project->date_start,'day'); print ''; // Date end @@ -656,7 +649,7 @@ print ''.$langs->trans('ReOpen').''; } } - + // Clone if ($user->rights->projet->creer) { From bfb102db18c3309de5ef24bb22d6224210567432 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 7 May 2012 17:05:15 +0200 Subject: [PATCH 06/10] Fix: add MAIN_HIDE_LEFT_MENU --- htdocs/main.inc.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1d76e6782c180..e1705991b302b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -777,13 +777,15 @@ function analyse_sql_and_script(&$var, $type) * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) * @return void */ - function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='') - { - top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss, $morequerystring); - left_menu('', $help_url, '', '', 1, $title); - main_area($title); - } + function llxHeader($head = '', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='') + { + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + top_menu($head, $title, $target, $disablejs, $disablehead, $arrayofjs, $arrayofcss, $morequerystring); + if (empty($conf->global->MAIN_HIDE_LEFT_MENU)) { + left_menu('', $help_url, '', '', 1, $title); + } + main_area($title); + } } @@ -1172,11 +1174,10 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a /* * Top menu - */ + */ $top_menu=empty($conf->browser->phone)?$conf->top_menu:$conf->smart_menu; if (GETPOST('menu')) $top_menu=GETPOST('menu'); // menu=eldy_backoffice.php - // Load the top menu manager // Load the top menu manager (only if not already done) if (! class_exists('MenuTop')) { From 8c6570718d0a6468a48b5805bb7bad00ac5983ca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 May 2012 17:11:40 +0200 Subject: [PATCH 07/10] Fix: Better fix for gant view --- htdocs/projet/ganttchart.php | 2 +- htdocs/projet/ganttview.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/ganttchart.php b/htdocs/projet/ganttchart.php index 258ba415ebcc3..dff07828e36ab 100644 --- a/htdocs/projet/ganttchart.php +++ b/htdocs/projet/ganttchart.php @@ -167,7 +167,7 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_ // Add line to gantt $s = "// Add taks id=".$task["task_id"]." level = ".$level."\n"; //$s.= "g.AddElementItem(new JSGantt.ElementItem('task',".$task['task_id'].",'".$name."','".$start_date."', '".$end_date."', '".$task['task_color']."', '', ".$task['task_milestone'].", '".$resources."', ".$percent.", ".($task["task_is_group"]>0?1:0).", ".$parent.", 1".($depend?", ".$depend:"")."));"; - $s = "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".$name."','".$start_date."', '".$end_date."', '".$task['task_color']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".$percent.", ".($task["task_is_group"]>0?1:0).", '".$parent."', 1, '".($depend?$depend:"")."'));"; + $s = "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js($name)."','".$start_date."', '".$end_date."', '".$task['task_color']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".$percent.", ".($task["task_is_group"]>0?1:0).", '".$parent."', 1, '".($depend?$depend:"")."'));"; echo $s."\n"; } diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 10daa2be3d461..1747d8b9356c3 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -185,7 +185,7 @@ $tasks[$taskcursor]['task_milestone']=0; $tasks[$taskcursor]['task_percent_complete']=$val->progress; //$tasks[$taskcursor]['task_name']=$task->getNomUrl(1); - $tasks[$taskcursor]['task_name']=dol_escape_js($val->label); + $tasks[$taskcursor]['task_name']=$val->label; $tasks[$taskcursor]['task_start_date']=$val->date_start; $tasks[$taskcursor]['task_end_date']=$val->date_end; $tasks[$taskcursor]['task_color']='b4d1ea'; From 2f081f2bd565501174731b2fffcf545b9acc7fa9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 May 2012 17:19:46 +0200 Subject: [PATCH 08/10] Too shadow with IE --- htdocs/theme/eldy/style.css.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 10545bc8101ee..e9b14275eabed 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -230,9 +230,9 @@ -moz-border-radius:0px 5px 0px 5px; -webkit-border-radius:0px 5px 0px 5px; border-radius:0px 5px 0px 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 2px 2px 3px #CCC; + -webkit-box-shadow: 2px 2px 3px #CCC; + box-shadow: 2px 2px 3px #CCC; } .button:focus { font-family: ; @@ -1327,9 +1327,9 @@ -moz-border-radius:0px 5px 0px 5px; -webkit-border-radius:0px 5px 0px 5px; border-radius:0px 5px 0px 5px; - -moz-box-shadow: 4px 4px 4px #CCC; - -webkit-box-shadow: 4px 4px 4px #CCC; - box-shadow: 4px 4px 4px #CCC; + -moz-box-shadow: 2px 2px 3px #CCC; + -webkit-box-shadow: 2px 2px 3px #CCC; + box-shadow: 2px 2px 3px #CCC; } .butAction:hover { From 16b1655ad5ae0822d1dbf85b3b8f1f5041587e1b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 May 2012 18:00:53 +0200 Subject: [PATCH 09/10] Fix: Width of gantt chart --- htdocs/projet/ganttview.php | 3 ++- htdocs/theme/auguria/style.css.php | 2 +- htdocs/theme/bureau2crea/style.css.php | 2 +- htdocs/theme/cameleo/style.css.php | 2 +- htdocs/theme/eldy/style.css.php | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 1747d8b9356c3..02d2d678215fd 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -228,7 +228,8 @@ if (! empty($conf->use_javascript_ajax)) { - print '
'."\n"; + //var_dump($_SESSION); + print '
'."\n"; include_once(DOL_DOCUMENT_ROOT.'/projet/ganttchart.php'); print '
'."\n"; } diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index cf25d39166984..2d4f81cf60279 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -2095,7 +2095,7 @@ /* ============================================================================== */ div.scroll2 { - width: 582px !important; + width: px !important; } diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index acd4ce6afa94e..6207ee6161d3d 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -2355,7 +2355,7 @@ /* ============================================================================== */ div.scroll2 { - width: 582px !important; + width: px !important; } diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 8cc873eefc96a..919c2eeabb55e 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -2171,7 +2171,7 @@ /* ============================================================================== */ div.scroll2 { - width: 582px !important; + width: px !important; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index e9b14275eabed..42aa1b2108bec 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2382,7 +2382,7 @@ /* ============================================================================== */ div.scroll2 { - width: 582px !important; + width: px !important; } From 6fd60ff17406763a53adda2ceed75cda4b3c69dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Mon, 7 May 2012 18:26:05 +0200 Subject: [PATCH 10/10] Fix: Typo --- htdocs/core/tpl/freeproductline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index bf4dc001e00af..18f76aa105da5 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -75,7 +75,7 @@ service->enabled && $dateSelector) { ?> > - global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="10"' : ' colspan="9s"'); ?>> + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="10"' : ' colspan="9"'); ?>> trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; echo $form->select_date('','date_start',$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,"addproduct");