Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop
This commit is contained in:
commit
2fa69551de
@ -642,16 +642,17 @@ class Form
|
||||
/**
|
||||
* Return combo list of activated countries, into language of user
|
||||
*
|
||||
* @param string $selected Id or Code or Label of preselected country
|
||||
* @param string $htmlname Name of html select object
|
||||
* @param string $htmloption Options html on select object
|
||||
* @param integer $maxlength Max length for labels (0=no limit)
|
||||
* @param string $morecss More css class
|
||||
* @param string $usecodeaskey 'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key
|
||||
* @param int $showempty Show empty choice
|
||||
* @return string HTML string with select
|
||||
* @param string $selected Id or Code or Label of preselected country
|
||||
* @param string $htmlname Name of html select object
|
||||
* @param string $htmloption Options html on select object
|
||||
* @param integer $maxlength Max length for labels (0=no limit)
|
||||
* @param string $morecss More css class
|
||||
* @param string $usecodeaskey 'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key
|
||||
* @param int $showempty Show empty choice
|
||||
* @param int $disablefavorites Disable favorites
|
||||
* @return string HTML string with select
|
||||
*/
|
||||
function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1)
|
||||
function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1, $disablefavorites=0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
@ -692,13 +693,14 @@ class Form
|
||||
$i++;
|
||||
}
|
||||
|
||||
array_multisort($favorite, SORT_DESC, $label, SORT_ASC, $countryArray);
|
||||
if (empty($disablefavorites)) array_multisort($favorite, SORT_DESC, $label, SORT_ASC, $countryArray);
|
||||
else $countryArray = dol_sort_array($countryArray, 'label');
|
||||
|
||||
foreach ($countryArray as $row)
|
||||
{
|
||||
if (empty($showempty) && empty($row['rowid'])) continue;
|
||||
|
||||
if ($row['favorite'] && $row['code_iso']) $atleastonefavorite++;
|
||||
if (empty($disablefavorites) && $row['favorite'] && $row['code_iso']) $atleastonefavorite++;
|
||||
if (empty($row['favorite']) && $atleastonefavorite)
|
||||
{
|
||||
$atleastonefavorite=0;
|
||||
@ -4774,8 +4776,8 @@ class Form
|
||||
*
|
||||
* @param timestamp $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date (emptydate must be 0).
|
||||
* @param string $prefix Prefix for fields name
|
||||
* @param int $h 1=Show also hours (-1 has same effect, but hour and minutes are prefilled with 23:59 if $set_time = -1)
|
||||
* @param int $m 1=Show also minutes
|
||||
* @param int $h 1 or 2=Show also hours (2=hours on a new line), -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show hour always empty
|
||||
* @param int $m 1=Show also minutes, -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show minutes always empty
|
||||
* @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only
|
||||
* @param string $form_name Not used
|
||||
* @param int $d 1=Show days, month, years
|
||||
@ -4848,6 +4850,8 @@ class Form
|
||||
$smin = !isset($conf->global->MAIN_DEFAULT_DATE_MIN) ? ($h == -1 ? '59' : '') : $conf->global->MAIN_DEFAULT_DATE_MIN;
|
||||
$ssec = !isset($conf->global->MAIN_DEFAULT_DATE_SEC) ? ($h == -1 ? '59' : '') : $conf->global->MAIN_DEFAULT_DATE_SEC;
|
||||
}
|
||||
if ($h == 3) $shour = '';
|
||||
if ($m == 3) $smin = '';
|
||||
|
||||
// You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery'
|
||||
$usecalendar='combo';
|
||||
|
||||
@ -454,6 +454,18 @@ function dol_is_file($pathoffile)
|
||||
return is_file($newpathoffile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if path is a symbolic link
|
||||
*
|
||||
* @param string $pathoffile Path of file
|
||||
* @return boolean True or false
|
||||
*/
|
||||
function dol_is_link($pathoffile)
|
||||
{
|
||||
$newpathoffile=dol_osencode($pathoffile);
|
||||
return is_link($newpathoffile);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if path is an URL
|
||||
*
|
||||
|
||||
@ -542,6 +542,13 @@ function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=nu
|
||||
if (preg_match('/[^a-z0-9_\-\.]+/i',$out)) $out='';
|
||||
}
|
||||
break;
|
||||
case 'aZ09comma': // great to sanitize sortfield or sortorder params that can be t.abc,t.def_gh
|
||||
if (! is_array($out))
|
||||
{
|
||||
$out=trim($out);
|
||||
if (preg_match('/[^a-z0-9_\-\.,]+/i',$out)) $out='';
|
||||
}
|
||||
break;
|
||||
case 'array':
|
||||
if (! is_array($out) || empty($out)) $out=array();
|
||||
break;
|
||||
@ -3090,7 +3097,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
|
||||
//if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on')))
|
||||
if (empty($srconly) && in_array($pictowithoutext, array(
|
||||
'bank', 'close_title', 'delete', 'edit', 'filter', 'grip', 'grip_title', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
|
||||
'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize',
|
||||
'switch_off', 'switch_on', 'unlink', 'uparrow')
|
||||
)) {
|
||||
$fakey = $pictowithoutext;
|
||||
|
||||
@ -893,8 +893,9 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
||||
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
|
||||
{
|
||||
print '<tr class="oddeven trforbreak">'."\n";
|
||||
print '<td colspan="11">';
|
||||
print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||
print '<td colspan="9">';
|
||||
print $projectstatic->getNomUrl(1,'',0,'<strong>'.$langs->transnoentitiesnoconv("YourRole").':</strong> '.$projectsrole[$lines[$i]->fk_project]);
|
||||
if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1);
|
||||
if ($projectstatic->title)
|
||||
{
|
||||
print ' - ';
|
||||
@ -916,14 +917,14 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
||||
*/
|
||||
|
||||
// Project
|
||||
print "<td>";
|
||||
/*print "<td>";
|
||||
if ($oldprojectforbreak == -1) print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||
print "</td>";
|
||||
print "</td>";*/
|
||||
|
||||
// Thirdparty
|
||||
print '<td class="tdoverflowmax100">';
|
||||
/*print '<td class="tdoverflowmax100">';
|
||||
if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project', 10);
|
||||
print '</td>';
|
||||
print '</td>';*/
|
||||
|
||||
// Ref
|
||||
print '<td>';
|
||||
@ -1176,8 +1177,9 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id))
|
||||
{
|
||||
print '<tr class="oddeven trforbreak">'."\n";
|
||||
print '<td colspan="15">';
|
||||
print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||
print '<td colspan="13">';
|
||||
print $projectstatic->getNomUrl(1,'',0,'<strong>'.$langs->transnoentitiesnoconv("YourRole").':</strong> '.$projectsrole[$lines[$i]->fk_project]);
|
||||
if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1);
|
||||
if ($projectstatic->title)
|
||||
{
|
||||
print ' - ';
|
||||
@ -1199,14 +1201,14 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
*/
|
||||
|
||||
// Project
|
||||
print '<td class="nowrap">';
|
||||
/*print '<td class="nowrap">';
|
||||
if ($oldprojectforbreak == -1) print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||
print "</td>";
|
||||
print "</td>";*/
|
||||
|
||||
// Thirdparty
|
||||
print '<td class="tdoverflowmax100">';
|
||||
/*print '<td class="tdoverflowmax100">';
|
||||
if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project');
|
||||
print '</td>';
|
||||
print '</td>';*/
|
||||
|
||||
// Ref
|
||||
print '<td class="nowrap">';
|
||||
|
||||
@ -57,4 +57,5 @@ ErrorInsertingComment=There was an error while inserting your comment
|
||||
MoreChoices=Enter more choices for the voters
|
||||
SurveyExpiredInfo=The poll has been closed or voting delay has expired.
|
||||
EmailSomeoneVoted=%s has filled a line.\nYou can find your poll at the link: \n%s
|
||||
ShowSurvey=Show survey
|
||||
ShowSurvey=Show survey
|
||||
UserMustBeSameThanUserUsedToVote=You must have voted and use the same user name, that the one used to vote, to post a comment
|
||||
@ -357,6 +357,7 @@ $param.=($search_task_label?'&search_task_label='.$search_task_label:'');
|
||||
|
||||
// Show navigation bar
|
||||
$nav ='<a class="inline-block valignmiddle" href="?year='.$prev_year."&month=".$prev_month."&day=".$prev_day.$param.'">'.img_previous($langs->trans("Previous"))."</a>\n";
|
||||
$nav.=dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"%A").' ';
|
||||
$nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"day")." </span>\n";
|
||||
$nav.='<a class="inline-block valignmiddle" href="?year='.$next_year."&month=".$next_month."&day=".$next_day.$param.'">'.img_next($langs->trans("Next"))."</a>\n";
|
||||
$nav.=" (<a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
|
||||
@ -409,7 +410,7 @@ print '<div class="taskiddiv inline-block">';
|
||||
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1);
|
||||
print '</div>';
|
||||
print ' ';
|
||||
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth200');
|
||||
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone');
|
||||
print '<input type="submit" class="button valignmiddle" name="assigntask" value="'.dol_escape_htmltag($titleassigntask).'">';
|
||||
print '</div>';
|
||||
|
||||
@ -433,9 +434,22 @@ $moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.='<div class="inline-block hideonsmartphone">'.$langs->trans('User'). ' </div>';
|
||||
$includeonly='hierachyme';
|
||||
if (empty($user->rights->user->user->lire)) $includeonly=array($user->id);
|
||||
$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200 marginleftonly');
|
||||
$moreforfilter.='</div>';
|
||||
|
||||
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT))
|
||||
{
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.='<div class="inline-block">'.$langs->trans('Project'). ' </div>';
|
||||
$moreforfilter.='<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">';
|
||||
$moreforfilter.='</div>';
|
||||
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.='<div class="inline-block">'.$langs->trans('ThirdParty'). ' </div>';
|
||||
$moreforfilter.='<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">';
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
|
||||
if (! empty($moreforfilter))
|
||||
{
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
@ -451,9 +465,8 @@ print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'" id="tablelines3">'."\n";
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" size="4" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" size="4" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).'"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" size="4" name="search_task_ref" value="'.dol_escape_htmltag($search_task_ref).'"></td>';
|
||||
if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print '<td class="liste_titre"><input type="text" size="4" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
|
||||
if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print '<td class="liste_titre"><input type="text" size="4" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" size="4" name="search_task_label" value="'.dol_escape_htmltag($search_task_label).'"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
@ -470,9 +483,8 @@ print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Project").'</td>';
|
||||
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
||||
//print '<td>'.$langs->trans("RefTask").'</td>';
|
||||
if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print '<td>'.$langs->trans("Project").'</td>';
|
||||
if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print '<td>'.$langs->trans("ThirdParty").'</td>';
|
||||
print '<td>'.$langs->trans("Task").'</td>';
|
||||
print '<td align="right" class="leftborder plannedworkload maxwidth100">'.$langs->trans("PlannedWorkload").'</td>';
|
||||
print '<td align="right" class="maxwidth100">'.$langs->trans("ProgressDeclared").'</td>';
|
||||
@ -522,7 +534,7 @@ print '<td class="center">'.$langs->trans("Note").'</td>';
|
||||
print '<td class="center"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$colspan = 8;
|
||||
$colspan = 6+(empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:2);;
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
@ -607,13 +619,9 @@ if (count($tasksarray) > 0)
|
||||
if ($isdiff)
|
||||
{
|
||||
print '<tr class="oddeven othertaskwithtime">';
|
||||
print '<td colspan="3">';
|
||||
print '<td colspan="'.($colspan-1).'" class="opacitymedium">';
|
||||
print $langs->trans("OtherFilteredTasks");
|
||||
print '</td>';
|
||||
print '<td align="right" class="leftborder plannedworkload"></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td class="leftborder"></td>';
|
||||
print '<td class="center">';
|
||||
$timeonothertasks=($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]);
|
||||
|
||||
@ -411,7 +411,7 @@ print '<div class="taskiddiv inline-block">';
|
||||
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1);
|
||||
print '</div>';
|
||||
print ' ';
|
||||
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth200');
|
||||
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone');
|
||||
print '<input type="submit" class="button valignmiddle" name="assigntask" value="'.dol_escape_htmltag($titleassigntask).'">';
|
||||
print '</div>';
|
||||
|
||||
@ -471,6 +471,19 @@ if (empty($user->rights->user->user->lire)) $includeonly=array($user->id);
|
||||
$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200');
|
||||
$moreforfilter.='</div>';
|
||||
|
||||
if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT))
|
||||
{
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.='<div class="inline-block">'.$langs->trans('Project'). ' </div>';
|
||||
$moreforfilter.='<input type="text" size="4" name="search_project_ref" class="marginleftonly" value="'.dol_escape_htmltag($search_project_ref).'">';
|
||||
$moreforfilter.='</div>';
|
||||
|
||||
$moreforfilter.='<div class="divsearchfield">';
|
||||
$moreforfilter.='<div class="inline-block">'.$langs->trans('ThirdParty'). ' </div>';
|
||||
$moreforfilter.='<input type="text" size="4" name="search_thirdparty" class="marginleftonly" value="'.dol_escape_htmltag($search_thirdparty).'">';
|
||||
$moreforfilter.='</div>';
|
||||
}
|
||||
|
||||
if (! empty($moreforfilter))
|
||||
{
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
@ -485,9 +498,8 @@ print '<div class="div-table-responsive">';
|
||||
print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'" id="tablelines3">'."\n";
|
||||
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"><input type="text" size="4" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" size="4" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).'"></td>';
|
||||
//print '<td class="liste_titre"><input type="text" size="4" name="search_task_ref" value="'.dol_escape_htmltag($search_task_ref).'"></td>';
|
||||
if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print '<td class="liste_titre"><input type="text" size="4" name="search_project_ref" value="'.dol_escape_htmltag($search_project_ref).'"></td>';
|
||||
if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print '<td class="liste_titre"><input type="text" size="4" name="search_thirdparty" value="'.dol_escape_htmltag($search_thirdparty).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" size="4" name="search_task_label" value="'.dol_escape_htmltag($search_task_label).'"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
print '<td class="liste_titre"></td>';
|
||||
@ -505,9 +517,8 @@ print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Project").'</td>';
|
||||
print '<td>'.$langs->trans("ThirdParty").'</td>';
|
||||
//print '<td>'.$langs->trans("RefTask").'</td>';
|
||||
if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print '<td>'.$langs->trans("Project").'</td>';
|
||||
if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print '<td>'.$langs->trans("ThirdParty").'</td>';
|
||||
print '<td>'.$langs->trans("Task").'</td>';
|
||||
print '<td align="right" class="leftborder plannedworkload maxwidth75">'.$langs->trans("PlannedWorkload").'</td>';
|
||||
print '<td align="right" class="maxwidth75">'.$langs->trans("ProgressDeclared").'</td>';
|
||||
@ -540,7 +551,7 @@ for ($idw=0; $idw<7; $idw++)
|
||||
print '<td></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$colspan=7;
|
||||
$colspan=5+(empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:2);
|
||||
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
@ -634,7 +645,7 @@ if (count($tasksarray) > 0)
|
||||
if ($isdiff)
|
||||
{
|
||||
print '<tr class="oddeven othertaskwithtime">';
|
||||
print '<td colspan="'.$colspan.'">';
|
||||
print '<td colspan="'.$colspan.'" class="opacitymedium">';
|
||||
print $langs->trans("OtherFilteredTasks");
|
||||
print '</td>';
|
||||
for ($idw = 0; $idw < 7; $idw++)
|
||||
|
||||
@ -464,16 +464,16 @@ else if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
if ($object->public || $userWrite > 0)
|
||||
{
|
||||
$linktocreatetask = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">'.$langs->trans('AddTask').'</a>';
|
||||
$linktocreatetask = '<a class="butActionNew" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=create'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">'.$langs->trans('AddTask').'<span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktocreatetask = '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('AddTask').'</a>';
|
||||
$linktocreatetask = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('AddTask').'<span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktocreatetask = '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTask').'</a>';
|
||||
$linktocreatetask = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTask').'<span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -420,16 +420,16 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
{
|
||||
if ($projectstatic->public || $userWrite > 0)
|
||||
{
|
||||
$linktocreatetime = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?withproject=1'.($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">'.$langs->trans('AddTimeSpent').'</a>';
|
||||
$linktocreatetime = '<a class="butActionNew" href="'.$_SERVER['PHP_SELF'].'?withproject=1'.($object->id > 0 ? '&id='.$object->id : '&projectid='.$projectstatic->id).'&action=createtime'.$param.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$object->id).'">'.$langs->trans('AddTimeSpent').'<span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktocreatetime = '<a class="butActionRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('AddTime').'</a>';
|
||||
$linktocreatetime = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotOwnerOfProject").'">'.$langs->trans('AddTime').'<span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$linktocreatetime = '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTime').'</a>';
|
||||
$linktocreatetime = '<a class="butActionNewRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('AddTime').'<span class="fa fa-plus-circle valignmiddle"></span></a>';
|
||||
}
|
||||
//}
|
||||
}
|
||||
@ -949,7 +949,11 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
print '<td class="nowrap">';
|
||||
if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
|
||||
{
|
||||
print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1);
|
||||
if (empty($task_time->task_date_withhour))
|
||||
{
|
||||
print $form->select_date(($date2?$date2:$date1),'timeline',3,3,2,"timespent_date",1,0,1);
|
||||
}
|
||||
else print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1086,7 +1090,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Action column
|
||||
print '<td class="center"">';
|
||||
print '<td class="center nowraponall">';
|
||||
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid)
|
||||
{
|
||||
print '<input type="hidden" name="lineid" value="'.$_GET['lineid'].'">';
|
||||
|
||||
@ -66,22 +66,28 @@ if (GETPOST('ajoutcomment','alpha'))
|
||||
|
||||
$error=0;
|
||||
|
||||
if (! GETPOST('comment','none'))
|
||||
$comment = GETPOST("comment",'none');
|
||||
$comment_user = GETPOST('commentuser','nohtml');
|
||||
|
||||
if (! $comment)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors');
|
||||
}
|
||||
if (! GETPOST('commentuser','nohtml'))
|
||||
if (! $comment_user)
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), null, 'errors');
|
||||
}
|
||||
|
||||
if (! in_array($comment_user, $listofvoters))
|
||||
{
|
||||
setEventMessages($langs->trans("UserMustBeSameThanUserUsedToVote"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
$comment = GETPOST("comment",'none');
|
||||
$comment_user = GETPOST('commentuser','nohtml');
|
||||
|
||||
$resql = $object->addComment($comment, $comment_user);
|
||||
|
||||
if (! $resql) dol_print_error($db);
|
||||
@ -729,8 +735,12 @@ if ($comments)
|
||||
print "<br><b>" . $langs->trans("CommentsOfVoters") . ":</b><br>\n";
|
||||
|
||||
foreach ($comments as $obj) {
|
||||
// ligne d'un usager pré-authentifié
|
||||
//$mod_ok = (in_array($obj->name, $listofvoters));
|
||||
|
||||
print '<div class="comment"><span class="usercomment">';
|
||||
if (in_array($obj->usercomment, $listofvoters)) print '<a href="'.$_SERVER["PHP_SELF"].'?deletecomment='.$obj->id_comment.'&sondage='.$numsondage.'"> '.img_picto('', 'delete.png').'</a> ';
|
||||
if (in_array($obj->usercomment, $listofvoters)) print '<a href="'.$_SERVER["PHP_SELF"].'?deletecomment='.$obj->id_comment.'&sondage='.$numsondage.'"> '.img_picto('', 'delete.png', '', false, 0, 0, '', 'nomarginleft').'</a> ';
|
||||
//else print img_picto('', 'ellipsis-h', '', false, 0, 0, '', 'nomarginleft').' ';
|
||||
print dol_htmlentities($obj->usercomment).':</span> <span class="comment">'.dol_nl2br(dol_htmlentities($obj->comment))."</span></div>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -722,6 +722,9 @@ select.flat.selectlimit {
|
||||
.marginleftonly {
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
.nomarginleft {
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
.selectlimit, .selectlimit:focus {
|
||||
border-left: none !important;
|
||||
border-top: none !important;
|
||||
|
||||
@ -716,6 +716,9 @@ select.flat.selectlimit {
|
||||
.marginleftonly {
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
.nomarginleft {
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
.selectlimit, .selectlimit:focus {
|
||||
border-left: none !important;
|
||||
border-top: none !important;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user