Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
03842ca251
@ -668,6 +668,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$arrayoftypes = array(
|
||||
'loadthirdparty' => $langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")),
|
||||
'loadandcreatethirdparty' => $langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")),
|
||||
'loadandcreatecontact' => $langs->trans('LoadContactFromEmailOrCreate', $langs->transnoentities("Email")),
|
||||
'recordjoinpiece' => 'AttachJoinedDocumentsToObject',
|
||||
'recordevent' => 'RecordEvent'
|
||||
);
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2023 Lenin Rivas <lenin.rivas777@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -1929,7 +1930,7 @@ if ($action == 'create') {
|
||||
print '<tr class="field_note_public">';
|
||||
print '<td class="titlefieldcreate tdtop">'.$langs->trans('NotePublic').'</td>';
|
||||
print '<td class="valuefieldcreate">';
|
||||
$note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : null));
|
||||
$note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : (!empty($conf->global->PROPALE_ADDON_NOTE_PUBLIC_DEFAULT) ? $conf->global->PROPALE_ADDON_NOTE_PUBLIC_DEFAULT : null)), 'restricthtml');
|
||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||
print $doleditor->Create(1);
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'cashcontrol'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
$mode = GETPOST('mode', 'alpha'); // for mode view result
|
||||
$id = GETPOST('id', 'int');
|
||||
|
||||
// Load variable for pagination
|
||||
@ -399,10 +399,14 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
$permforcashfence = 1;
|
||||
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permforcashfence);
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permforcashfence);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'cash-register', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
@ -552,81 +556,101 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
// Store properties in $object
|
||||
$object->setVarsFromFetchObj($obj);
|
||||
|
||||
// Show here line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
// show kanban result
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
print '<tr><td colspan="12">';
|
||||
print '<div class="box-flex-container">';
|
||||
}
|
||||
|
||||
if (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif ($key == 'ref') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
}
|
||||
$object->posmodule = $obj->posmodule;
|
||||
$object->cash = $obj->cash;
|
||||
$object->opening = $obj->opening;
|
||||
$object->year_close = $obj->year_close;
|
||||
$object->cheque = $obj->cheque;
|
||||
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
|
||||
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield)) {
|
||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
||||
print $object->getKanbanView('');
|
||||
if ($i == (min($num, $limit) - 1)) {
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
} else {
|
||||
// Show here line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
|
||||
if (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif ($key == 'ref') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
|
||||
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
|
||||
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield)) {
|
||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!isset($totalarray['val'])) {
|
||||
$totalarray['val'] = array();
|
||||
if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
}
|
||||
if (!isset($totalarray['val'])) {
|
||||
$totalarray['val'] = array();
|
||||
}
|
||||
if (!isset($totalarray['val']['t.'.$key])) {
|
||||
$totalarray['val']['t.'.$key] = 0;
|
||||
}
|
||||
$totalarray['val']['t.'.$key] += $object->$key;
|
||||
}
|
||||
if (!isset($totalarray['val']['t.'.$key])) {
|
||||
$totalarray['val']['t.'.$key] = 0;
|
||||
}
|
||||
$totalarray['val']['t.'.$key] += $object->$key;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@ -469,4 +469,36 @@ class CashControl extends CommonObject
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return clicable link of object (with eventually picto)
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '')
|
||||
{
|
||||
global $langs;
|
||||
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
||||
$return .= '<div class="info-box info-box-sm">';
|
||||
$return .= '<span class="info-box-icon bg-infobox-action">';
|
||||
$return .= img_picto('', $this->picto);
|
||||
//var_dump($this->fields['rowid']);exit;
|
||||
$return .= '</span>';
|
||||
$return .= '<div class="info-box-content">';
|
||||
$return .= '<span class="info-box-ref">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1, 1) : $this->ref).'</span>';
|
||||
if (property_exists($this, 'posmodule')) {
|
||||
$return .= '<br><span class="opacitymedium">'.substr($langs->trans("Module/Application"), 0, 12).'</span> : <span class="info-box-label">'.$this->posmodule.'</span>';
|
||||
}
|
||||
if (property_exists($this, 'year_close')) {
|
||||
$return .= '<br><span class="info-box-label opacitymedium" >'.$langs->trans("Year").'</span> : <span>'.$this->year_close.'</span>';
|
||||
}
|
||||
if (method_exists($this, 'getLibStatut')) {
|
||||
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
||||
}
|
||||
$return .= '</div>';
|
||||
$return .= '</div>';
|
||||
$return .= '</div>';
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1708,6 +1708,66 @@ if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday
|
||||
}
|
||||
}
|
||||
|
||||
//if (!$error && $massaction == 'clonetasks' && $user->rights->projet->creer) {
|
||||
if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $confirm == 'yes'))) {
|
||||
$num = 0;
|
||||
|
||||
dol_include_once('/projet/class/task.class.php');
|
||||
|
||||
$origin_task = new Task($db);
|
||||
$clone_task = new Task($db);
|
||||
|
||||
foreach (GETPOST('selected') as $task) {
|
||||
$origin_task->fetch($task, $ref = '', $loadparentdata = 0);
|
||||
|
||||
$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(0, $clone_task);
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$clone_task->fk_project = GETPOST('projectid', 'int');
|
||||
$clone_task->ref = $defaultref;
|
||||
$clone_task->label = $origin_task->label;
|
||||
$clone_task->description = $origin_task->description;
|
||||
$clone_task->planned_workload = $origin_task->planned_workload;
|
||||
$clone_task->fk_task_parent = $origin_task->fk_task_parent;
|
||||
$clone_task->date_c = dol_now();
|
||||
$clone_task->date_start = $origin_task->date_start;
|
||||
$clone_task->date_end = $origin_task->date_end;
|
||||
$clone_task->progress = $origin_task->progress;
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $clone_task);
|
||||
|
||||
$taskid = $clone_task->create($user);
|
||||
|
||||
if ($taskid > 0) {
|
||||
$result = $clone_task->add_contact(GETPOST("userid", 'int'), 'TASKEXECUTIVE', 'internal');
|
||||
$num++;
|
||||
} else {
|
||||
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$langs->load("projects");
|
||||
setEventMessages($langs->trans('NewTaskRefSuggested'), '', 'warnings');
|
||||
$duplicate_code_error = true;
|
||||
} else {
|
||||
setEventMessages($clone_task->error, $clone_task->errors, 'errors');
|
||||
}
|
||||
$action = 'list';
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
setEventMessage($langs->trans('NumberOfTasksCloned', $num));
|
||||
header("Refresh: 1;URL=".DOL_URL_ROOT.'/projet/tasks.php?id=' . GETPOST('projectid', 'int'));
|
||||
}
|
||||
}
|
||||
|
||||
$parameters['toselect'] = (empty($toselect) ? array() : $toselect);
|
||||
$parameters['uploaddir'] = $uploaddir;
|
||||
$parameters['massaction'] = $massaction;
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Grégory Blémand <gregory.blemand@atm-consulting.fr>
|
||||
* Copyright (C) 2023 Lenin Rivas <lenin.rivas777@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -5740,15 +5741,16 @@ abstract class CommonObject
|
||||
*
|
||||
* @param string $fieldname Name of field
|
||||
* @param string $alternatevalue Alternate value to use
|
||||
* @param string $type Type of data
|
||||
* @return string|string[] Default value (can be an array if the GETPOST return an array)
|
||||
**/
|
||||
public function getDefaultCreateValueFor($fieldname, $alternatevalue = null)
|
||||
public function getDefaultCreateValueFor($fieldname, $alternatevalue = null, $type = 'alphanohtml')
|
||||
{
|
||||
global $conf, $_POST;
|
||||
|
||||
// If param here has been posted, we use this value first.
|
||||
if (GETPOSTISSET($fieldname)) {
|
||||
return GETPOST($fieldname, 'alphanohtml', 3);
|
||||
return GETPOST($fieldname, $type, 3);
|
||||
}
|
||||
|
||||
if (isset($alternatevalue)) {
|
||||
|
||||
@ -569,9 +569,10 @@ function project_admin_prepare_head()
|
||||
* @param string $filterprogresscalc filter text
|
||||
* @param string $showbilltime Add the column 'TimeToBill' and 'TimeBilled'
|
||||
* @param array $arrayfields Array with displayed coloumn information
|
||||
* @param array $arrayofselected Array with selected fields
|
||||
* @return int Nb of tasks shown
|
||||
*/
|
||||
function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $filterprogresscalc = '', $showbilltime = 0, $arrayfields = array())
|
||||
function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $filterprogresscalc = '', $showbilltime = 0, $arrayfields = array(), $arrayofselected = array())
|
||||
{
|
||||
global $user, $langs, $conf, $db, $hookmanager;
|
||||
global $projectstatic, $taskstatic, $extrafields;
|
||||
@ -910,6 +911,16 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
// Tick to drag and drop
|
||||
print '<td class="tdlineupdown center"></td>';
|
||||
|
||||
// Action column
|
||||
print '<td class="nowrap" align="center">';
|
||||
$selected = 0;
|
||||
if (in_array($lines[$i]->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb' . $lines[$i]->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $lines[$i]->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
|
||||
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
if (!$showlineingray) {
|
||||
|
||||
@ -40,6 +40,18 @@ if ($massaction == 'predelete') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassDeletion"), $langs->trans("ConfirmMassDeletionQuestion", count($toselect)), "delete", null, '', 0, 200, 500, 1);
|
||||
}
|
||||
|
||||
if ($massaction == 'preclonetasks') {
|
||||
$selected = '';
|
||||
foreach (GETPOST('toselect') as $tmpselected) {
|
||||
$selected .= '&selected[]=' . $tmpselected;
|
||||
}
|
||||
|
||||
$formquestion = array(
|
||||
array('type' => 'other', 'name' => 'projectid', 'label' => $langs->trans('Project') .': ', 'value' => $form->selectProjects('', 'projectid', '', '', '', '', '', '', '', 1, 1)),
|
||||
);
|
||||
print $form->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $object->id . $selected . '', $langs->trans('ConfirmMassClone'), '', 'clonetasks', $formquestion, '', 1, 300, 590);
|
||||
}
|
||||
|
||||
if ($massaction == 'preaffecttag' && isModEnabled('category')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$categ = new Categorie($db);
|
||||
|
||||
@ -2158,6 +2158,118 @@ class EmailCollector extends CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($operation['type'] == 'loadandcreatecontact') { // Search and create contact
|
||||
if (empty($operation['actionparam'])) {
|
||||
$errorforactions++;
|
||||
$this->error = "Action loadandcreatecontact has empty parameter. Must be 'SET:xxx' or 'EXTRACT:(body|subject):regex' to define how to extract data";
|
||||
$this->errors[] = $this->error;
|
||||
} else {
|
||||
$contact_static = new Contact($this->db);
|
||||
// Overwrite values with values extracted from source email
|
||||
$errorforthisaction = $this->overwritePropertiesOfObject($contact_static, $operation['actionparam'], $messagetext, $subject, $header, $operationslog);
|
||||
if ($errorforthisaction) {
|
||||
$errorforactions++;
|
||||
} else {
|
||||
if (!empty($contact_static->email) && $contact_static->email != $from) $from = $contact_static->email;
|
||||
|
||||
$result = $contactstatic->fetch(0, null, '', $from);
|
||||
if ($result < 0) {
|
||||
$errorforactions++;
|
||||
$this->error = 'Error when getting contact with email ' . $from;
|
||||
$this->errors[] = $this->error;
|
||||
break;
|
||||
} elseif ($result == 0) {
|
||||
dol_syslog("Contact with email " . $from . " was not found. We try to create it.");
|
||||
$contactstatic = new Contact($this->db);
|
||||
|
||||
// Create contact
|
||||
$contactstatic->email = $from;
|
||||
$operationslog .= '<br>We set property email='.dol_escape_htmltag($from);
|
||||
|
||||
// Overwrite values with values extracted from source email
|
||||
$errorforthisaction = $this->overwritePropertiesOfObject($contactstatic, $operation['actionparam'], $messagetext, $subject, $header, $operationslog);
|
||||
|
||||
if ($errorforthisaction) {
|
||||
$errorforactions++;
|
||||
} else {
|
||||
// Search country by name or code
|
||||
if (!empty($contactstatic->country)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
$result = getCountry('', 3, $this->db, '', 1, $contactstatic->country);
|
||||
if ($result == 'NotDefined') {
|
||||
$errorforactions++;
|
||||
$this->error = "Error country not found by this name '" . $contactstatic->country . "'";
|
||||
} elseif (!($result > 0)) {
|
||||
$errorforactions++;
|
||||
$this->error = "Error when search country by this name '" . $contactstatic->country . "'";
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
} else {
|
||||
$contactstatic->country_id = $result;
|
||||
$operationslog .= '<br>We set property country_id='.dol_escape_htmltag($result);
|
||||
}
|
||||
} elseif (!empty($contactstatic->country_code)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
$result = getCountry($contactstatic->country_code, 3, $this->db);
|
||||
if ($result == 'NotDefined') {
|
||||
$errorforactions++;
|
||||
$this->error = "Error country not found by this code '" . $contactstatic->country_code . "'";
|
||||
} elseif (!($result > 0)) {
|
||||
$errorforactions++;
|
||||
$this->error = "Error when search country by this code '" . $contactstatic->country_code . "'";
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
} else {
|
||||
$contactstatic->country_id = $result;
|
||||
$operationslog .= '<br>We set property country_id='.dol_escape_htmltag($result);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$errorforactions) {
|
||||
// Search state by name or code (for country if defined)
|
||||
if (!empty($contactstatic->state)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
|
||||
$result = dol_getIdFromCode($this->db, $contactstatic->state, 'c_departements', 'nom', 'rowid');
|
||||
if (empty($result)) {
|
||||
$errorforactions++;
|
||||
$this->error = "Error state not found by this name '" . $contactstatic->state . "'";
|
||||
} elseif (!($result > 0)) {
|
||||
$errorforactions++;
|
||||
$this->error = "Error when search state by this name '" . $contactstatic->state . "'";
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
} else {
|
||||
$contactstatic->state_id = $result;
|
||||
$operationslog .= '<br>We set property state_id='.dol_escape_htmltag($result);
|
||||
}
|
||||
} elseif (!empty($contactstatic->state_code)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
|
||||
$result = dol_getIdFromCode($this->db, $contactstatic->state_code, 'c_departements', 'code_departement', 'rowid');
|
||||
if (empty($result)) {
|
||||
$errorforactions++;
|
||||
$this->error = "Error state not found by this code '" . $contactstatic->state_code . "'";
|
||||
} elseif (!($result > 0)) {
|
||||
$errorforactions++;
|
||||
$this->error = "Error when search state by this code '" . $contactstatic->state_code . "'";
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
} else {
|
||||
$contactstatic->state_id = $result;
|
||||
$operationslog .= '<br>We set property state_id='.dol_escape_htmltag($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$errorforactions) {
|
||||
$result = $contactstatic->create($user);
|
||||
if ($result <= 0) {
|
||||
$errorforactions++;
|
||||
$this->error = $contactstatic->error;
|
||||
$this->errors = $contactstatic->errors;
|
||||
} else {
|
||||
$operationslog .= '<br>Contact created -> id = '.dol_escape_htmltag($contactstatic->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($operation['type'] == 'recordevent') {
|
||||
// Create event
|
||||
$actioncomm = new ActionComm($this->db);
|
||||
|
||||
@ -2419,4 +2419,41 @@ class Holiday extends CommonObject
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Return clicable link of object (with eventually picto)
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '')
|
||||
{
|
||||
global $langs, $selected;
|
||||
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
||||
$return .= '<div class="info-box info-box-sm">';
|
||||
$return .= '<span class="info-box-icon bg-infobox-action">';
|
||||
$return .= img_picto('', $this->picto);
|
||||
$return .= '</span>';
|
||||
$return .= '<div class="info-box-content">';
|
||||
$return .= '<span class="info-box-ref">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>';
|
||||
if (property_exists($this, 'fk_user') && !empty($this->id)) {
|
||||
$return .= '| <span class="info-box-label">'.$this->fk_user.'</span>';
|
||||
$return .= '<input class="fright" id="cb'.$this->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
if (property_exists($this, 'fk_type')) {
|
||||
$return .= '<br><span class="opacitymedium">'.$langs->trans("Type").'</span> : ';
|
||||
$return .= '<span class="info_box-label">'.$langs->trans($this->getTypes(1, -1)[$this->fk_type]['code']).'</span>';
|
||||
}
|
||||
if (property_exists($this, 'date_debut') && property_exists($this, 'date_fin')) {
|
||||
$return .= '<br><span class="info-box-label">'.dol_print_date($this->date_debut, 'day').'</span>';
|
||||
$return .= ' <span class="opacitymedium">'.$langs->trans("To").'</span> ';
|
||||
$return .= '<span class="info-box-label">'.dol_print_date($this->date_fin, 'day').'</span>';
|
||||
}
|
||||
if (method_exists($this, 'getLibStatut')) {
|
||||
$return .= '<br><div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
|
||||
}
|
||||
$return .= '</div>';
|
||||
$return .= '</div>';
|
||||
$return .= '</div>';
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,6 +52,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'holidaylist'; // To manage different context of search
|
||||
$mode = GETPOST('mode', 'alpha'); // for switch mode view result
|
||||
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
@ -394,6 +395,9 @@ if ($resql) {
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$param = '';
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
@ -476,6 +480,8 @@ if ($resql) {
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
if ($id > 0) {
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
}
|
||||
@ -519,7 +525,11 @@ if ($resql) {
|
||||
} else {
|
||||
$title = $langs->trans("ListeCP");
|
||||
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=create', '', $user->rights->holiday->write);
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('MenuAddCP'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/holiday/card.php?action=create', '', $user->rights->holiday->write);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_hrm', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
}
|
||||
@ -787,7 +797,8 @@ if ($resql) {
|
||||
$holidaystatic->id = $obj->rowid;
|
||||
$holidaystatic->ref = ($obj->ref ? $obj->ref : $obj->rowid);
|
||||
$holidaystatic->statut = $obj->status;
|
||||
$holidaystatic->date_debut = $db->jdate($obj->date_debut);
|
||||
$holidaystatic->date_debut = $obj->date_debut;
|
||||
$holidaystatic->date_fin = $obj->date_fin;
|
||||
|
||||
// User
|
||||
$userstatic->id = $obj->fk_user;
|
||||
@ -815,139 +826,163 @@ if ($resql) {
|
||||
$starthalfday = ($obj->halfday == -1 || $obj->halfday == 2) ? 'afternoon' : 'morning';
|
||||
$endhalfday = ($obj->halfday == 1 || $obj->halfday == 2) ? 'morning' : 'afternoon';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday); // user jdate(..., 1) because num_open_day need UTC dates
|
||||
$totalduration += $nbopenedday;
|
||||
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
print '<tr><td colspan="12">';
|
||||
print '<div class="box-flex-container">';
|
||||
}
|
||||
|
||||
$holidaystatic->fk_type = $holidaystatic->getTypes(1, -1)[$obj->fk_type]['rowid'];
|
||||
$holidaystatic->fk_user = $userstatic->getNomUrl(1);
|
||||
// Output Kanban
|
||||
if ($massactionbutton || $massaction) {
|
||||
$selected = 0;
|
||||
if (in_array($obj->rowid, $arrayofselected)) {
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
print $holidaystatic->getKanbanView('');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['cp.ref']['checked'])) {
|
||||
print '<td class="nowraponall">';
|
||||
print $holidaystatic->getNomUrl(1, 1);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
if ($i == (min($num, $limit) - 1)) {
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.fk_user']['checked'])) {
|
||||
print '<td class="tdoverflowmax125">'.$userstatic->getNomUrl(-1, 'leave').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.fk_validator']['checked'])) {
|
||||
print '<td class="tdoverflowmax125">'.$approbatorstatic->getNomUrl(-1).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.fk_type']['checked'])) {
|
||||
$labeltypeleavetoshow = ($langs->trans($typeleaves[$obj->fk_type]['code']) != $typeleaves[$obj->fk_type]['code'] ? $langs->trans($typeleaves[$obj->fk_type]['code']) : $typeleaves[$obj->fk_type]['label']);
|
||||
$labeltypeleavetoshow = empty($typeleaves[$obj->fk_type]['label']) ? $langs->trans("TypeWasDisabledOrRemoved", $obj->fk_type) : $labeltypeleavetoshow;
|
||||
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labeltypeleavetoshow).'">';
|
||||
print $labeltypeleavetoshow;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['duration']['checked'])) {
|
||||
print '<td class="right">';
|
||||
$nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday); // user jdate(..., 1) because num_open_day need UTC dates
|
||||
$totalduration += $nbopenedday;
|
||||
print $nbopenedday;
|
||||
//print ' '.$langs->trans('DurationDays');
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.date_debut']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_debut), 'day');
|
||||
print ' <span class="opacitymedium nowraponall">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.date_fin']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_fin), 'day');
|
||||
print ' <span class="opacitymedium nowraponall">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Date validation
|
||||
if (!empty($arrayfields['cp.date_valid']['checked'])) { // date_valid is both date_valid but also date_approval
|
||||
print '<td class="center" title="'.dol_print_date($db->jdate($obj->date_valid), 'dayhour').'">';
|
||||
print dol_print_date($db->jdate($obj->date_valid), 'day');
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Date approval
|
||||
if (!empty($arrayfields['cp.date_approval']['checked'])) {
|
||||
print '<td class="center" title="'.dol_print_date($db->jdate($obj->date_approval), 'dayhour').'">';
|
||||
print dol_print_date($db->jdate($obj->date_approval), 'day');
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Date creation
|
||||
if (!empty($arrayfields['cp.date_create']['checked'])) {
|
||||
print '<td style="text-align: center;">'.dol_print_date($date, 'dayhour').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.tms']['checked'])) {
|
||||
print '<td style="text-align: center;">'.dol_print_date($date_modif, 'dayhour').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.statut']['checked'])) {
|
||||
print '<td class="right nowrap">'.$holidaystatic->getLibStatut(5).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($obj->rowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
} else {
|
||||
print '<tr class="oddeven">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($obj->rowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['cp.ref']['checked'])) {
|
||||
print '<td class="nowraponall">';
|
||||
print $holidaystatic->getNomUrl(1, 1);
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.fk_user']['checked'])) {
|
||||
print '<td class="tdoverflowmax125">'.$userstatic->getNomUrl(-1, 'leave').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.fk_validator']['checked'])) {
|
||||
print '<td class="tdoverflowmax125">'.$approbatorstatic->getNomUrl(-1).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.fk_type']['checked'])) {
|
||||
$labeltypeleavetoshow = ($langs->trans($typeleaves[$obj->fk_type]['code']) != $typeleaves[$obj->fk_type]['code'] ? $langs->trans($typeleaves[$obj->fk_type]['code']) : $typeleaves[$obj->fk_type]['label']);
|
||||
$labeltypeleavetoshow = empty($typeleaves[$obj->fk_type]['label']) ? $langs->trans("TypeWasDisabledOrRemoved", $obj->fk_type) : $labeltypeleavetoshow;
|
||||
|
||||
print '</tr>'."\n";
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labeltypeleavetoshow).'">';
|
||||
print $labeltypeleavetoshow;
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['duration']['checked'])) {
|
||||
print '<td class="right">';
|
||||
$nbopenedday = num_open_day($db->jdate($obj->date_debut, 1), $db->jdate($obj->date_fin, 1), 0, 1, $obj->halfday); // user jdate(..., 1) because num_open_day need UTC dates
|
||||
$totalduration += $nbopenedday;
|
||||
print $nbopenedday;
|
||||
//print ' '.$langs->trans('DurationDays');
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.date_debut']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_debut), 'day');
|
||||
print ' <span class="opacitymedium nowraponall">('.$langs->trans($listhalfday[$starthalfday]).')</span>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.date_fin']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print dol_print_date($db->jdate($obj->date_fin), 'day');
|
||||
print ' <span class="opacitymedium nowraponall">('.$langs->trans($listhalfday[$endhalfday]).')</span>';
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Date validation
|
||||
if (!empty($arrayfields['cp.date_valid']['checked'])) { // date_valid is both date_valid but also date_approval
|
||||
print '<td class="center" title="'.dol_print_date($db->jdate($obj->date_valid), 'dayhour').'">';
|
||||
print dol_print_date($db->jdate($obj->date_valid), 'day');
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
// Date approval
|
||||
if (!empty($arrayfields['cp.date_approval']['checked'])) {
|
||||
print '<td class="center" title="'.dol_print_date($db->jdate($obj->date_approval), 'dayhour').'">';
|
||||
print dol_print_date($db->jdate($obj->date_approval), 'day');
|
||||
print '</td>';
|
||||
if (!$i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Date creation
|
||||
if (!empty($arrayfields['cp.date_create']['checked'])) {
|
||||
print '<td style="text-align: center;">'.dol_print_date($date, 'dayhour').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.tms']['checked'])) {
|
||||
print '<td style="text-align: center;">'.dol_print_date($date_modif, 'dayhour').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
if (!empty($arrayfields['cp.statut']['checked'])) {
|
||||
print '<td class="right nowrap">'.$holidaystatic->getLibStatut(5).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($obj->rowid, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@ -61,3 +61,5 @@ ALTER TABLE llx_user ADD COLUMN flagdelsessionsbefore datetime DEFAULT NULL;
|
||||
|
||||
ALTER TABLE llx_website ADD COLUMN pageviews_previous_month BIGINT UNSIGNED DEFAULT 0;
|
||||
|
||||
ALTER TABLE llx_product_stock ADD CONSTRAINT fk_product_product_rowid FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
|
||||
ALTER TABLE llx_product_stock ADD CONSTRAINT fk_entrepot_entrepot_rowid FOREIGN KEY (fk_entrepot) REFERENCES llx_entrepot (rowid);
|
||||
|
||||
@ -20,5 +20,7 @@
|
||||
|
||||
ALTER TABLE llx_product_stock ADD INDEX idx_product_stock_fk_product (fk_product);
|
||||
ALTER TABLE llx_product_stock ADD INDEX idx_product_stock_fk_entrepot (fk_entrepot);
|
||||
ALTER TABLE llx_product_stock ADD CONSTRAINT fk_product_product_rowid FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
|
||||
ALTER TABLE llx_product_stock ADD CONSTRAINT fk_entrepot_entrepot_rowid FOREIGN KEY (fk_entrepot) REFERENCES llx_entrepot (rowid);
|
||||
|
||||
ALTER TABLE llx_product_stock ADD UNIQUE INDEX uk_product_stock (fk_product,fk_entrepot);
|
||||
|
||||
@ -2135,6 +2135,7 @@ CodeLastResult=Latest result code
|
||||
NbOfEmailsInInbox=Number of emails in source directory
|
||||
LoadThirdPartyFromName=Load third party searching on %s (load only)
|
||||
LoadThirdPartyFromNameOrCreate=Load third party searching on %s (create if not found)
|
||||
LoadContactFromEmailOrCreate=Load contact searching on %s (create if not found)
|
||||
AttachJoinedDocumentsToObject=Save attached files into object documents if a ref of an object is found into email topic.
|
||||
WithDolTrackingID=Message from a conversation initiated by a first email sent from Dolibarr
|
||||
WithoutDolTrackingID=Message from a conversation initiated by a first email NOT sent from Dolibarr
|
||||
|
||||
@ -898,6 +898,9 @@ MassFilesArea=Area for files built by mass actions
|
||||
ShowTempMassFilesArea=Show area of files built by mass actions
|
||||
ConfirmMassDeletion=Bulk Delete confirmation
|
||||
ConfirmMassDeletionQuestion=Are you sure you want to delete the %s selected record(s)?
|
||||
ConfirmMassClone=Bulk clone confirmation
|
||||
ConfirmMassCloneQuestion=Select project to clone to
|
||||
ConfirmMassCloneToOneProject=Clone to project %s
|
||||
RelatedObjects=Related Objects
|
||||
ClassifyBilled=Classify billed
|
||||
ClassifyUnbilled=Classify unbilled
|
||||
|
||||
@ -259,6 +259,7 @@ RecordsClosed=%s project(s) closed
|
||||
SendProjectRef=Information project %s
|
||||
ModuleSalaryToDefineHourlyRateMustBeEnabled=Module 'Salaries' must be enabled to define employee hourly rate to have time spent valorized
|
||||
NewTaskRefSuggested=Task ref already used, a new task ref is required
|
||||
NumberOfTasksCloned=%s task(s) cloned
|
||||
TimeSpentInvoiced=Time spent billed
|
||||
TimeSpentForIntervention=Time spent
|
||||
TimeSpentForInvoice=Time spent
|
||||
@ -298,4 +299,4 @@ EnablePublicLeadForm=Enable the public form for contact
|
||||
NewLeadbyWeb=Your message or request has been recorded. We will answer or contact your soon.
|
||||
NewLeadForm=New contact form
|
||||
LeadFromPublicForm=Online lead from public form
|
||||
ExportAccountingReportButtonLabel=Get report
|
||||
ExportAccountingReportButtonLabel=Get report
|
||||
|
||||
@ -2132,6 +2132,7 @@ CodeLastResult=Dernier code de retour
|
||||
NbOfEmailsInInbox=Nombre de courriels dans le répertoire source
|
||||
LoadThirdPartyFromName=Charger le Tiers en cherchant sur %s (chargement uniquement)
|
||||
LoadThirdPartyFromNameOrCreate=Charger le Tiers en cherchant sur %s (créer si non trouvé)
|
||||
LoadContactFromEmailOrCreate=Charger le Contact en cherchant sur %s (créer si non trouvé)
|
||||
AttachJoinedDocumentsToObject=Enregistrez les fichiers joints dans des documents d'objet si la référence d'un objet est trouvée dans le sujet de l'e-mail.
|
||||
WithDolTrackingID=Message d'une conversation initiée par un premier mail envoyé depuis Dolibarr
|
||||
WithoutDolTrackingID=Message d'une conversation initiée par un premier e-mail NON envoyé depuis Dolibarr
|
||||
|
||||
@ -183,6 +183,14 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list';
|
||||
$massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
$parameters = array('id'=>$id);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
@ -413,6 +421,7 @@ $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos";
|
||||
|
||||
llxHeader("", $title, $help_url);
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$result = $object->fetch($id, $ref);
|
||||
@ -544,6 +553,18 @@ if ($id > 0 || !empty($ref)) {
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
||||
$arrayofmassactions = array();
|
||||
if ($user->rights->projet->creer) {
|
||||
$arrayofmassactions['preclonetasks'] = img_picto('', 'rightarrow', 'class="pictofixedwidth"').$langs->trans("Clone");
|
||||
}
|
||||
if ($permissiontodelete) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (in_array($massaction, array('presend', 'predelete'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
// Project card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
@ -849,7 +870,11 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
$linktotasks .= dolGetButtonTitle($langs->trans('ViewGantt'), '', 'fa fa-stream imgforviewmode', DOL_URL_ROOT.'/projet/ganttview.php?id='.$object->id.'&withproject=1', '', 1, array('morecss'=>'reposition marginleftonly'));
|
||||
|
||||
//print_barre_liste($title, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, $linktotasks, $num, $totalnboflines, 'generic', 0, '', '', 0, 1);
|
||||
print load_fiche_titre($title, $linktotasks.' '.$linktocreatetask, 'projecttask');
|
||||
print load_fiche_titre($title, $linktotasks.' '.$linktocreatetask, 'projecttask', '', '', '', $massactionbutton);
|
||||
|
||||
$objecttmp = new Task($db);
|
||||
$trackid = 'task'.$taskstatic->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
// Get list of tasks in tasksarray and taskarrayfiltered
|
||||
// We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him).
|
||||
@ -884,6 +909,11 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
// Show the massaction checkboxes only when this page is not opend from the Extended POS
|
||||
if ($massactionbutton && $contextpage != 'poslist') {
|
||||
$selectedfields = $form->showCheckAddButtons('checkforselect', 1);
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table id="tablelines" class="tagtable nobottom liste'.($moreforfilter ? " listwithfilterbefore" : "").'">';
|
||||
|
||||
@ -994,6 +1024,8 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
|
||||
print '<td class="liste_titre maxwidthsearch"> </td>';
|
||||
|
||||
// Action column
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
@ -1062,6 +1094,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print '<td></td>';
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -1069,7 +1102,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
if (count($tasksarray) > 0) {
|
||||
// Show all lines in taskarray (recursive function to go down on tree)
|
||||
$j = 0; $level = 0;
|
||||
$nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields);
|
||||
$nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, $filterprogresscalc, ($object->usage_bill_time ? 1 : 0), $arrayfields, $arrayofselected);
|
||||
} else {
|
||||
$colspan = 10;
|
||||
if ($object->usage_bill_time) {
|
||||
|
||||
@ -492,6 +492,11 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
|
||||
max-width: 350px;
|
||||
}
|
||||
|
||||
/**for make a checkbox in the right of the box in mode kanban */
|
||||
.fright {
|
||||
float:right;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 1740px) {
|
||||
.info-box-module {
|
||||
min-width: 315px;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user