diff --git a/.travis.yml b/.travis.yml
index f78bca6f8f9..9e25982c8cf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,19 +2,15 @@
# from Dolibarr GitHub repository.
# For syntax, see http://about.travis-ci.org/docs/user/languages/php/
+# We use dist: precise to have php 5.3 available
dist: precise
sudo: required
language: php
-php:
-- '5.3'
-- '5.4'
-- '5.5'
-- '5.6'
-- '7.0'
-- '7.1'
-- nightly
+# Start on every boot
+services:
+- memcached
addons:
mariadb: '10.0'
@@ -33,10 +29,16 @@ addons:
- libapache2-mod-fastcgi
# We need pgloader for import mysql database into pgsql
- pgloader
-
-# Start on every boot
-services:
-- memcached
+
+php:
+- '5.3'
+- '5.4'
+- '5.5'
+- '5.6'
+- '7.0'
+- '7.1'
+#- hhvm only with dist: trusty
+- nightly
env:
global:
@@ -57,11 +59,22 @@ env:
matrix:
fast_finish: true
allow_failures:
- - php: 7.1
+ - php: hhvm
- php: nightly
- #- env: DB=postgresql
- # TODO
- #- env: DB=sqlite
+ # We exclude some combinations not usefull to save Travis CPU
+ exclude:
+ - php: '5.4'
+ env: DB=postgresql
+ - php: '5.5'
+ env: DB=postgresql
+ - php: '5.6'
+ env: DB=postgresql
+ - php: '7.0'
+ env: DB=postgresql
+ - php: hhvm
+ env: DB=postgresql
+ - php: nightly
+ env: DB=postgresql
notifications:
email:
diff --git a/ChangeLog b/ChangeLog
index 144f39a574b..c64bec0d881 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -162,6 +162,9 @@ Following changes may create regression for some external modules, but were nece
content by doing a print into function, sometimes by returning content into "resprint". This has been fixed to follow
hook specifications so you must return output into "resprint".
+***** ChangeLog for 5.0.6 compared to 5.0.5 *****
+FIX: Removed a bad symbolic link into custom directory.
+FIX: Renaming a resource ref rename also the directory of attached files.
***** ChangeLog for 5.0.5 compared to 5.0.4 *****
FIX: #7075 : bad path for document
diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php
index 0886d006661..fd988f9c637 100644
--- a/htdocs/accountancy/admin/journals_list.php
+++ b/htdocs/accountancy/admin/journals_list.php
@@ -490,7 +490,7 @@ if ($id)
if (empty($reshook))
{
- fieldList($fieldlist,$obj,$tabname[$id],'add');
+ fieldListJournal($fieldlist,$obj,$tabname[$id],'add');
}
print '
';
@@ -595,7 +595,7 @@ if ($id)
$error=$hookmanager->error; $errors=$hookmanager->errors;
// Show fields
- if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit');
+ if (empty($reshook)) fieldListJournal($fieldlist,$obj,$tabname[$id],'edit');
print ' | ';
print '';
@@ -713,7 +713,7 @@ $db->close();
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
* @return void
*/
-function fieldList($fieldlist, $obj='', $tabname='', $context='')
+function fieldListJournal($fieldlist, $obj='', $tabname='', $context='')
{
global $conf,$langs,$db;
global $form, $mysoc;
diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index 50f9e18fd80..c6d0d5cf40e 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -28,7 +28,9 @@ require '../../main.inc.php';
// Class
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
+require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/bookkeeping.class.php';
+require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php';
@@ -51,9 +53,8 @@ if ($search_accountancy_code_end == - 1) {
$search_accountancy_code_end = '';
}
-if (GETPOST("button_export_csv_x") || GETPOST("button_export_csv.x") || GETPOST("button_export_csv")) {
- $action = 'export_csv';
-}
+if (GETPOST("exportcsv")) $action = 'export_csv';
+
$limit = GETPOST('limit','int')?GETPOST('limit', 'int'):$conf->liste_limit;
@@ -66,8 +67,18 @@ $formother = new FormOther($db);
$form = new Form($db);
if (empty($search_date_start)) {
- $search_date_start = dol_mktime(0, 0, 0, 1, 1, dol_print_date(dol_now(), '%Y'));
- $search_date_end = dol_mktime(0, 0, 0, 12, 31, dol_print_date(dol_now(), '%Y'));
+
+ $month_start= ($conf->global->SOCIETE_FISCAL_MONTH_START?($conf->global->SOCIETE_FISCAL_MONTH_START):1);
+ $year_start = dol_print_date(dol_now(), '%Y');
+ $year_end = $year_start + 1;
+ $month_end = $month_start - 1;
+ if ($month_end < 1)
+ {
+ $month_end = 12;
+ $year_end--;
+ }
+ $search_date_start = dol_mktime(0, 0, 0, $month_start, 1, $year_start);
+ $search_date_end = dol_get_last_day($year_end, $month_end);
}
if ($sortorder == "")
$sortorder = "ASC";
@@ -136,7 +147,7 @@ if ($action == 'export_csv') {
}
else {
- $title_page = $langs->trans("AccountBalance") . (($search_date_start || $search_date_end) ? ' ' . dol_print_date($search_date_start) . '-' . dol_print_date($search_date_end) : '');
+ $title_page = $langs->trans("AccountBalance");
llxHeader('', $title_page);
@@ -156,7 +167,7 @@ else {
print ' | ';
print ' | ';
print '';
+print '';
+print '| '.$langs->trans("AllowCommentOnTask").' | ';
+
+print '';
+echo ajax_constantonoff('PROJECT_ALLOW_COMMENT_ON_TASK');
+print ' | ';
+print ' | ';
+print '
';
+
print '';
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 73f0c06bf1e..085af055f38 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -1198,6 +1198,10 @@ elseif ($object->id > 0)
print '';
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
+ $formactions = new FormActions($db);
+ $somethingshown = $formactions->showactions($object, 'project', $socid, 1, '', 10);
print '
';
}
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 17d1b5fcf45..910583782b9 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -35,7 +35,7 @@ class Task extends CommonObject
public $table_element='projet_task'; //!< Name of table without prefix where object is stored
public $fk_element='fk_task';
public $picto = 'task';
- protected $childtables=array('projet_task_time'); // To test if we can delete object
+ protected $childtables=array('projet_task_time','projet_task_comment'); // To test if we can delete object
var $fk_task_parent;
var $label;
@@ -70,6 +70,8 @@ class Task extends CommonObject
var $timespent_fk_user;
var $timespent_note;
+ var $comments = array();
+
public $oldcopy;
@@ -257,8 +259,12 @@ class Task extends CommonObject
$this->db->free($resql);
- if ($num_rows) return 1;
- else return 0;
+ if ($num_rows) {
+ $this->fetchComments();
+ return 1;
+ }else {
+ return 0;
+ }
}
else
{
@@ -1777,4 +1783,332 @@ class Task extends CommonObject
return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay)));
}
+
+ /**
+ * Return nb comments already posted
+ *
+ * @return int
+ */
+ public function getNbComments()
+ {
+ return count($this->comments);
+ }
+
+ /**
+ * Load comments linked with current task
+ *
+ * @return int <0 if KO, 0 if not found, >0 if OK
+ */
+ public function fetchComments()
+ {
+ $this->comments = array();
+ $sql = "SELECT";
+ $sql.= " c.rowid";
+ $sql.= " FROM ".MAIN_DB_PREFIX."projet_task_comment as c";
+ $sql.= " WHERE c.fk_task = ".$this->id;
+ $sql.= " ORDER BY c.tms DESC";
+
+ dol_syslog(get_class($this)."::fetchComments", LOG_DEBUG);
+ $resql=$this->db->query($sql);
+ if ($resql)
+ {
+ $num_rows = $this->db->num_rows($resql);
+ if ($num_rows > 0)
+ {
+ while($obj = $this->db->fetch_object($resql))
+ {
+ $comment = new TaskComment($this->db);
+ $comment->fetch($obj->rowid);
+ $this->comments[] = $comment;
+ }
+ return $num_rows;
+ }else{
+ return 0;
+ }
+ }
+ else
+ {
+ $this->error="Error ".$this->db->lasterror();
+ return -1;
+ }
+ }
}
+
+/**
+ * Class to manage tasks
+ */
+class TaskComment extends CommonObject
+{
+ public $element='project_task_comment'; //!< Id that identify managed objects
+ public $table_element='projet_task_comment'; //!< Name of table without prefix where object is stored
+ public $fk_element='fk_task';
+ public $picto = 'task';
+
+ var $fk_task;
+
+ var $description;
+
+ var $tms;
+
+ var $datec;
+
+ var $fk_user;
+
+ var $entity;
+
+ var $import_key;
+
+ public $oldcopy;
+
+
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ */
+ function __construct($db)
+ {
+ $this->db = $db;
+ }
+
+
+ /**
+ * Create into database
+ *
+ * @param User $user User that create
+ * @param int $notrigger 0=launch triggers after, 1=disable triggers
+ * @return int <0 if KO, Id of created object if OK
+ */
+ function create($user, $notrigger=0)
+ {
+ global $conf, $langs;
+
+ $error=0;
+
+ // Insert request
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task_comment (";
+ $sql.= "description";
+ $sql.= ", datec";
+ $sql.= ", fk_task";
+ $sql.= ", fk_user";
+ $sql.= ", entity";
+ $sql.= ", import_key";
+ $sql.= ") VALUES (";
+ $sql.= "'".$this->db->escape($this->description)."'";
+ $sql.= ", ".($this->datec!=''?"'".$this->db->idate($this->datec)."'":'null');
+ $sql.= ", '".(isset($this->fk_task)?$this->fk_task:"null")."'";
+ $sql.= ", '".(isset($this->fk_user)?$this->fk_user:"null")."'";
+ $sql.= ", ".(!empty($this->entity)?$this->entity:'1');
+ $sql.= ", ".(!empty($this->import_key)?"'".$this->import_key."'":"null");
+ $sql.= ")";
+
+ //var_dump($this->db);
+ //echo $sql;
+
+ $this->db->begin();
+
+ dol_syslog(get_class($this)."::create", LOG_DEBUG);
+ $resql=$this->db->query($sql);
+ if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
+
+ if (! $error)
+ {
+ $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."projet_task_comment");
+
+ if (! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('TASK_COMMENT_CREATE',$user);
+ if ($result < 0) { $error++; }
+ // End call triggers
+ }
+ }
+
+ // Commit or rollback
+ if ($error)
+ {
+ foreach($this->errors as $errmsg)
+ {
+ dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
+ $this->error.=($this->error?', '.$errmsg:$errmsg);
+ }
+ $this->db->rollback();
+ return -1*$error;
+ }
+ else
+ {
+ $this->db->commit();
+ return $this->id;
+ }
+ }
+
+
+ /**
+ * Load object in memory from database
+ *
+ * @param int $id Id object
+ * @param int $ref ref object
+ * @return int <0 if KO, 0 if not found, >0 if OK
+ */
+ function fetch($id, $ref='')
+ {
+ global $langs;
+
+ $sql = "SELECT";
+ $sql.= " c.rowid,";
+ $sql.= " c.description,";
+ $sql.= " c.datec,";
+ $sql.= " c.tms,";
+ $sql.= " c.fk_task,";
+ $sql.= " c.fk_user,";
+ $sql.= " c.entity,";
+ $sql.= " c.import_key";
+ $sql.= " FROM ".MAIN_DB_PREFIX."projet_task_comment as c";
+ $sql.= " WHERE c.rowid = ".$id;
+
+ dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
+ $resql=$this->db->query($sql);
+ if ($resql)
+ {
+ $num_rows = $this->db->num_rows($resql);
+
+ if ($num_rows)
+ {
+ $obj = $this->db->fetch_object($resql);
+
+ $this->id = $obj->rowid;
+ $this->description = $obj->description;
+ $this->datec = $this->db->jdate($obj->datec);
+ $this->tms = $obj->tms;
+ $this->fk_user = $obj->fk_user;
+ $this->fk_task = $obj->fk_task;
+ $this->entity = $obj->entity;
+ $this->import_key = $obj->import_key;
+ }
+
+ $this->db->free($resql);
+
+ if ($num_rows) return 1;
+ else return 0;
+ }
+ else
+ {
+ $this->error="Error ".$this->db->lasterror();
+ return -1;
+ }
+ }
+
+
+ /**
+ * Update database
+ *
+ * @param User $user User that modify
+ * @param int $notrigger 0=launch triggers after, 1=disable triggers
+ * @return int <=0 if KO, >0 if OK
+ */
+ function update(User $user, $notrigger=0)
+ {
+ global $conf, $langs;
+ $error=0;
+
+ // Clean parameters
+ if (isset($this->fk_task)) $this->fk_project=(int) trim($this->fk_task);
+ if (isset($this->fk_user)) $this->fk_user=(int) trim($this->fk_user);
+ if (isset($this->description)) $this->description=trim($this->description);
+
+
+ // Update request
+ $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_comment SET";
+ $sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
+ $sql.= " datec=".($this->datec!=''?"'".$this->db->idate($this->datec)."'":'null').",";
+ $sql.= " fk_task=".(isset($this->fk_task)?$this->fk_task:"null").",";
+ $sql.= " fk_user=".(isset($this->fk_user)?$this->fk_user:"null").",";
+ $sql.= " entity=".(!empty($this->entity)?$this->entity:'1').",";
+ $sql.= " import_key=".(!empty($this->import_key)?"'".$this->import_key."'":"null");
+ $sql.= " WHERE rowid=".$this->id;
+
+ $this->db->begin();
+
+ dol_syslog(get_class($this)."::update", LOG_DEBUG);
+ $resql = $this->db->query($sql);
+ if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
+
+ if (! $error)
+ {
+ if (! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('TASK_COMMENT_MODIFY',$user);
+ if ($result < 0) { $error++; }
+ // End call triggers
+ }
+ }
+
+ // Commit or rollback
+ if ($error)
+ {
+ foreach($this->errors as $errmsg)
+ {
+ dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
+ $this->error.=($this->error?', '.$errmsg:$errmsg);
+ }
+ $this->db->rollback();
+ return -1*$error;
+ }
+ else
+ {
+ $this->db->commit();
+ return 1;
+ }
+ }
+
+
+ /**
+ * Delete task from database
+ *
+ * @param User $user User that delete
+ * @param int $notrigger 0=launch triggers after, 1=disable triggers
+ * @return int <0 if KO, >0 if OK
+ */
+ function delete($user, $notrigger=0)
+ {
+ global $conf, $langs;
+ require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
+
+ $error=0;
+
+ $this->db->begin();
+
+ $sql = "DELETE FROM ".MAIN_DB_PREFIX."projet_task_comment";
+ $sql.= " WHERE rowid=".$this->id;
+
+ $resql = $this->db->query($sql);
+ if (! $resql) { $error++; $this->errors[]="Error ".$this->db->lasterror(); }
+
+ if (! $error)
+ {
+ if (! $notrigger)
+ {
+ // Call trigger
+ $result=$this->call_trigger('TASK_COMMENT_DELETE',$user);
+ if ($result < 0) { $error++; }
+ // End call triggers
+ }
+ }
+
+ // Commit or rollback
+ if ($error)
+ {
+ foreach($this->errors as $errmsg)
+ {
+ dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
+ $this->error.=($this->error?', '.$errmsg:$errmsg);
+ }
+ $this->db->rollback();
+ return -1*$error;
+ }else{
+ $this->db->commit();
+ return 1;
+ }
+ }
+}
\ No newline at end of file
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 0dcb710cfb5..1e4d4132944 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -448,7 +448,7 @@ $listofreferent=array(
'datefieldname'=>'datev',
'margin'=>'minus',
'disableamount'=>0,
- 'urlnew'=>DOL_URL_ROOT.'/compta/bank_various_payment/card.php?action=create&projectid='.$id.'&socid='.$socid,
+ 'urlnew'=>DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&projectid='.$id.'&socid='.$socid,
'lang'=>'banks',
'buttonnew'=>'AddVariousPayment',
'testnew'=>$user->rights->banque->modifier,
@@ -731,7 +731,7 @@ foreach ($listofreferent as $key => $value)
if (! empty($conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS)) $idtofilterthirdparty.=','.$conf->global->PROJECT_OTHER_THIRDPARTY_ID_TO_ADD_ELEMENTS;
}
- if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty)
+ if (empty($conf->global->PROJECT_LINK_ON_OVERWIEW_DISABLED) && $idtofilterthirdparty && !in_array($tablename, array('payment_various')))
{
$selectList=$formproject->select_element($tablename, $idtofilterthirdparty, 'minwidth300');
if (! $selectList || ($selectList<0))
diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php
index 8e506b5d454..3c21d9e0ced 100644
--- a/htdocs/projet/info.php
+++ b/htdocs/projet/info.php
@@ -184,7 +184,7 @@ if (!empty($object->id))
// List of actions on element
/*include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions=new FormActions($db);
- $somethingshown=$formactions->showactions($object,'project',0);*/
+ $somethingshown = $formactions->showactions($object,'project',0);*/
// List of todo actions
//show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode);
diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php
new file mode 100644
index 00000000000..3f0cbe0bf47
--- /dev/null
+++ b/htdocs/projet/tasks/comment.php
@@ -0,0 +1,393 @@
+
+ * Copyright (C) 2006-2017 Laurent Destailleur
+ * Copyright (C) 2010-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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file htdocs/projet/tasks/task.php
+ * \ingroup project
+ * \brief Page of a project task
+ */
+
+require ("../../main.inc.php");
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
+
+$langs->load("projects");
+$langs->load("companies");
+
+$id=GETPOST('id','int');
+$idcomment=GETPOST('idcomment','int');
+$ref=GETPOST("ref",'alpha',1); // task ref
+$taskref=GETPOST("taskref",'alpha'); // task ref
+$action=GETPOST('action','alpha');
+$confirm=GETPOST('confirm','alpha');
+$withproject=GETPOST('withproject','int');
+$project_ref=GETPOST('project_ref','alpha');
+$planned_workload=((GETPOST('planned_workloadhour','int')!='' || GETPOST('planned_workloadmin','int')!='') ? (GETPOST('planned_workloadhour','int')>0?GETPOST('planned_workloadhour','int')*3600:0) + (GETPOST('planned_workloadmin','int')>0?GETPOST('planned_workloadmin','int')*60:0) : '');
+
+// Security check
+$socid=0;
+//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+if (! $user->rights->projet->lire) accessforbidden();
+
+// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
+$hookmanager->initHooks(array('projecttaskcard','globalcard'));
+
+$task = new Task($db);
+$object = new TaskComment($db);
+$extrafields = new ExtraFields($db);
+$projectstatic = new Project($db);
+$userstatic = new User($db);
+
+// fetch optionals attributes and labels
+$extralabels=$extrafields->fetch_name_optionals_label($task->table_element);
+
+
+/*
+ * Actions
+ */
+
+if ($action == 'addcomment')
+{
+ if (!empty($_POST['comment_description']))
+ {
+ $object->description = GETPOST('comment_description');
+ $object->datec = time();
+ $object->fk_task = $id;
+ $object->fk_user = $user->id;
+ $object->entity = $conf->entity;
+ if ($object->create($user) > 0)
+ {
+ header('Location: '.DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$id.($withproject?'&withproject=1':''));
+ exit;
+ }
+ else
+ {
+ setEventMessages($task->error,$task->errors,'errors');
+ $action='';
+ }
+ }
+}
+if ($action == 'deletecomment')
+{
+ if ($object->fetch($idcomment) >= 0)
+ {
+ if ($object->delete($user) > 0)
+ {
+ header('Location: '.DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$id.($withproject?'&withproject=1':''));
+ exit;
+ }
+ else
+ {
+ setEventMessages($task->error,$task->errors,'errors');
+ $action='';
+ }
+ }
+}
+
+// Retreive First Task ID of Project if withprojet is on to allow project prev next to work
+if (! empty($project_ref) && ! empty($withproject))
+{
+ if ($projectstatic->fetch('',$project_ref) > 0)
+ {
+ $tasksarray=$task->getTasksArray(0, 0, $projectstatic->id, $socid, 0);
+ if (count($tasksarray) > 0)
+ {
+ $id=$tasksarray[0]->id;
+ }
+ else
+ {
+ header("Location: ".DOL_URL_ROOT.'/projet/tasks.php?id='.$projectstatic->id.(empty($mode)?'':'&mode='.$mode));
+ }
+ }
+}
+
+/*
+ * View
+*/
+
+
+llxHeader('', $langs->trans("TaskComment"));
+
+$form = new Form($db);
+$formother = new FormOther($db);
+$formfile = new FormFile($db);
+
+if ($id > 0 || ! empty($ref))
+{
+ if ($task->fetch($id,$ref) > 0)
+ {
+ $res=$task->fetch_optionals($task->id,$extralabels);
+
+ $result=$projectstatic->fetch($task->fk_project);
+ if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
+
+ $task->project = clone $projectstatic;
+
+ $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"), -1, ($projectstatic->public?'projectpub':'project'));
+
+ $param=($mode=='mine'?'&mode=mine':'');
+
+ // Project card
+
+ $linkback = ''.$langs->trans("BackToList").'';
+
+ $morehtmlref='';
+ // Title
+ $morehtmlref.=$projectstatic->title;
+ // Thirdparty
+ if ($projectstatic->thirdparty->id > 0)
+ {
+ $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $projectstatic->thirdparty->getNomUrl(1, 'project');
+ }
+ $morehtmlref.='
';
+
+ // Define a complementary filter for search of next/prev ref.
+ if (! $user->rights->projet->all->lire)
+ {
+ $tasksListId = $projectstatic->getProjectsAuthorizedForUser($user,0,0);
+ $projectstatic->next_prev_filter=" rowid in (".(count($tasksListId)?join(',',array_keys($tasksListId)):'0').")";
+ }
+
+ dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+
+ print '';
+ print '
';
+ print '
';
+
+ print '
';
+
+ // Visibility
+ print '| '.$langs->trans("Visibility").' | ';
+ if ($projectstatic->public) print $langs->trans('SharedProject');
+ else print $langs->trans('PrivateProject');
+ print ' |
';
+
+ // Date start - end
+ print '| '.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").' | ';
+ print dol_print_date($projectstatic->date_start,'day');
+ $end=dol_print_date($projectstatic->date_end,'day');
+ if ($end) print ' - '.$end;
+ print ' |
';
+
+ // Budget
+ print '| '.$langs->trans("Budget").' | ';
+ if (strcmp($projectstatic->budget_amount, '')) print price($projectstatic->budget_amount,'',$langs,1,0,0,$conf->currency);
+ print ' |
';
+
+ // Other attributes
+ $cols = 2;
+ //include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
+
+ print '
';
+
+ print '
';
+ print '
';
+ print '
';
+ print '
';
+
+ print '
';
+
+ // Description
+ print '| '.$langs->trans("Description").' | ';
+ print nl2br($projectstatic->description);
+ print ' | ';
+
+ // Categories
+ if($conf->categorie->enabled) {
+ print '| '.$langs->trans("Categories").' | ';
+ print $form->showCategories($projectstatic->id,'project',1);
+ print " |
";
+ }
+
+ print '
';
+
+ print '
';
+ print '
';
+ print '
';
+
+ print '';
+
+ dol_fiche_end();
+
+ print '
';
+ }
+
+ $head=task_prepare_head($task);
+
+ /*
+ * Fiche tache en mode visu
+ */
+ $param=($withproject?'&withproject=1':'');
+ $linkback=$withproject?''.$langs->trans("BackToList").'':'';
+
+ dol_fiche_head($head, 'task_comment', $langs->trans("Task"), -1, 'projecttask');
+
+ if ($action == 'delete')
+ {
+ print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"].'&withproject='.$withproject,$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete");
+ }
+
+ if (! GETPOST('withproject') || empty($projectstatic->id))
+ {
+ $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
+ $task->next_prev_filter=" fk_projet in (".$projectsListId.")";
+ }
+ else $task->next_prev_filter=" fk_projet = ".$projectstatic->id;
+
+ $morehtmlref='';
+
+ // Project
+ if (empty($withproject))
+ {
+ $morehtmlref.='';
+ $morehtmlref.=$langs->trans("Project").': ';
+ $morehtmlref.=$projectstatic->getNomUrl(1);
+ $morehtmlref.='
';
+
+ // Third party
+ $morehtmlref.=$langs->trans("ThirdParty").': ';
+ if (!empty($projectstatic->thirdparty)) {
+ $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1);
+ }
+ $morehtmlref.='
';
+ }
+
+ dol_banner_tab($task, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
+
+ print '';
+
+ print '
';
+ print '
';
+
+ // Nb comments
+ print '| '.$langs->trans("TaskNbComments").' | ';
+ print $task->getNbComments();
+ print ' | ';
+
+ // Other attributes
+ $cols = 3;
+ $parameyers=array('socid'=>$socid);
+ include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
+
+ print '
';
+
+ print '
';
+
+ dol_fiche_end();
+
+
+ print '
';
+ print '';
+ // List of actions on element
+ include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
+ $formactions = new FormActions($db);
+ $somethingshown = $formactions->showactions($object, 'task', $socid, 1, '', 10, 'withproject='.$withproject);
+
print '
';
}
}
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 74ec47549a2..8b85c299fdc 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -442,7 +442,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
$morehtmlref='';
-
+
// Project
if (empty($withproject))
{
@@ -450,10 +450,12 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$morehtmlref.=$langs->trans("Project").': ';
$morehtmlref.=$projectstatic->getNomUrl(1);
$morehtmlref.='
';
-
+
// Third party
- $morehtmlref.=$langs->trans("ThirdParty").': ';
- $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1);
+ $morehtmlref.=$langs->trans("ThirdParty").': ';
+ if (is_object($projectstatic->thirdparty)) {
+ $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1);
+ }
$morehtmlref.='';
}
@@ -462,7 +464,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print '';
print '
';
- print '
';
+ print '
';
print '
';
// Date start - Date end
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index f174c51cc74..03c44514b01 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -299,11 +299,39 @@ if ($action == 'add')
if (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE))
{
- if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox')
+ if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'all')
+ {
+ $urlback=DOL_MAIN_URL_ROOT.'/public/payment/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
+ if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount'));
+ if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email'));
+ if (! empty($conf->global->PAYMENT_SECURITY_TOKEN))
+ {
+ if (! empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE))
+ {
+ $urlback.='&securekey='.urlencode(dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2));
+ }
+ else
+ {
+ $urlback.='&securekey='.urlencode($conf->global->PAYMENT_SECURITY_TOKEN);
+ }
+ }
+ }
+ else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox')
{
$urlback=DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.urlencode($adh->ref);
if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount'));
if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email'));
+ if (! empty($conf->global->PAYBOX_SECURITY_TOKEN))
+ {
+ if (! empty($conf->global->PAYBOX_SECURITY_TOKEN_UNIQUE))
+ {
+ $urlback.='&securekey='.urlencode(dol_hash($conf->global->PAYBOX_SECURITY_TOKEN . 'membersubscription' . $adh->ref, 2));
+ }
+ else
+ {
+ $urlback.='&securekey='.urlencode($conf->global->PAYBOX_SECURITY_TOKEN);
+ }
+ }
}
else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal')
{
diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php
index dc81934dd95..63617076a1b 100644
--- a/htdocs/public/onlinesign/newonlinesign.php
+++ b/htdocs/public/onlinesign/newonlinesign.php
@@ -205,8 +205,8 @@ if (! empty($conf->global->ONLINE_SIGN_NEWFORM_TEXT))
}
if (empty($text))
{
- $text.=' '.$langs->trans("WelcomeOnOnlineSignaturePage").'
|
'."\n";
- $text.=' '.$langs->trans("ThisScreenAllowsYouToSignDocFrom",$creditor).'
|
'."\n";
+ $text.=' '.$langs->trans("WelcomeOnOnlineSignaturePage").' |
'."\n";
+ $text.=''.$langs->trans("ThisScreenAllowsYouToSignDocFrom",$creditor).'
|
'."\n";
}
print $text;
diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php
index 22d2e4ddc00..0d8e930c95c 100644
--- a/htdocs/public/paybox/newpayment.php
+++ b/htdocs/public/paybox/newpayment.php
@@ -243,8 +243,8 @@ if (! empty($conf->global->PAYMENT_NEWFORM_TEXT))
}
if (empty($text))
{
- $text.=' '.$langs->trans("WelcomeOnPaymentPage").'
|
'."\n";
- $text.=' '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'
|
'."\n";
+ $text.=' '.$langs->trans("WelcomeOnPaymentPage").' |
'."\n";
+ $text.=''.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'
|
'."\n";
}
print $text;
diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php
index 620ac797818..1a1d36f9fb1 100644
--- a/htdocs/public/payment/newpayment.php
+++ b/htdocs/public/payment/newpayment.php
@@ -594,8 +594,8 @@ if (! empty($conf->global->PAYMENT_NEWFORM_TEXT))
}
if (empty($text))
{
- $text.=' '.$langs->trans("WelcomeOnPaymentPage").'
|
'."\n";
- $text.=' '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'
|
'."\n";
+ $text.=' '.$langs->trans("WelcomeOnPaymentPage").' |
'."\n";
+ $text.=''.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'
|
'."\n";
}
print $text;
@@ -926,7 +926,7 @@ if ($source == 'contractline')
{
$amount=$contractline->total_ttc;
- if ($contractline->fk_product && ! empty($conf->global-PAYMENT_USE_NEW_PRICE_FOR_CONTRACTLINES))
+ if ($contractline->fk_product && ! empty($conf->global->PAYMENT_USE_NEW_PRICE_FOR_CONTRACTLINES))
{
$product=new Product($db);
$result=$product->fetch($contractline->fk_product);
diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php
index efbe9b1b682..310f553269b 100644
--- a/htdocs/public/paypal/newpayment.php
+++ b/htdocs/public/paypal/newpayment.php
@@ -348,8 +348,8 @@ if (! empty($conf->global->PAYMENT_NEWFORM_TEXT))
}
if (empty($text))
{
- $text.=' '.$langs->trans("WelcomeOnPaymentPage").'
|
'."\n";
- $text.=' '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'
|
'."\n";
+ $text.=' '.$langs->trans("WelcomeOnPaymentPage").' |
'."\n";
+ $text.=''.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'
|
'."\n";
}
print $text;
diff --git a/htdocs/public/stripe/newpayment.php b/htdocs/public/stripe/newpayment.php
index e12cb194c4d..f74e7bd0295 100644
--- a/htdocs/public/stripe/newpayment.php
+++ b/htdocs/public/stripe/newpayment.php
@@ -411,8 +411,8 @@ if (! empty($conf->global->PAYMENT_NEWFORM_TEXT))
}
if (empty($text))
{
- $text.=' '.$langs->trans("WelcomeOnPaymentPage").'
|
'."\n";
- $text.=' '.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'
|
'."\n";
+ $text.=' '.$langs->trans("WelcomeOnPaymentPage").' |
'."\n";
+ $text.=''.$langs->trans("ThisScreenAllowsYouToPay",$creditor).'
|
'."\n";
}
print $text;
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 2aa35625aa0..bc51fb39375 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -186,7 +186,6 @@ if (empty($reshook))
$objects = array(
'Adherent' => '/adherents/class/adherent.class.php',
'Societe' => '/societe/class/societe.class.php',
- 'Bookmark' => '/bookmarks/class/bookmark.class.php',
'Categorie' => '/categories/class/categorie.class.php',
'ActionComm' => '/comm/action/class/actioncomm.class.php',
'Propal' => '/comm/propal/class/propal.class.php',
@@ -1045,7 +1044,7 @@ else
// Prospect/Customer
print '| '.fieldLabel('ProspectCustomer','customerprospect',1).' | ';
print '';
- $selected=isset($_POST['client'])?GETPOST('client'):$object->client;
+ $selected=GETPOST('client','int')!=''?GETPOST('client','int'):$object->client;
print ' |
'; + print $langs->trans('Date').' : '.dol_print_date($comment->datec,'dayhoursec'); + if(($first && $fk_user == $user->id) || $user->admin == 1) { + print '
'.$langs->trans('Delete').''; + } + print '