Merge branch '3.9' of git@github.com:Dolibarr/dolibarr.git into 3.9
@@ -337,7 +337,7 @@ p.titre {
|
|||||||
/* -------------- Boutons --------------------- */
|
/* -------------- Boutons --------------------- */
|
||||||
.bouton_ajout_article {
|
.bouton_ajout_article {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
width: 100%;
|
width: 60%;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -706,6 +706,11 @@ if (empty($reshook))
|
|||||||
$result = $object->validate($user);
|
$result = $object->validate($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if ($action == 'reopen' && $user->rights->contrat->creer)
|
||||||
|
{
|
||||||
|
$result = $object->reopen($user);
|
||||||
|
}
|
||||||
|
|
||||||
// Close all lines
|
// Close all lines
|
||||||
else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer)
|
else if ($action == 'confirm_close' && $confirm == 'yes' && $user->rights->contrat->creer)
|
||||||
{
|
{
|
||||||
@@ -1077,7 +1082,7 @@ if ($action == 'create')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print $form->select_company('','socid','',1);
|
print $form->select_company('','socid','',1,1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
@@ -1110,12 +1115,13 @@ if ($action == 'create')
|
|||||||
$form->select_date($datecontrat,'',0,0,'',"contrat");
|
$form->select_date($datecontrat,'',0,0,'',"contrat");
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
|
// Project
|
||||||
if (! empty($conf->projet->enabled))
|
if (! empty($conf->projet->enabled))
|
||||||
{
|
{
|
||||||
$formproject=new FormProjets($db);
|
$formproject=new FormProjets($db);
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
print '<tr><td>'.$langs->trans("Project").'</td><td>';
|
||||||
$formproject->select_projects($soc->id,$projectid,"projectid");
|
$formproject->select_projects(($soc->id>0?$soc->id:-1),$projectid,"projectid",0,0,1,1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1325,11 +1331,11 @@ else
|
|||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($action == "classify")
|
if ($action == "classify")
|
||||||
{
|
{
|
||||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id,$object->socid,$object->fk_project,"projectid", 0, 0, 1);
|
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, "projectid", 1, 0, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id,$object->socid,$object->fk_project,"none", 0, 0);
|
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, "none", 0, 0);
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
@@ -1915,7 +1921,12 @@ else
|
|||||||
if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a></div>';
|
if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid">'.$langs->trans("Validate").'</a></div>';
|
||||||
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a></div>';
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a></div>';
|
||||||
}
|
}
|
||||||
|
if ($object->statut == 1 && $nbofservices)
|
||||||
|
{
|
||||||
|
if ($user->rights->contrat->creer) print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen">'.$langs->trans("Modify").'</a></div>';
|
||||||
|
else print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Modify").'</a></div>';
|
||||||
|
}
|
||||||
|
|
||||||
if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices)
|
if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices)
|
||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
@@ -1975,6 +1986,12 @@ else
|
|||||||
|
|
||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
// List of actions on element
|
||||||
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||||
|
$formactions = new FormActions($db);
|
||||||
|
$somethingshown = $formactions->showactions($object, 'contract', $socid);
|
||||||
|
|
||||||
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -472,7 +472,71 @@ class Contrat extends CommonObject
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unvalidate a contract
|
||||||
|
*
|
||||||
|
* @param User $user Objet User
|
||||||
|
* @param int $notrigger 1=Does not execute triggers, 0=execute triggers
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
function reopen($user, $notrigger=0)
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
global $langs, $conf;
|
||||||
|
|
||||||
|
$now=dol_now();
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
dol_syslog(get_class($this).'::reopen user='.$user->id);
|
||||||
|
|
||||||
|
$this->db->begin();
|
||||||
|
|
||||||
|
$this->fetch_thirdparty();
|
||||||
|
|
||||||
|
$sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET statut = 0";
|
||||||
|
//$sql.= ", fk_user_valid = null, date_valid = null";
|
||||||
|
$sql .= " WHERE rowid = ".$this->id . " AND statut = 1";
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
if (! $resql)
|
||||||
|
{
|
||||||
|
dol_print_error($this->db);
|
||||||
|
$error++;
|
||||||
|
$this->error=$this->db->lasterror();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Trigger calls
|
||||||
|
if (! $error && ! $notrigger)
|
||||||
|
{
|
||||||
|
// Call trigger
|
||||||
|
$result=$this->call_trigger('CONTRACT_REOPEN',$user);
|
||||||
|
if ($result < 0) {
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
// End call triggers
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set new ref and define current statut
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$this->statut=0;
|
||||||
|
$this->brouillon=1;
|
||||||
|
$this->date_validation=$now;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load a contract from database
|
* Load a contract from database
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -748,8 +748,9 @@ class ExtraFields
|
|||||||
|
|
||||||
$out.='<select class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
|
$out.='<select class="flat" name="'.$keysuffix.'options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
|
||||||
$out.='<option value="0"> </option>';
|
$out.='<option value="0"> </option>';
|
||||||
foreach ($param['options'] as $key=>$val )
|
foreach ($param['options'] as $key => $val)
|
||||||
{
|
{
|
||||||
|
if ($key == '') continue;
|
||||||
list($val, $parent) = explode('|', $val);
|
list($val, $parent) = explode('|', $val);
|
||||||
$out.='<option value="'.$key.'"';
|
$out.='<option value="'.$key.'"';
|
||||||
$out.= ($value==$key?' selected':'');
|
$out.= ($value==$key?' selected':'');
|
||||||
@@ -1160,7 +1161,6 @@ class ExtraFields
|
|||||||
$list=$this->attribute_list[$key];
|
$list=$this->attribute_list[$key];
|
||||||
|
|
||||||
$showsize=0;
|
$showsize=0;
|
||||||
|
|
||||||
if ($type == 'date')
|
if ($type == 'date')
|
||||||
{
|
{
|
||||||
$showsize=10;
|
$showsize=10;
|
||||||
|
|||||||
@@ -3444,7 +3444,7 @@ class Form
|
|||||||
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||||
* @param int $selected Id pre-selected project
|
* @param int $selected Id pre-selected project
|
||||||
* @param string $htmlname Name of select field
|
* @param string $htmlname Name of select field
|
||||||
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
|
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely except $selected,2=Disable)
|
||||||
* @param int $maxlength Max length
|
* @param int $maxlength Max length
|
||||||
* @param int $forcefocus Force focus on field (works with javascript only)
|
* @param int $forcefocus Force focus on field (works with javascript only)
|
||||||
* @return void
|
* @return void
|
||||||
@@ -3467,7 +3467,7 @@ class Form
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
$formproject->select_projects($socid,$selected,$htmlname,$maxlength,0,1,$discard_closed, $forcefocus);
|
$formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||||
print '</tr></table></form>';
|
print '</tr></table></form>';
|
||||||
|
|||||||
@@ -55,13 +55,13 @@ class FormProjets
|
|||||||
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
|
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
|
||||||
* @param int $forcefocus Force focus on field (works with javascript only)
|
* @param int $forcefocus Force focus on field (works with javascript only)
|
||||||
* @param int $disabled Disabled
|
* @param int $disabled Disabled
|
||||||
* @param int $mode 0 for HTML mode and 1 for JSON mode
|
* @param int $mode 0 for HTML mode and 1 for JSON mode
|
||||||
* @param string $filterkey Key to filter
|
* @param string $filterkey Key to filter
|
||||||
* @return int Nber of project if OK, <0 if KO
|
* @return int Nber of project if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '')
|
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '')
|
||||||
{
|
{
|
||||||
global $langs,$conf;
|
global $langs,$conf,$form;
|
||||||
|
|
||||||
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT))
|
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT))
|
||||||
{
|
{
|
||||||
@@ -86,6 +86,14 @@ class FormProjets
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, $discard_closed, $forcefocus, $disabled, 0, $filterkey);
|
print $this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, $discard_closed, $forcefocus, $disabled, 0, $filterkey);
|
||||||
|
if ($discard_closed)
|
||||||
|
{
|
||||||
|
if (class_exists('Form'))
|
||||||
|
{
|
||||||
|
if (empty($form)) $form=new Form($this->db);
|
||||||
|
print $form->textwithpicto('', $langs->trans("ClosedProjectsAreHidden"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +182,7 @@ class FormProjets
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($discard_closed == 1 && $obj->fk_statut == 2)
|
if ($discard_closed == 1 && $obj->fk_statut == 2 && $obj->rowid != $selected) // We discard closed except if selected
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ class Fichinter extends CommonObject
|
|||||||
$sql.= ", ref";
|
$sql.= ", ref";
|
||||||
$sql.= ", entity";
|
$sql.= ", entity";
|
||||||
$sql.= ", fk_user_author";
|
$sql.= ", fk_user_author";
|
||||||
|
$sql.= ", fk_user_modif";
|
||||||
$sql.= ", description";
|
$sql.= ", description";
|
||||||
$sql.= ", model_pdf";
|
$sql.= ", model_pdf";
|
||||||
$sql.= ", fk_projet";
|
$sql.= ", fk_projet";
|
||||||
@@ -144,6 +145,7 @@ class Fichinter extends CommonObject
|
|||||||
$sql.= ", '".$this->db->escape($this->ref)."'";
|
$sql.= ", '".$this->db->escape($this->ref)."'";
|
||||||
$sql.= ", ".$conf->entity;
|
$sql.= ", ".$conf->entity;
|
||||||
$sql.= ", ".$user->id;
|
$sql.= ", ".$user->id;
|
||||||
|
$sql.= ", ".$user->id;
|
||||||
$sql.= ", ".($this->description?"'".$this->db->escape($this->description)."'":"null");
|
$sql.= ", ".($this->description?"'".$this->db->escape($this->description)."'":"null");
|
||||||
$sql.= ", '".$this->db->escape($this->modelpdf)."'";
|
$sql.= ", '".$this->db->escape($this->modelpdf)."'";
|
||||||
$sql.= ", ".($this->fk_project ? $this->fk_project : 0);
|
$sql.= ", ".($this->fk_project ? $this->fk_project : 0);
|
||||||
|
|||||||
@@ -1981,7 +1981,7 @@ elseif (! empty($object->id))
|
|||||||
//print "$object->id, $object->socid, $object->fk_project";
|
//print "$object->id, $object->socid, $object->fk_project";
|
||||||
if ($action == 'classify')
|
if ($action == 'classify')
|
||||||
{
|
{
|
||||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1'), $object->fk_project, 'projectid', 0, 0, 1);
|
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', 0, 0, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1470,7 +1470,7 @@ if ($action == 'create')
|
|||||||
|
|
||||||
$langs->load('projects');
|
$langs->load('projects');
|
||||||
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">';
|
||||||
$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$societe->id:'-1'), $projectid, 'projectid', 0);
|
$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$societe->id:-1), $projectid, 'projectid', 0, 0, 1, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2039,7 +2039,7 @@ else
|
|||||||
print '</td><td colspan="3">';
|
print '</td><td colspan="3">';
|
||||||
if ($action == 'classify')
|
if ($action == 'classify')
|
||||||
{
|
{
|
||||||
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:'-1'), $object->fk_project, 'projectid', 0, 0, 1);
|
$form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', 0, 0, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ ProjectsPublicTaskDesc=This view presents all projects and tasks you are allowed
|
|||||||
ProjectsDesc=This view presents all projects (your user permissions grant you permission to view everything).
|
ProjectsDesc=This view presents all projects (your user permissions grant you permission to view everything).
|
||||||
MyTasksDesc=This view is limited to projects or tasks you are a contact for (whatever is the type).
|
MyTasksDesc=This view is limited to projects or tasks you are a contact for (whatever is the type).
|
||||||
OnlyOpenedProject=Only open projects are visible (projects in draft or closed status are not visible).
|
OnlyOpenedProject=Only open projects are visible (projects in draft or closed status are not visible).
|
||||||
|
ClosedProjectsAreHidden=Closed projects are not visible.
|
||||||
TasksPublicDesc=This view presents all projects and tasks you are allowed to read.
|
TasksPublicDesc=This view presents all projects and tasks you are allowed to read.
|
||||||
TasksDesc=This view presents all projects and tasks (your user permissions grant you permission to view everything).
|
TasksDesc=This view presents all projects and tasks (your user permissions grant you permission to view everything).
|
||||||
AllTaskVisibleButEditIfYouAreAssigned=All tasks for such project are visible, but you can enter time only for task you are assigned on. Assign task to you if you want to enter time on it.
|
AllTaskVisibleButEditIfYouAreAssigned=All tasks for such project are visible, but you can enter time only for task you are assigned on. Assign task to you if you want to enter time on it.
|
||||||
@@ -163,6 +164,7 @@ ProjectsWithThisUserAsContact=Projects with this user as contact
|
|||||||
TasksWithThisUserAsContact=Tasks assigned to this user
|
TasksWithThisUserAsContact=Tasks assigned to this user
|
||||||
ResourceNotAssignedToProject=Not assigned to project
|
ResourceNotAssignedToProject=Not assigned to project
|
||||||
ResourceNotAssignedToTask=Not assigned to task
|
ResourceNotAssignedToTask=Not assigned to task
|
||||||
|
ResourceNotAssignedToTheTask=Not assigned to the task
|
||||||
AssignTaskToMe=Assign task to me
|
AssignTaskToMe=Assign task to me
|
||||||
AssignTask=Assign
|
AssignTask=Assign
|
||||||
ProjectOverview=Overview
|
ProjectOverview=Overview
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ function test_sql_and_script_inject($val, $type)
|
|||||||
$sql_inj += preg_match('/<script/i', $val);
|
$sql_inj += preg_match('/<script/i', $val);
|
||||||
if (! defined('NOSTYLECHECK')) $sql_inj += preg_match('/<style/i', $val);
|
if (! defined('NOSTYLECHECK')) $sql_inj += preg_match('/<style/i', $val);
|
||||||
$sql_inj += preg_match('/base[\s]+href/si', $val);
|
$sql_inj += preg_match('/base[\s]+href/si', $val);
|
||||||
$sql_inj += preg_match('/<.*onmouseover/si', $val); // onmouseover can be set on img or any html tag like <img title='>' onmouseover=alert(1)>
|
$sql_inj += preg_match('/<.*onmouse/si', $val); // onmouseover can be set on img or any html tag like <img title='>' onmouseover=alert(1)>
|
||||||
if ($type == 1)
|
if ($type == 1)
|
||||||
{
|
{
|
||||||
$sql_inj += preg_match('/javascript:/i', $val);
|
$sql_inj += preg_match('/javascript:/i', $val);
|
||||||
|
|||||||
@@ -108,6 +108,35 @@ if ($action == 'assign')
|
|||||||
{
|
{
|
||||||
$idfortaskuser=$user->id;
|
$idfortaskuser=$user->id;
|
||||||
$result = $object->add_contact($idfortaskuser, GETPOST("type"), 'internal');
|
$result = $object->add_contact($idfortaskuser, GETPOST("type"), 'internal');
|
||||||
|
|
||||||
|
if ($result >= 0 || $result == -2) // Contact add ok or already contact of task
|
||||||
|
{
|
||||||
|
// Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project)
|
||||||
|
$sql='SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact';
|
||||||
|
$sql.=' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'";
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$obj=$db->fetch_object($resql);
|
||||||
|
if (! $obj) // User is not already linked to project, so we will create link to first type
|
||||||
|
{
|
||||||
|
$project = new Project($db);
|
||||||
|
$project->fetch($object->fk_project);
|
||||||
|
// Get type
|
||||||
|
$listofprojcontact=$project->liste_type_contact('internal');
|
||||||
|
|
||||||
|
if (count($listofprojcontact))
|
||||||
|
{
|
||||||
|
$typeforprojectcontact=reset(array_keys($listofprojcontact));
|
||||||
|
$result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@@ -120,7 +120,36 @@ if ($action == 'assign')
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$idfortaskuser=$user->id;
|
$idfortaskuser=$user->id;
|
||||||
$result = $object->add_contact($idfortaskuser, GETPOST("type"), 'internal');
|
$result = $object->add_contact($idfortaskuser, GETPOST("type"), 'internal');
|
||||||
|
|
||||||
|
if (! $result || $result == -2) // Contact add ok or already contact of task
|
||||||
|
{
|
||||||
|
// Test if we are already contact of the project (should be rare but sometimes we can add as task contact without being contact of project, like when admin user has been removed from contact of project)
|
||||||
|
$sql='SELECT ec.rowid FROM '.MAIN_DB_PREFIX.'element_contact as ec, '.MAIN_DB_PREFIX.'c_type_contact as tc WHERE tc.rowid = ec.fk_c_type_contact';
|
||||||
|
$sql.=' AND ec.fk_socpeople = '.$idfortaskuser." AND ec.element_id = '.$object->fk_project.' AND tc.element = 'project' AND source = 'internal'";
|
||||||
|
$resql=$db->query($sql);
|
||||||
|
if ($resql)
|
||||||
|
{
|
||||||
|
$obj=$db->fetch_object($resql);
|
||||||
|
if (! $obj) // User is not already linked to project, so we will create link to first type
|
||||||
|
{
|
||||||
|
$project = new Project($db);
|
||||||
|
$project->fetch($object->fk_project);
|
||||||
|
// Get type
|
||||||
|
$listofprojcontact=$project->liste_type_contact('internal');
|
||||||
|
|
||||||
|
if (count($listofprojcontact))
|
||||||
|
{
|
||||||
|
$typeforprojectcontact=reset(array_keys($listofprojcontact));
|
||||||
|
$result = $project->add_contact($idfortaskuser, $typeforprojectcontact, 'internal');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
if (count($contactsoftask)>0)
|
if (count($contactsoftask)>0)
|
||||||
{
|
{
|
||||||
$userid=$contactsoftask[0];
|
$userid=$contactsoftask[0];
|
||||||
print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsoftask, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToTask"));
|
print $form->select_dolusers((GETPOST('userid')?GETPOST('userid'):$userid), 'userid', 0, '', 0, '', $contactsoftask, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToTheTask"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -405,7 +405,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
// Note
|
// Note
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print '<textarea name="timespent_note" cols="80" rows="'.ROWS_2.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>';
|
print '<textarea name="timespent_note" width="95%" rows="'.ROWS_2.'">'.($_POST['timespent_note']?$_POST['timespent_note']:'').'</textarea>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Progress declared
|
// Progress declared
|
||||||
@@ -528,7 +528,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
|
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
|
||||||
{
|
{
|
||||||
print '<textarea name="timespent_note_line" cols="80" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>';
|
print '<textarea name="timespent_note_line" width="95%" rows="'.ROWS_2.'">'.$task_time->note.'</textarea>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1183,7 +1183,7 @@ div.vmenu, td.vmenu {
|
|||||||
.searchform { padding-top: 4px; }
|
.searchform { padding-top: 4px; }
|
||||||
|
|
||||||
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; }
|
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; }
|
||||||
font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; }
|
font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; }
|
||||||
a.vmenu:link, a.vmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; }
|
a.vmenu:link, a.vmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; }
|
||||||
|
|
||||||
a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; }
|
a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; }
|
||||||
@@ -2221,6 +2221,10 @@ div.pagination li.litext a:hover {
|
|||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
background-image: none;
|
background-image: none;
|
||||||
}
|
}
|
||||||
|
div.pagination li.litext a:hover {
|
||||||
|
background-color: transparent;
|
||||||
|
background-image: none;
|
||||||
|
}
|
||||||
<?php if (! empty($conf->dol_use_jmobile)) { ?>
|
<?php if (! empty($conf->dol_use_jmobile)) { ?>
|
||||||
div.pagination li.litext {
|
div.pagination li.litext {
|
||||||
padding-top: 13px;
|
padding-top: 13px;
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 232 B |
|
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 236 B |
|
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 239 B |
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 269 B |
|
Before Width: | Height: | Size: 158 B After Width: | Height: | Size: 252 B |
@@ -1228,11 +1228,11 @@ div.vmenu, td.vmenu {
|
|||||||
.searchform { padding-top: 8px; }
|
.searchform { padding-top: 8px; }
|
||||||
|
|
||||||
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; }
|
a.vmenu:link, a.vmenu:visited, a.vmenu:hover, a.vmenu:active { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; }
|
||||||
font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #93a5aa; }
|
font.vmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: bold; color: #aaa; margin-left: 4px; }
|
||||||
a.vmenu:link, a.vmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; }
|
a.vmenu:link, a.vmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; }
|
||||||
|
|
||||||
a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; }
|
a.vsmenu:link, a.vsmenu:visited, a.vsmenu:hover, a.vsmenu:active, span.vsmenu { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #202020; margin: 1px 1px 1px 8px; }
|
||||||
font.vsmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #93a5aa; }
|
font.vsmenudisabled { font-size:<?php print $fontsize ?>px; font-family: <?php print $fontlist ?>; text-align: <?php print $left; ?>; font-weight: normal; color: #aaa; }
|
||||||
a.vsmenu:link, a.vsmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; }
|
a.vsmenu:link, a.vsmenu:visited { color: #<?php echo $colortextbackvmenu; ?>; }
|
||||||
font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; }
|
font.vsmenudisabledmargin { margin: 1px 1px 1px 8px; }
|
||||||
|
|
||||||
|
|||||||