Fixing style errors.

This commit is contained in:
stickler-ci 2020-12-11 16:44:38 +00:00
parent 79b0f08a8d
commit 5d86a5bd2a
2 changed files with 11 additions and 13 deletions

View File

@ -760,7 +760,7 @@ class FormCompany extends Form
* @param int $output 0=return HTML, 1= direct print * @param int $output 0=return HTML, 1= direct print
* @return void * @return void
*/ */
public function selectTypeContact($object, $selected, $htmlname = 'type', $source = 'internal', $sortorder = 'position', $showempty = 0, $morecss = '', $output=1) public function selectTypeContact($object, $selected, $htmlname = 'type', $source = 'internal', $sortorder = 'position', $showempty = 0, $morecss = '', $output = 1)
{ {
global $user, $langs; global $user, $langs;
$out = ''; $out = '';

View File

@ -78,17 +78,17 @@ if ($action == 'addcontact_confirm' && $user->rights->projet->creer)
} }
} }
$affecttotask=GETPOST('tasksavailable','intcomma'); $affecttotask=GETPOST('tasksavailable', 'intcomma');
if (!empty($affecttotask)) { if (!empty($affecttotask)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
$task_to_affect = explode(',',$affecttotask); $task_to_affect = explode(',', $affecttotask);
if (!empty($task_to_affect)) { if (!empty($task_to_affect)) {
foreach($task_to_affect as $task_id) { foreach ($task_to_affect as $task_id) {
if (GETPOSTISSET('person_'.$task_id,'san_alpha') && GETPOST('person_'.$task_id,'san_alpha')=='on') { if (GETPOSTISSET('person_'.$task_id, 'san_alpha') && GETPOST('person_'.$task_id, 'san_alpha')=='on') {
$tasksToAffect = new Task($db); $tasksToAffect = new Task($db);
$result=$tasksToAffect->fetch($task_id); $result=$tasksToAffect->fetch($task_id);
if ($result < 0) { if ($result < 0) {
setEventMessage($tasksToAffect->error,'errors'); setEventMessage($tasksToAffect->error, 'errors');
} else { } else {
$result = $tasksToAffect->add_contact($contactid, GETPOST('person_role_'.$task_id), GETPOST("source", 'aZ09')); $result = $tasksToAffect->add_contact($contactid, GETPOST('person_role_'.$task_id), GETPOST("source", 'aZ09'));
if ($result < 0) { if ($result < 0) {
@ -177,7 +177,6 @@ if ($id > 0 || !empty($ref))
// Test if we can add contact to task at the same times // Test if we can add contact to task at the same times
if ($action == 'addcontact') { if ($action == 'addcontact') {
$source=GETPOST("source", 'aZ09'); $source=GETPOST("source", 'aZ09');
$taskstatic = new Task($db); $taskstatic = new Task($db);
@ -191,18 +190,17 @@ if ($id > 0 || !empty($ref))
$url_redirect='?id='.$object->id.'&'.$affect_to.'&'.$type_to.'&source='.$source; $url_redirect='?id='.$object->id.'&'.$affect_to.'&'.$type_to.'&source='.$source;
if (empty($conf->global->PROJECT_HIDE_TASKS) || $nbTasks > 0) { if (empty($conf->global->PROJECT_HIDE_TASKS) || $nbTasks > 0) {
$text = $langs->trans('AddPersonToTask'); $text = $langs->trans('AddPersonToTask');
$formquestion = array('text' => $text); $formquestion = array('text' => $text);
$task_to_affect = array(); $task_to_affect = array();
foreach($task_array as $task) { foreach ($task_array as $task) {
$task_already_affected=false; $task_already_affected=false;
$personsLinked = $task->liste_contact(-1, $source); $personsLinked = $task->liste_contact(-1, $source);
if (!is_array($personsLinked) && coun($personsLinked) < 0) { if (!is_array($personsLinked) && coun($personsLinked) < 0) {
setEventMessage($object->error,'errors'); setEventMessage($object->error, 'errors');
} else { } else {
foreach($personsLinked as $person) { foreach ($personsLinked as $person) {
if ($person['id']==$personToAffect) { if ($person['id']==$personToAffect) {
$task_already_affected = true; $task_already_affected = true;
break; break;
@ -218,7 +216,7 @@ if ($id > 0 || !empty($ref))
header("Location: ".$_SERVER['PHP_SELF'].$url_redirect); header("Location: ".$_SERVER['PHP_SELF'].$url_redirect);
exit; exit;
} else { } else {
foreach($task_to_affect as $key=>$val) { foreach ($task_to_affect as $key=>$val) {
$formquestion[] = array('type' => 'checkbox', 'name' => 'person_'.$key, 'label' => $val, 'value' => true); $formquestion[] = array('type' => 'checkbox', 'name' => 'person_'.$key, 'label' => $val, 'value' => true);
$formquestion[] = array( $formquestion[] = array(
'type' => 'other', 'type' => 'other',
@ -226,7 +224,7 @@ if ($id > 0 || !empty($ref))
'label' => $langs->trans("ContactType"), 'label' => $langs->trans("ContactType"),
'value' => $formcompany->selectTypeContact($taskstatic, '', 'person_role_' . $key, $source, 'position', 0, 'minwidth100imp', 0)); 'value' => $formcompany->selectTypeContact($taskstatic, '', 'person_role_' . $key, $source, 'position', 0, 'minwidth100imp', 0));
} }
$formquestion[] = array('type'=> 'other', 'name'=>'tasksavailable', 'label'=>'', 'value' => '<input type="hidden" id="tasksavailable" name="tasksavailable" value="'.implode(',',array_keys($task_to_affect)).'">'); $formquestion[] = array('type'=> 'other', 'name'=>'tasksavailable', 'label'=>'', 'value' => '<input type="hidden" id="tasksavailable" name="tasksavailable" value="'.implode(',', array_keys($task_to_affect)).'">');
} }
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . $url_redirect, $text, '', 'addcontact_confirm', $formquestion, '', 1, 300, 590); $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . $url_redirect, $text, '', 'addcontact_confirm', $formquestion, '', 1, 300, 590);