Fix look and feel v13
This commit is contained in:
parent
e7d24796f1
commit
8491be2572
@ -620,15 +620,17 @@ class FormOther
|
||||
if ($i > 0) print '<option value="0" disabled>----------</option>';
|
||||
print '<option value="'.$lines[$i]->fk_project.'_0"';
|
||||
if ($selectedproject == $lines[$i]->fk_project) print ' selected';
|
||||
print '>'; // Project -> Task
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
if (empty($lines[$i]->public))
|
||||
{
|
||||
print ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')';
|
||||
|
||||
$labeltoshow = $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
if (empty($lines[$i]->public)) {
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')</span>';
|
||||
} else {
|
||||
print ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')';
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')</span>';
|
||||
}
|
||||
//print '-'.$parent.'-'.$lines[$i]->fk_project.'-'.$lastprojectid;
|
||||
|
||||
print ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
|
||||
print '>'; // Project -> Task
|
||||
print $labeltoshow;
|
||||
print "</option>\n";
|
||||
|
||||
$lastprojectid = $lines[$i]->fk_project;
|
||||
@ -652,21 +654,26 @@ class FormOther
|
||||
print '<option value="'.$lines[$i]->fk_project.'_'.$lines[$i]->id.'"';
|
||||
if (($lines[$i]->id == $selectedtask) || ($lines[$i]->fk_project.'_'.$lines[$i]->id == $selectedtask)) print ' selected';
|
||||
if ($disabled) print ' disabled';
|
||||
print '>';
|
||||
print $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
print ' '.$lines[$i]->projectlabel;
|
||||
|
||||
$labeltoshow = $langs->trans("Project").' '.$lines[$i]->projectref;
|
||||
$labeltoshow .= ' '.$lines[$i]->projectlabel;
|
||||
if (empty($lines[$i]->public))
|
||||
{
|
||||
print ' ('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')';
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("PrivateProject").')</span>';
|
||||
} else {
|
||||
print ' ('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')';
|
||||
$labeltoshow .= ' <span class="opacitymedium">('.$langs->trans("Visibility").': '.$langs->trans("SharedProject").')</span>';
|
||||
}
|
||||
if ($lines[$i]->id) print ' > ';
|
||||
if ($lines[$i]->id) $labeltoshow .= ' > ';
|
||||
for ($k = 0; $k < $level; $k++)
|
||||
{
|
||||
print " ";
|
||||
$labeltoshow .= " ";
|
||||
}
|
||||
print $lines[$i]->ref.' '.$lines[$i]->label."</option>\n";
|
||||
$labeltoshow .= $lines[$i]->ref.' '.$lines[$i]->label;
|
||||
|
||||
print ' data-html="'.dol_escape_htmltag($labeltoshow).'"';
|
||||
print '>';
|
||||
print $labeltoshow;
|
||||
print "</option>\n";
|
||||
$inc++;
|
||||
}
|
||||
|
||||
|
||||
@ -492,121 +492,119 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
|
||||
print load_fiche_titre($langs->trans("NewTask"), '', 'projecttask');
|
||||
|
||||
if ($object->statut == Project::STATUS_CLOSED) {
|
||||
if ($object->id > 0 && $object->statut == Project::STATUS_CLOSED) {
|
||||
print '<div class="warning">';
|
||||
$langs->load("errors");
|
||||
print $langs->trans("WarningProjectClosed");
|
||||
print '</div>';
|
||||
} else {
|
||||
if ($object->statut == Project::STATUS_DRAFT)
|
||||
{
|
||||
print '<div class="warning">';
|
||||
$langs->load("errors");
|
||||
print $langs->trans("WarningProjectDraft");
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.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.'">';
|
||||
|
||||
print dol_get_fiche_head('');
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
$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($object->thirdparty, null);
|
||||
}
|
||||
|
||||
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref = '';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td>';
|
||||
if (empty($duplicate_code_error))
|
||||
{
|
||||
print (GETPOSTISSET("ref") ?GETPOST("ref", 'alpha') : $defaultref);
|
||||
} else {
|
||||
print $defaultref;
|
||||
}
|
||||
print '<input type="hidden" name="taskref" value="'.($_POST["ref"] ? $_POST["ref"] : $defaultref).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>';
|
||||
print '<input type="text" name="label" autofocus class="minwidth500 maxwidthonsmartphone" value="'.$label.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// List of projects
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("ChildOfProjectTask").'</td><td>';
|
||||
print $formother->selectProjectTasks(GETPOST('task_parent'), $projectid ? $projectid : $object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("AffectedTo").'</td><td>';
|
||||
$contactsofproject = (!empty($object->id) ? $object->getListContactId('internal') : '');
|
||||
if (is_array($contactsofproject) && count($contactsofproject))
|
||||
{
|
||||
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
} else {
|
||||
print $langs->trans("NoUserAssignedToTheProject");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||
print $form->selectDate(($date_start ? $date_start : ''), 'dateo', 1, 1, 0, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
|
||||
print $form->selectDate(($date_end ? $date_end : -1), 'datee', -1, 1, 0, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Planned workload
|
||||
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
|
||||
print $form->select_duration('planned_workload', $planned_workload ? $planned_workload : 0, 0, 'text');
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress
|
||||
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
|
||||
print $formother->select_percent($progress, 'progress', 0, 5, 0, 100, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
|
||||
print '<td>';
|
||||
print '<textarea name="description" class="quatrevingtpercent" rows="'.ROWS_4.'">'.$description.'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Other options
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $taskstatic, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
if (empty($reshook) && !empty($extrafields->attributes[$taskstatic->table_element]['label']))
|
||||
{
|
||||
print $taskstatic->showOptionals($extrafields, 'edit'); // Do not use $object here that is object of project but use $taskstatic
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
} elseif ($id > 0 || !empty($ref))
|
||||
{
|
||||
|
||||
if ($object->id > 0 && $object->statut == Project::STATUS_DRAFT) {
|
||||
print '<div class="warning">';
|
||||
$langs->load("errors");
|
||||
print $langs->trans("WarningProjectDraft");
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.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.'">';
|
||||
|
||||
print dol_get_fiche_head('');
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
$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($object->thirdparty, null);
|
||||
}
|
||||
|
||||
if (is_numeric($defaultref) && $defaultref <= 0) $defaultref = '';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td>';
|
||||
if (empty($duplicate_code_error))
|
||||
{
|
||||
print (GETPOSTISSET("ref") ?GETPOST("ref", 'alpha') : $defaultref);
|
||||
} else {
|
||||
print $defaultref;
|
||||
}
|
||||
print '<input type="hidden" name="taskref" value="'.($_POST["ref"] ? $_POST["ref"] : $defaultref).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>';
|
||||
print '<input type="text" name="label" autofocus class="minwidth500 maxwidthonsmartphone" value="'.$label.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// List of projects
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("ChildOfProjectTask").'</td><td>';
|
||||
print $formother->selectProjectTasks(GETPOST('task_parent'), $projectid ? $projectid : $object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500');
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("AffectedTo").'</td><td>';
|
||||
$contactsofproject = (!empty($object->id) ? $object->getListContactId('internal') : '');
|
||||
if (is_array($contactsofproject) && count($contactsofproject))
|
||||
{
|
||||
print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
} else {
|
||||
print $langs->trans("NoUserAssignedToTheProject");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||
print $form->selectDate(($date_start ? $date_start : ''), 'dateo', 1, 1, 0, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
|
||||
print $form->selectDate(($date_end ? $date_end : -1), 'datee', -1, 1, 0, '', 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Planned workload
|
||||
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
|
||||
print $form->select_duration('planned_workload', $planned_workload ? $planned_workload : 0, 0, 'text');
|
||||
print '</td></tr>';
|
||||
|
||||
// Progress
|
||||
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
|
||||
print $formother->select_percent($progress, 'progress', 0, 5, 0, 100, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Description
|
||||
print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>';
|
||||
print '<td>';
|
||||
print '<textarea name="description" class="quatrevingtpercent" rows="'.ROWS_4.'">'.$description.'</textarea>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Other options
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $taskstatic, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
if (empty($reshook) && !empty($extrafields->attributes[$taskstatic->table_element]['label']))
|
||||
{
|
||||
print $taskstatic->showOptionals($extrafields, 'edit'); // Do not use $object here that is object of project but use $taskstatic
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="add" value="'.$langs->trans("Add").'">';
|
||||
print ' ';
|
||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
} elseif ($id > 0 || !empty($ref)) {
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user