From eeff8fdc0d89e20bb8102fde2537644a787b5145 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Jun 2022 02:10:27 +0200 Subject: [PATCH] Debug v16 --- htdocs/core/class/html.formcontract.class.php | 2 +- htdocs/fichinter/card.php | 8 ++--- .../install/mysql/migration/15.0.0-16.0.0.sql | 3 ++ .../mysql/tables/llx_projet_task_time.sql | 2 ++ .../modulebuilder/template/myobject_list.php | 3 +- htdocs/projet/tasks/time.php | 34 +++++++++++-------- .../class/recruitmentcandidature.class.php | 4 +-- .../recruitmentcandidature_list.php | 10 +++--- 8 files changed, 36 insertions(+), 30 deletions(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index f3798181bcd..6267c6ff390 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -188,7 +188,7 @@ class FormContract print ''; print ''; $this->select_contract($socid, $selected, $htmlname, $maxlength, $showempty, $showRef); - print ''; + print ''; print ''; } } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 09411f29d50..fd07a30f648 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1062,9 +1062,7 @@ if ($action == 'create') { print ''; } } elseif ($id > 0 || !empty($ref)) { - /* - * Affichage en mode visu - */ + // View mode $object->fetch($id, $ref); $object->fetch_thirdparty(); @@ -1201,7 +1199,7 @@ if ($action == 'create') { print '
'; print '
'; - print ''; + print '
'; if (!empty($conf->global->FICHINTER_USE_PLANNED_AND_DONE_DATES)) { // Date Start @@ -1230,7 +1228,7 @@ if ($action == 'create') { print ''; print ''; diff --git a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql index d23631c6fe7..2d8b0a8cc17 100644 --- a/htdocs/install/mysql/migration/15.0.0-16.0.0.sql +++ b/htdocs/install/mysql/migration/15.0.0-16.0.0.sql @@ -136,6 +136,9 @@ ALTER TABLE llx_bank ADD COLUMN amount_main_currency double(24,8) NULL; -- v16 +ALTER TABLE llx_projet_task_time ADD COLUMN intervention_id integer DEFAULT NULL; +ALTER TABLE llx_projet_task_time ADD COLUMN intervention_line_id integer DEFAULT NULL; + ALTER TABLE llx_c_stcomm MODIFY COLUMN code VARCHAR(24) NOT NULL; ALTER TABLE llx_societe_account DROP FOREIGN KEY llx_societe_account_fk_website; diff --git a/htdocs/install/mysql/tables/llx_projet_task_time.sql b/htdocs/install/mysql/tables/llx_projet_task_time.sql index 63eadb1177f..e91e50b5721 100644 --- a/htdocs/install/mysql/tables/llx_projet_task_time.sql +++ b/htdocs/install/mysql/tables/llx_projet_task_time.sql @@ -29,6 +29,8 @@ create table llx_projet_task_time thm double(24,8), invoice_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice id here invoice_line_id integer DEFAULT NULL, -- If we need to invoice each line of timespent, we can save invoice line id here + intervention_id integer DEFAULT NULL, -- If we need to have an intervention line for each line of timespent, we can save intervention id here + intervention_line_id integer DEFAULT NULL, -- If we need to have an intervention line of timespent line, we can save intervention line id here import_key varchar(14), -- Import key datec datetime, -- date creation time tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 22ce7e61e7f..14fd3a52171 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -334,7 +334,6 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql .= $db->order($sortfield, $sortorder); /* If a group by is required $sql .= " GROUP BY "; @@ -564,7 +563,7 @@ if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { } foreach ($object->fields as $key => $val) { $searchkey = empty($search[$key]) ? '' : $search[$key]; - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index d0db633658a..ab93e3561b0 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -258,8 +258,8 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us $object->fetch($id_temp, $ref); - $object->timespent_note = GETPOST("timespent_note_line", 'alpha'); - $object->timespent_old_duration = GETPOST("old_duration"); + $object->timespent_note = GETPOST("timespent_note_line", "alphanohtml"); + $object->timespent_old_duration = GETPOST("old_duration", "int"); $object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds $object->timespent_duration += (GETPOSTINT("new_durationmin") ? GETPOSTINT('new_durationmin') : 0) * 60; // We store duration in seconds if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0) { // If hour was entered @@ -285,8 +285,8 @@ if (($action == 'updateline' || $action == 'updatesplitline') && !$cancel && $us $object->fetch($id, $ref); $object->timespent_id = GETPOST("lineid", 'int'); - $object->timespent_note = GETPOST("timespent_note_line"); - $object->timespent_old_duration = GETPOST("old_duration"); + $object->timespent_note = GETPOST("timespent_note_line", "alphanohtml"); + $object->timespent_old_duration = GETPOST("old_duration", "int"); $object->timespent_duration = GETPOSTINT("new_durationhour") * 60 * 60; // We store duration in seconds $object->timespent_duration += (GETPOSTINT("new_durationmin") ? GETPOSTINT('new_durationmin') : 0) * 60; // We store duration in seconds if (GETPOST("timelinehour") != '' && GETPOST("timelinehour") >= 0) { // If hour was entered @@ -1255,10 +1255,11 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; if ($projectstatic->thirdparty->id > 0) { + print '
'; print '
'; print $form->editfieldkey("Description", 'description', $object->description, $object, $user->rights->ficheinter->creer, 'textarea'); print ''; - print $form->editfieldval("Description", 'description', $object->description, $object, $user->rights->ficheinter->creer, 'textarea:8:80'); + print $form->editfieldval("Description", 'description', $object->description, $object, $user->rights->ficheinter->creer, 'textarea:8'); print '
'; print ''; print ''; print ''; print '
'; - print $langs->trans('InterToUse'); + print img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterToUse'); print ''; $forminter = new FormIntervention($db); @@ -1267,7 +1268,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print '
'; - print '
'; print '
'; print ' '; print ''; @@ -1782,7 +1782,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (!empty($arrayfields['t.note']['checked'])) { print ''; if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { - print ''; + print ''; } else { print dol_nl2br($task_time->note); } @@ -1791,7 +1791,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $totalarray['nbfield']++; } } elseif ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { - print ''; + print ''; } // Time spent @@ -1820,9 +1820,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Value spent if (!empty($arrayfields['value']['checked'])) { $langs->load("salaries"); + $value = price2num($task_time->thm * $task_time->task_duration / 3600, 'MT', 1); print ''; - $value = price2num($task_time->thm * $task_time->task_duration / 3600, 'MT', 1); print 'thm).'">'; print price($value, 1, $langs, 1, -1, -1, $conf->currency); print ''; @@ -1884,7 +1884,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { print ' '; - print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; + print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; print img_split('', 'class="pictofixedwidth"'); print ''; } @@ -1996,13 +1996,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (!empty($arrayfields['t.note']['checked'])) { print ''; if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) { - print ''; + print ''; } else { print dol_nl2br($task_time->note); } print ''; } elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) { - print ''; + print ''; } // Time spent @@ -2020,8 +2020,10 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Value spent if (!empty($arrayfields['value']['checked'])) { print ''; + print ''; $value = price2num($task_time->thm * $task_time->task_duration / 3600, 'MT', 1); print price($value, 1, $langs, 1, -1, -1, $conf->currency); + print ''; print ''; } @@ -2132,13 +2134,13 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if (!empty($arrayfields['t.note']['checked'])) { print ''; if ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) { - print ''; + print ''; } else { print dol_nl2br($task_time->note); } print ''; } elseif ($action == 'splitline' && $_GET['lineid'] == $task_time->rowid) { - print ''; + print ''; } // Time spent @@ -2156,8 +2158,10 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Value spent if (!empty($arrayfields['value']['checked'])) { print ''; + print ''; $value = 0; print price($value, 1, $langs, 1, -1, -1, $conf->currency); + print ''; print ''; } @@ -2166,7 +2170,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; $valuebilled = price2num($task_time->total_ht, '', 1); if (isset($task_time->total_ht)) { + print ''; print price($valuebilled, 1, $langs, 1, -1, -1, $conf->currency); + print ''; } print ''; } diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 1b4074a6798..1561d0a72ab 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -111,7 +111,7 @@ class RecruitmentCandidature extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of candidature"), - 'fk_recruitmentjobposition' => array('type'=>'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'picto'=>'recruitmentjobposition', 'css'=>'maxwidth500', 'csslist'=>'minwidth125'), + 'fk_recruitmentjobposition' => array('type'=>'integer:RecruitmentJobPosition:recruitment/class/recruitmentjobposition.class.php', 'label'=>'Job', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'picto'=>'recruitmentjobposition', 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'csslist'=>'minwidth125 tdoverflowmax200'), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>0,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), @@ -121,7 +121,7 @@ class RecruitmentCandidature extends CommonObject 'lastname' => array('type'=>'varchar(128)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>20, 'notnull'=>0, 'visible'=>1,), 'firstname' => array('type'=>'varchar(128)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>21, 'notnull'=>0, 'visible'=>1,), 'email' => array('type'=>'email', 'label'=>'EMail', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'picto'=>'email', 'csslist'=>'tdoverflowmax200'), - 'phone' => array('type'=>'phone', 'label'=>'Phone', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'picto'=>'phone'), + 'phone' => array('type'=>'phone', 'label'=>'Phone', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'picto'=>'phone', 'csslist'=>'tdoverflowmax150'), 'date_birth' => array('type'=>'date', 'label'=>'DateOfBirth', 'enabled'=>'1', 'position'=>70, 'visible'=>-1,), 'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'), //'fk_recruitment_origin' => array('type'=>'integer:CRecruitmentOrigin:recruitment/class/crecruitmentorigin.class.php', 'label'=>'Origin', 'enabled'=>'1', 'position'=>45, 'visible'=>1, 'index'=>1), diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 3f537003fb7..8e3ea982193 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -104,7 +104,7 @@ if (!$sortorder) { } // Initialize array of search criterias -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { @@ -149,8 +149,6 @@ if ($id > 0 || !empty($ref)) { $id = $jobposition->id; } -//include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. - $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); @@ -229,7 +227,7 @@ $now = dol_now(); //$help_url="EN:Module_RecruitmentCandidature|FR:Module_RecruitmentCandidature_FR|ES:Módulo_RecruitmentCandidature"; $help_url = ''; -$title = $langs->trans('ListOfCandidatures'); +$title = $langs->trans('RecruitmentCandidatures'); $morejs = array(); $morecss = array(); @@ -370,7 +368,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ // Output page // -------------------------------------------------------------------- -llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', ''); +llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Part to show record @@ -637,7 +635,7 @@ if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) { } foreach ($object->fields as $key => $val) { $searchkey = empty($search[$key]) ? '' : $search[$key]; - $cssforfield = (empty($val['css']) ? '' : $val['css']); + $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { $cssforfield .= ($cssforfield ? ' ' : '').'center'; } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {