[ task #924 ] Add numbering rule on task
[ task #925 ] Add ODT document generation for Tasks in project module
This commit is contained in:
parent
ee82330292
commit
0c0a64f532
@ -309,6 +309,15 @@ class FormFile
|
||||
$modellist=ModelePDFProjects::liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'project_task')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
else
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php';
|
||||
$modellist=ModelePDFTask::liste_modeles($this->db);
|
||||
}
|
||||
}
|
||||
elseif ($modulepart == 'export')
|
||||
{
|
||||
if (is_array($genallowed)) $modellist=$genallowed;
|
||||
|
||||
@ -281,12 +281,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
print '<td>';
|
||||
if ($showlineingray)
|
||||
{
|
||||
print '<i>'.img_object('','projecttask').' '.$lines[$i]->id.'</i>';
|
||||
print '<i>'.img_object('','projecttask').' '.$lines[$i]->ref.'</i>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$taskstatic->id=$lines[$i]->id;
|
||||
$taskstatic->ref=$lines[$i]->id;
|
||||
$taskstatic->ref=$lines[$i]->ref;
|
||||
$taskstatic->label=($taskrole[$lines[$i]->id]?$langs->trans("YourRole").': '.$taskrole[$lines[$i]->id]:'');
|
||||
print $taskstatic->getNomUrl(1,($showproject?'':'withproject'));
|
||||
}
|
||||
|
||||
@ -76,14 +76,14 @@ class modProjet extends DolibarrModules
|
||||
$this->const[$r][0] = "PROJECT_ADDON_PDF";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "baleine";
|
||||
$this->const[$r][3] = 'Nom du gestionnaire de generation des projets en PDF';
|
||||
$this->const[$r][3] = 'Name of PDF/ODT project manager class';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "PROJECT_ADDON";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "mod_project_simple";
|
||||
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des projets';
|
||||
$this->const[$r][3] = 'Name of Numbering Rule project manager class';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
@ -96,15 +96,15 @@ class modProjet extends DolibarrModules
|
||||
|
||||
$this->const[$r][0] = "PROJECT_TASK_ADDON_PDF";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "baleine";
|
||||
$this->const[$r][3] = 'Nom du gestionnaire de generation des task en PDF';
|
||||
$this->const[$r][2] = "";
|
||||
$this->const[$r][3] = 'Name of PDF/ODT tasks manager class';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
$this->const[$r][0] = "PROJECT_TASK_ADDON";
|
||||
$this->const[$r][1] = "chaine";
|
||||
$this->const[$r][2] = "mod_task_simple";
|
||||
$this->const[$r][3] = 'Nom du gestionnaire de numerotation des taches';
|
||||
$this->const[$r][3] = 'Name of Numbering Rule task manager class';
|
||||
$this->const[$r][4] = 0;
|
||||
$r++;
|
||||
|
||||
|
||||
@ -402,7 +402,7 @@ if (! $error && $db->connected && $action == "set")
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$srcroot=$main_dir.'/install/doctemplates';
|
||||
$destroot=$main_data_dir.'/doctemplates';
|
||||
$docs=array('thirdparties' => 'thirdparty', 'proposals' => 'proposal', 'orders' => 'order', 'invoices' => 'invoice', 'projects' => 'project', 'projects' => 'task_summary');
|
||||
$docs=array('thirdparties' => 'thirdparty', 'proposals' => 'proposal', 'orders' => 'order', 'invoices' => 'invoice', 'projects' => 'project', 'projects' => 'task_summary', 'tasks' => 'task_summary');
|
||||
foreach($docs as $cursordir => $cursorfile)
|
||||
{
|
||||
$src=$srcroot.'/'.$cursordir.'/template_'.$cursorfile.'.odt';
|
||||
|
||||
@ -90,4 +90,12 @@ ALTER TABLE llx_categorie_contact ADD INDEX idx_categorie_contact_fk_socpeople (
|
||||
ALTER TABLE llx_categorie_contact ADD CONSTRAINT fk_categorie_contact_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
|
||||
ALTER TABLE llx_categorie_contact ADD CONSTRAINT fk_categorie_contact_fk_socpeople FOREIGN KEY (fk_socpeople) REFERENCES llx_socpeople (rowid);
|
||||
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('PROJECT_TASK_ADDON_PDF','','chaine','Name of PDF/ODT tasks manager class',0,1);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('PROJECT_TASK_ADDON','mod_task_simple','chaine','Name of Numbering Rule task manager class',0,1);
|
||||
insert into llx_const (name, value, type, note, visible, entity) values ('PROJECT_TASK_ADDON_PDF_ODT_PATH','DOL_DATA_ROOT/doctemplates/tasks','chaine','',0,1);
|
||||
|
||||
ALTER TABLE llx_projet_task ADD COLUMN ref varchar(50) AFTER rowid;
|
||||
UPDATE llx_projet_task SET ref=rowid;
|
||||
ALTER TABLE llx_projet_task ADD COLUMN model_pdf varchar(255);
|
||||
|
||||
|
||||
|
||||
@ -29,8 +29,8 @@ create table llx_projet_task
|
||||
datev datetime, -- date validation
|
||||
label varchar(255) NOT NULL,
|
||||
description text,
|
||||
duration_effective real DEFAULT 0 NOT NULL,
|
||||
planned_workload real DEFAULT 0 NOT NULL,
|
||||
duration_effective real DEFAULT 0 NOT NULL,
|
||||
planned_workload real DEFAULT 0 NOT NULL,
|
||||
progress integer DEFAULT 0, -- percentage increase
|
||||
priority integer DEFAULT 0, -- priority
|
||||
fk_user_creat integer, -- user who created the task
|
||||
@ -38,5 +38,6 @@ create table llx_projet_task
|
||||
fk_statut smallint DEFAULT 0 NOT NULL,
|
||||
note_private text,
|
||||
note_public text,
|
||||
rang integer DEFAULT 0
|
||||
rang integer DEFAULT 0,
|
||||
model_pdf varchar(255)
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -1454,6 +1454,8 @@ TestGeoIPResult=Test of a conversion IP -> country
|
||||
ProjectsNumberingModules=Projects numbering module
|
||||
ProjectsSetup=Project module setup
|
||||
ProjectsModelModule=Project reports document model
|
||||
TasksNumberingModules=Tasks numbering module
|
||||
TaskModelModule=Tasks reports document model
|
||||
##### ECM (GED) #####
|
||||
ECMSetup = GED Setup
|
||||
ECMAutoTree = Automatic tree folder and document
|
||||
|
||||
@ -1454,6 +1454,8 @@ TestGeoIPResult=Test de conversion IP -> Pays
|
||||
ProjectsNumberingModules=Modèles de numérotation des références projets
|
||||
ProjectsSetup=Configuration du module Projets
|
||||
ProjectsModelModule=Modèles de document de rapport projets
|
||||
TasksNumberingModules==Modèles de numérotation des références taches
|
||||
TaskModelModule=Modèles de document de rapport taches
|
||||
##### ECM (GED) #####
|
||||
ECMSetup = Configuration du module GED
|
||||
ECMAutoTree = L'arborescence automatique est disponible
|
||||
|
||||
@ -182,6 +182,11 @@ else if ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
// Activate a model for task
|
||||
else if ($action == 'settask')
|
||||
{
|
||||
$ret = addDocumentModel($value,'project_task', $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
{
|
||||
|
||||
@ -36,6 +36,8 @@ class Task extends CommonObject
|
||||
|
||||
var $id;
|
||||
|
||||
var $ref;
|
||||
|
||||
var $fk_project;
|
||||
var $fk_task_parent;
|
||||
var $label;
|
||||
@ -52,6 +54,7 @@ class Task extends CommonObject
|
||||
var $statut;
|
||||
var $note_private;
|
||||
var $note_public;
|
||||
var $rang;
|
||||
|
||||
var $timespent_id;
|
||||
var $timespent_duration;
|
||||
@ -95,6 +98,7 @@ class Task extends CommonObject
|
||||
// Insert request
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (";
|
||||
$sql.= "fk_projet";
|
||||
$sql.= ", ref";
|
||||
$sql.= ", fk_task_parent";
|
||||
$sql.= ", label";
|
||||
$sql.= ", description";
|
||||
@ -106,6 +110,7 @@ class Task extends CommonObject
|
||||
$sql.= ", progress";
|
||||
$sql.= ") VALUES (";
|
||||
$sql.= $this->fk_project;
|
||||
$sql.= ", ".(!empty($this->ref)?"'".$this->db->escape($this->ref)."'":'null');
|
||||
$sql.= ", ".$this->fk_task_parent;
|
||||
$sql.= ", '".$this->db->escape($this->label)."'";
|
||||
$sql.= ", '".$this->db->escape($this->description)."'";
|
||||
@ -173,14 +178,16 @@ class Task extends CommonObject
|
||||
* Load object in memory from database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param int $ref ref object
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id)
|
||||
function fetch($id,$ref='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
$sql.= " t.ref,";
|
||||
$sql.= " t.fk_projet,";
|
||||
$sql.= " t.fk_task_parent,";
|
||||
$sql.= " t.label,";
|
||||
@ -196,9 +203,15 @@ class Task extends CommonObject
|
||||
$sql.= " t.progress,";
|
||||
$sql.= " t.priority,";
|
||||
$sql.= " t.note_private,";
|
||||
$sql.= " t.note_public";
|
||||
$sql.= " t.note_public,";
|
||||
$sql.= " t.rang";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet_task as t";
|
||||
$sql.= " WHERE t.rowid = ".$id;
|
||||
$sql.= " WHERE ";
|
||||
if (!empty($ref)) {
|
||||
$sql.="t.ref = '".$ref."'";
|
||||
}else {
|
||||
$sql.="t.rowid = ".$id;
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
@ -209,7 +222,7 @@ class Task extends CommonObject
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
$this->ref = $obj->rowid;
|
||||
$this->ref = $obj->ref;
|
||||
$this->fk_project = $obj->fk_projet;
|
||||
$this->fk_task_parent = $obj->fk_task_parent;
|
||||
$this->label = $obj->label;
|
||||
@ -226,6 +239,7 @@ class Task extends CommonObject
|
||||
$this->priority = $obj->priority;
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->note_public = $obj->note_public;
|
||||
$this->rang = $obj->rang;
|
||||
}
|
||||
|
||||
$this->db->free($resql);
|
||||
@ -255,6 +269,7 @@ class Task extends CommonObject
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->fk_project)) $this->fk_project=trim($this->fk_project);
|
||||
if (isset($this->ref)) $this->ref=trim($this->ref);
|
||||
if (isset($this->fk_task_parent)) $this->fk_task_parent=trim($this->fk_task_parent);
|
||||
if (isset($this->label)) $this->label=trim($this->label);
|
||||
if (isset($this->description)) $this->description=trim($this->description);
|
||||
@ -267,6 +282,7 @@ class Task extends CommonObject
|
||||
// Update request
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET";
|
||||
$sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").",";
|
||||
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"'".$this->id."'").",";
|
||||
$sql.= " fk_task_parent=".(isset($this->fk_task_parent)?$this->fk_task_parent:"null").",";
|
||||
$sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
|
||||
$sql.= " description=".(isset($this->description)?"'".$this->db->escape($this->description)."'":"null").",";
|
||||
@ -274,7 +290,8 @@ class Task extends CommonObject
|
||||
$sql.= " planned_workload=".(isset($this->planned_workload)?$this->planned_workload:"0").",";
|
||||
$sql.= " dateo=".($this->date_start!=''?$this->db->idate($this->date_start):'null').",";
|
||||
$sql.= " datee=".($this->date_end!=''?$this->db->idate($this->date_end):'null').",";
|
||||
$sql.= " progress=".$this->progress;
|
||||
$sql.= " progress=".$this->progress.",";
|
||||
$sql.= " rang=".((!empty($this->rang))?$this->rang:"0");
|
||||
$sql.= " WHERE rowid=".$this->id;
|
||||
|
||||
$this->db->begin();
|
||||
@ -500,6 +517,7 @@ class Task extends CommonObject
|
||||
$this->id=0;
|
||||
|
||||
$this->fk_projet='';
|
||||
$this->ref='';
|
||||
$this->fk_task_parent='';
|
||||
$this->title='';
|
||||
$this->duration_effective='';
|
||||
@ -531,7 +549,7 @@ class Task extends CommonObject
|
||||
// List of tasks (does not care about permissions. Filtering will be done later)
|
||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title as plabel, p.public,";
|
||||
$sql.= " t.rowid as taskid, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress,";
|
||||
$sql.= " t.dateo as date_start, t.datee as date_end, t.planned_workload";
|
||||
$sql.= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.ref as ref_task,t.rang";
|
||||
if ($mode == 0)
|
||||
{
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
@ -583,9 +601,9 @@ class Task extends CommonObject
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$tasks[$i] = new stdClass();
|
||||
$tasks[$i] = new Task($db);
|
||||
$tasks[$i]->id = $obj->taskid;
|
||||
$tasks[$i]->ref = $obj->taskid;
|
||||
$tasks[$i]->ref = $obj->ref_task;
|
||||
$tasks[$i]->fk_project = $obj->projectid;
|
||||
$tasks[$i]->projectref = $obj->ref;
|
||||
$tasks[$i]->projectlabel = $obj->plabel;
|
||||
@ -598,6 +616,7 @@ class Task extends CommonObject
|
||||
$tasks[$i]->public = $obj->public;
|
||||
$tasks[$i]->date_start = $this->db->jdate($obj->date_start);
|
||||
$tasks[$i]->date_end = $this->db->jdate($obj->date_end);
|
||||
$tasks[$i]->rang = $obj->rang;
|
||||
}
|
||||
|
||||
$i++;
|
||||
@ -993,19 +1012,32 @@ class Task extends CommonObject
|
||||
$datec = $now;
|
||||
|
||||
$clone_task=new Task($this->db);
|
||||
$origin_task=new Task($this->db);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Load source object
|
||||
$clone_task->fetch($fromid);
|
||||
$origin_task->fetch($fromid);
|
||||
|
||||
$defaultref='';
|
||||
$obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON;
|
||||
if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php"))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php';
|
||||
$modTask = new $obj;
|
||||
$defaultref = $modTask->getNextValue(0,$clone_task);
|
||||
}
|
||||
|
||||
$ori_project_id = $clone_task->fk_project;
|
||||
|
||||
$clone_task->id = 0;
|
||||
$clone_task->ref = $defaultref;
|
||||
$clone_task->fk_project = $project_id;
|
||||
$clone_task->fk_task_parent = $parent_task_id;
|
||||
$clone_task->date_c = $datec;
|
||||
$clone_task->planned_workload = $clone_task->planned_workload;
|
||||
$clone_task->rang = $origin_task->rang;
|
||||
|
||||
//Manage Task Date
|
||||
if ($clone_change_dt)
|
||||
|
||||
@ -114,6 +114,7 @@ if ($action == 'createtask' && $user->rights->projet->creer)
|
||||
$task = new Task($db);
|
||||
|
||||
$task->fk_project = $projectid;
|
||||
$task->ref = GETPOST('ref','alpha');
|
||||
$task->label = $label;
|
||||
$task->description = $description;
|
||||
$task->planned_workload = $planned_workload * 3600;//We set the planned workload into seconds
|
||||
@ -170,6 +171,7 @@ if ($action == 'createtask' && $user->rights->projet->creer)
|
||||
|
||||
$form=new Form($db);
|
||||
$formother=new FormOther($db);
|
||||
$taskstatic = new Task($db);
|
||||
$userstatic=new User($db);
|
||||
|
||||
$help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
|
||||
@ -266,11 +268,27 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->socie
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="createtask">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
|
||||
if (! empty($object->id)) print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
if (! empty($mode)) print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$defaultref='';
|
||||
$obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON;
|
||||
if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php"))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.'.php';
|
||||
$modTask = new $obj;
|
||||
$defaultref = $modTask->getNextValue($soc,$object);
|
||||
}
|
||||
|
||||
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';
|
||||
|
||||
// Ref
|
||||
print '<input type="hidden" name="ref" value="'.($_POST["ref"]?$_POST["ref"]:$defaultref).'">';
|
||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td>'.($_POST["ref"]?$_POST["ref"]:$defaultref).'</td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>';
|
||||
print '<input type="text" size="25" name="label" class="flat" value="'.$label.'">';
|
||||
print '</td></tr>';
|
||||
@ -394,7 +412,7 @@ else
|
||||
print '<table id="tablelines" class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
// print '<td>'.$langs->trans("Project").'</td>';
|
||||
print '<td width="80">'.$langs->trans("RefTask").'</td>';
|
||||
print '<td width="100">'.$langs->trans("RefTask").'</td>';
|
||||
print '<td>'.$langs->trans("LabelTask").'</td>';
|
||||
print '<td align="center">'.$langs->trans("DateStart").'</td>';
|
||||
print '<td align="center">'.$langs->trans("DateEnd").'</td>';
|
||||
|
||||
@ -23,6 +23,10 @@
|
||||
* \brief Page of a project task
|
||||
*/
|
||||
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', true);
|
||||
ini_set('html_errors', false);
|
||||
|
||||
require ("../../main.inc.php");
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||
@ -30,6 +34,8 @@ 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/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/project/task/modules_task.php';
|
||||
|
||||
$langs->load("projects");
|
||||
$langs->load("companies");
|
||||
@ -41,8 +47,6 @@ $confirm=GETPOST('confirm','alpha');
|
||||
$withproject=GETPOST('withproject','int');
|
||||
$project_ref=GETPOST('project_ref','alpha');
|
||||
$planned_workload=GETPOST('planned_workloadhour');
|
||||
$taskid = GETPOST("id",'int');
|
||||
$taskref = GETPOST("ref",'int');
|
||||
|
||||
// Security check
|
||||
$socid=0;
|
||||
@ -73,7 +77,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
|
||||
}
|
||||
if (! $error)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$object->fetch($id,$ref);
|
||||
|
||||
$tmparray=explode('_',$_POST['task_parent']);
|
||||
$task_parent=$tmparray[1];
|
||||
@ -100,7 +104,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
|
||||
|
||||
if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->projet->supprimer)
|
||||
{
|
||||
if ($object->fetch($id) >= 0 )
|
||||
if ($object->fetch($id,$ref) >= 0 )
|
||||
{
|
||||
$result=$projectstatic->fetch($object->fk_projet);
|
||||
if (! empty($projectstatic->socid))
|
||||
@ -142,7 +146,7 @@ if (! empty($project_ref) && ! empty($withproject))
|
||||
// Build doc
|
||||
if ($action == 'builddoc' && $user->rights->projet->creer)
|
||||
{
|
||||
if ($object->fetch($id) >= 0 )
|
||||
if ($object->fetch($id,$ref) >= 0 )
|
||||
{
|
||||
if (GETPOST('model'))
|
||||
{
|
||||
@ -174,7 +178,7 @@ if ($action == 'remove_file' && $user->rights->projet->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
if ($object->fetch($id) >= 0 )
|
||||
if ($object->fetch($id,$ref) >= 0 )
|
||||
{
|
||||
$langs->load("other");
|
||||
$upload_dir = $conf->projet->dir_output;
|
||||
@ -199,7 +203,7 @@ $formfile = new FormFile($db);
|
||||
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($object->fetch($id) > 0)
|
||||
if ($object->fetch($id,$ref) > 0)
|
||||
{
|
||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
||||
|
||||
@ -397,7 +401,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$object->next_prev_filter=" fk_projet in (".$projectsListId.")";
|
||||
}
|
||||
else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
|
||||
print $form->showrefnav($object,'id',$linkback,1,'rowid','ref','',$param);
|
||||
print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -502,6 +506,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$var=true;
|
||||
|
||||
$somethingshown=$formfile->show_documents('project_task',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf);
|
||||
|
||||
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user