forked from Wavyzz/dolibarr
Debug v18
This commit is contained in:
@@ -319,12 +319,12 @@ for ($i = 1 ; $i < $MAXLINES; $i++) {
|
||||
|
||||
print '<tr class="oddeven nowraponall '.$classi.'"><td>';
|
||||
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||
$form->select_comptes(($error ? GETPOST($i.'_account_from', 'int') : ''), $i.'_account_from', 0, '', 1, ($i <= $maxtab ? 'view=view' : ''), isModEnabled('multicurrency') ? 1 : 0, 'minwidth100');
|
||||
$form->select_comptes(($error ? GETPOST($i.'_account_from', 'int') : ''), $i.'_account_from', 0, '', 1, '', isModEnabled('multicurrency') ? 1 : 0, 'minwidth100');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowraponall">';
|
||||
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||
$form->select_comptes(($error ? GETPOST($i.'_account_to', 'int') : ''), $i.'_account_to', 0, '', 1, ($i <= $maxtab ? 'view=view' : ''), isModEnabled('multicurrency') ? 1 : 0, 'minwidth100');
|
||||
$form->select_comptes(($error ? GETPOST($i.'_account_to', 'int') : ''), $i.'_account_to', 0, '', 1, '', isModEnabled('multicurrency') ? 1 : 0, 'minwidth100');
|
||||
print "</td>\n";
|
||||
|
||||
// Payment mode
|
||||
|
||||
@@ -505,12 +505,16 @@ if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
|
||||
// Fields title label
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
@@ -525,17 +529,19 @@ foreach ($object->fields as $key => $val) {
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
@@ -554,8 +560,8 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar
|
||||
// Loop on record
|
||||
// --------------------------------------------------------------------
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
$savnbfield = $totalarray['nbfield'];
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@@ -106,6 +106,7 @@ class CashControl extends CommonObject
|
||||
* @var int Object Id
|
||||
*/
|
||||
public $id;
|
||||
public $label;
|
||||
public $opening;
|
||||
public $status;
|
||||
public $year_close;
|
||||
@@ -127,6 +128,11 @@ class CashControl extends CommonObject
|
||||
* @var integer|string $date_modification
|
||||
*/
|
||||
public $date_modification;
|
||||
/**
|
||||
* @var integer|string $date_modification
|
||||
* @deprecated
|
||||
*/
|
||||
public $tms;
|
||||
|
||||
/**
|
||||
* @var integer|string $date_valid
|
||||
|
||||
@@ -611,19 +611,19 @@ if ($action == 'new') {
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('Date');
|
||||
print '</td>';
|
||||
if ($action != 'editdate') {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
|
||||
print '</td><td>';
|
||||
if ($action == 'editdate') {
|
||||
print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@@ -638,51 +638,43 @@ if ($action == 'new') {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// External ref
|
||||
/* Ext ref are not visible field on standard usage
|
||||
// External ref - Ext ref are not visible field on standard usage
|
||||
if (getDolGlobalString('MAIN_SHOW_EXTREF')) {
|
||||
print '<tr><td>';
|
||||
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('RefExt');
|
||||
print '</td>';
|
||||
if ($action != 'editrefext') print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editrefext&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetRefExt'),1).'</a></td>';
|
||||
if ($action != 'editrefext') {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editrefext&token='.newToken().'&id='.((int) $object->id).'">'.img_edit($langs->trans('SetRefExt'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td colspan="2">';
|
||||
if ($action == 'editrefext')
|
||||
{
|
||||
print '</td><td>';
|
||||
if ($action == 'editrefext') {
|
||||
print '<form name="setrefext" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setrefext">';
|
||||
print '<input type="text" name="ref_ext" value="'.$object->ref_ext.'">';
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
|
||||
print '</form>';
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
print $object->ref_ext;
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
*/
|
||||
|
||||
print '<tr><td>'.$langs->trans('Account').'</td><td colspan="2">';
|
||||
print '<tr><td>'.$langs->trans('Account').'</td><td>';
|
||||
print $accountstatic->getNomUrl(1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Number of bank checks
|
||||
print '<tr><td>'.$langs->trans('NbOfCheques').'</td><td colspan="2">';
|
||||
print '<tr><td>'.$langs->trans('NbOfCheques').'</td><td>';
|
||||
print $object->nbcheque;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans('Total').'</td><td colspan="2">';
|
||||
print price($object->amount);
|
||||
print '<tr><td>'.$langs->trans('Total').'</td><td>';
|
||||
print '<span class="amount">'.price($object->amount).'</span>';
|
||||
print '</td></tr>';
|
||||
|
||||
/*print '<tr><td>'.$langs->trans('Status').'</td><td colspan="2">';
|
||||
print $object->getLibStatut(4);
|
||||
print '</td></tr>';*/
|
||||
|
||||
print '</table><br>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
@@ -79,8 +79,6 @@ class RemiseCheque extends CommonObject
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
$this->next_id = 0;
|
||||
$this->previous_id = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -810,47 +808,6 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Charge les proprietes ref_previous et ref_next
|
||||
*
|
||||
* @return int <0 if KO, 0 if OK
|
||||
*/
|
||||
public function load_previous_next_id()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$this->errno = 0;
|
||||
|
||||
$sql = "SELECT MAX(rowid)";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||
$sql .= " WHERE rowid < ".((int) $this->id);
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result) {
|
||||
$this->errno = -1035;
|
||||
}
|
||||
$row = $this->db->fetch_row($result);
|
||||
$this->previous_id = $row[0];
|
||||
|
||||
$sql = "SELECT MIN(rowid)";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bordereau_cheque";
|
||||
$sql .= " WHERE rowid > ".((int) $this->id);
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result) {
|
||||
$this->errno = -1035;
|
||||
}
|
||||
$row = $this->db->fetch_row($result);
|
||||
$this->next_id = $row[0];
|
||||
|
||||
return $this->errno;
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Set the creation date
|
||||
|
||||
@@ -9930,13 +9930,17 @@ function printCommonFooter($zone = 'private')
|
||||
* Split a string with 2 keys into key array.
|
||||
* For example: "A=1;B=2;C=2" is exploded into array('A'=>1,'B'=>2,'C'=>3)
|
||||
*
|
||||
* @param string $string String to explode
|
||||
* @param string|null $string String to explode
|
||||
* @param string $delimiter Delimiter between each couple of data. Example: ';' or '[\n;]+' or '(\n\r|\r|\n|;)'
|
||||
* @param string $kv Delimiter between key and value
|
||||
* @return array Array of data exploded
|
||||
*/
|
||||
function dolExplodeIntoArray($string, $delimiter = ';', $kv = '=')
|
||||
{
|
||||
if (is_null($string)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
if (preg_match('/^\[.*\]$/sm', $delimiter) || preg_match('/^\(.*\)$/sm', $delimiter)) {
|
||||
// This is a regex string
|
||||
$newdelimiter = $delimiter;
|
||||
|
||||
@@ -590,13 +590,13 @@ function project_admin_prepare_head()
|
||||
* @param int $projectsListId List of id of project allowed to user (string separated with comma)
|
||||
* @param int $addordertick Add a tick to move task
|
||||
* @param int $projectidfortotallink 0 or Id of project to use on total line (link to see all time consumed for project)
|
||||
* @param string $filterprogresscalc filter text
|
||||
* @param string $dummy Not used.
|
||||
* @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(), $arrayofselected = array())
|
||||
function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole, $projectsListId = '', $addordertick = 0, $projectidfortotallink = 0, $dummy = '', $showbilltime = 0, $arrayfields = array(), $arrayofselected = array())
|
||||
{
|
||||
global $user, $langs, $conf, $db, $hookmanager;
|
||||
global $projectstatic, $taskstatic, $extrafields;
|
||||
@@ -604,17 +604,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
$lastprojectid = 0;
|
||||
|
||||
$projectsArrayId = explode(',', $projectsListId);
|
||||
if ($filterprogresscalc !== '') {
|
||||
foreach ($lines as $key => $line) {
|
||||
if (!empty($line->planned_workload) && !empty($line->duration)) {
|
||||
$filterprogresscalc = str_replace(' = ', ' == ', $filterprogresscalc);
|
||||
if (!eval($filterprogresscalc)) {
|
||||
unset($lines[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$lines = array_values($lines);
|
||||
}
|
||||
|
||||
$numlines = count($lines);
|
||||
|
||||
// We declare counter as global because we want to edit them into recursive call
|
||||
@@ -699,7 +689,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
$taskstatic->date_end = $lines[$i]->date_end;
|
||||
$taskstatic->datee = $lines[$i]->date_end; // deprecated
|
||||
$taskstatic->planned_workload = $lines[$i]->planned_workload;
|
||||
$taskstatic->duration_effective = $lines[$i]->duration;
|
||||
$taskstatic->duration_effective = $lines[$i]->duration_effective;
|
||||
$taskstatic->budget_amount = $lines[$i]->budget_amount;
|
||||
|
||||
// Action column
|
||||
@@ -819,8 +809,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
} else {
|
||||
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.($showproject ? '' : '&withproject=1').'">';
|
||||
}
|
||||
if ($lines[$i]->duration) {
|
||||
print convertSecondToTime($lines[$i]->duration, $timespentoutputformat);
|
||||
if ($lines[$i]->duration_effective) {
|
||||
print convertSecondToTime($lines[$i]->duration_effective, $timespentoutputformat);
|
||||
} else {
|
||||
print '--:--';
|
||||
}
|
||||
@@ -832,12 +822,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Progress calculated (Note: ->duration is time spent)
|
||||
// Progress calculated (Note: ->duration_effective is time spent)
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.progress_calculated']['checked'])) {
|
||||
$s = ''; $shtml = '';
|
||||
if ($lines[$i]->planned_workload || $lines[$i]->duration) {
|
||||
if ($lines[$i]->planned_workload || $lines[$i]->duration_effective) {
|
||||
if ($lines[$i]->planned_workload) {
|
||||
$s = round(100 * $lines[$i]->duration / $lines[$i]->planned_workload, 2).' %';
|
||||
$s = round(100 * $lines[$i]->duration_effective / $lines[$i]->planned_workload, 2).' %';
|
||||
$shtml = $s;
|
||||
} else {
|
||||
$s = $langs->trans('WorkloadNotDefined');
|
||||
@@ -861,7 +851,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
// resume
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.progress_summary']['checked'])) {
|
||||
print '<td class="right">';
|
||||
if ($lines[$i]->progress != '' && $lines[$i]->duration) {
|
||||
if ($lines[$i]->progress != '' && $lines[$i]->duration_effective) {
|
||||
print getTaskProgressView($taskstatic, false, false);
|
||||
}
|
||||
print '</td>';
|
||||
@@ -974,15 +964,15 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
if ($level >= 0) { // Call sublevels
|
||||
$level++;
|
||||
if ($lines[$i]->id) {
|
||||
projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick, $projectidfortotallink, $filterprogresscalc, $showbilltime, $arrayfields);
|
||||
projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick, $projectidfortotallink, '', $showbilltime, $arrayfields);
|
||||
}
|
||||
$level--;
|
||||
}
|
||||
|
||||
$total_projectlinesa_spent += $lines[$i]->duration;
|
||||
$total_projectlinesa_spent += $lines[$i]->duration_effective;
|
||||
$total_projectlinesa_planned += $lines[$i]->planned_workload;
|
||||
if ($lines[$i]->planned_workload) {
|
||||
$total_projectlinesa_spent_if_planned += $lines[$i]->duration;
|
||||
$total_projectlinesa_spent_if_planned += $lines[$i]->duration_effective;
|
||||
}
|
||||
if ($lines[$i]->planned_workload) {
|
||||
$total_projectlinesa_declared_if_planned += $lines[$i]->planned_workload * $lines[$i]->progress / 100;
|
||||
@@ -1627,10 +1617,10 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
||||
if (!empty($arrayfields['timeconsumed']['checked'])) {
|
||||
// Time spent by everybody
|
||||
print '<td class="right">';
|
||||
// $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user
|
||||
if ($lines[$i]->duration) {
|
||||
// $lines[$i]->duration_effective is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user
|
||||
if ($lines[$i]->duration_effective) {
|
||||
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
|
||||
print convertSecondToTime($lines[$i]->duration, 'allhourmin');
|
||||
print convertSecondToTime($lines[$i]->duration_effective, 'allhourmin');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '--:--';
|
||||
@@ -2026,10 +2016,10 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$
|
||||
if (!empty($arrayfields['timeconsumed']['checked'])) {
|
||||
// Time spent by everybody
|
||||
print '<td class="right">';
|
||||
// $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user
|
||||
if ($lines[$i]->duration) {
|
||||
// $lines[$i]->duration_effective is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user
|
||||
if ($lines[$i]->duration_effective) {
|
||||
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
|
||||
print convertSecondToTime($lines[$i]->duration, 'allhourmin');
|
||||
print convertSecondToTime($lines[$i]->duration_effective, 'allhourmin');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '--:--';
|
||||
@@ -2320,10 +2310,10 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &
|
||||
|
||||
// Time spent by everybody
|
||||
print '<td class="right">';
|
||||
// $lines[$i]->duration is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user
|
||||
if ($lines[$i]->duration) {
|
||||
// $lines[$i]->duration_effective is a denormalised field = summ of time spent by everybody for task. What we need is time consumed by user
|
||||
if ($lines[$i]->duration_effective) {
|
||||
print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
|
||||
print convertSecondToTime($lines[$i]->duration, 'allhourmin');
|
||||
print convertSecondToTime($lines[$i]->duration_effective, 'allhourmin');
|
||||
print '</a>';
|
||||
} else {
|
||||
print '--:--';
|
||||
|
||||
@@ -665,36 +665,49 @@ if ($resql) {
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.ref']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], "d.ref", "", $param, '', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['user']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['user']['label'], $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.date_debut']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.date_debut']['label'], $_SERVER["PHP_SELF"], "d.date_debut", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.date_fin']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.date_fin']['label'], $_SERVER["PHP_SELF"], "d.date_fin", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.date_valid']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.date_valid']['label'], $_SERVER["PHP_SELF"], "d.date_valid", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.date_approve']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.date_approve']['label'], $_SERVER["PHP_SELF"], "d.date_approve", "", $param, 'align="center"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.total_ht']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.total_ht']['label'], $_SERVER["PHP_SELF"], "d.total_ht", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.total_vat']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.total_vat']['label'], $_SERVER["PHP_SELF"], "d.total_tva", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.total_ttc']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.total_ttc']['label'], $_SERVER["PHP_SELF"], "d.total_ttc", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
@@ -704,15 +717,19 @@ if ($resql) {
|
||||
print $hookmanager->resPrint;
|
||||
if (!empty($arrayfields['d.date_create']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.date_create']['label'], $_SERVER["PHP_SELF"], "d.date_create", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.tms']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($arrayfields['d.fk_statut']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['d.fk_statut']['label'], $_SERVER["PHP_SELF"], "d.fk_statut", "", $param, 'align="right"', $sortfield, $sortorder);
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ class Job extends CommonObject
|
||||
);
|
||||
public $rowid;
|
||||
public $ref;
|
||||
public $label;
|
||||
public $description;
|
||||
public $date_creation;
|
||||
public $tms;
|
||||
@@ -844,6 +845,9 @@ class Job extends CommonObject
|
||||
public function LibStatut($status, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
return ''; // There is no status on job profile for the moment
|
||||
|
||||
/*
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
//$langs->load("hrm");
|
||||
@@ -862,6 +866,7 @@ class Job extends CommonObject
|
||||
}
|
||||
|
||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -372,7 +372,7 @@ class Tasks extends DolibarrApi
|
||||
*/
|
||||
|
||||
// /**
|
||||
// * Update a task to given project
|
||||
// * Update a task of a given project
|
||||
// *
|
||||
// * @param int $id Id of project to update
|
||||
// * @param int $taskid Id of task to update
|
||||
|
||||
@@ -1800,7 +1800,7 @@ class Project extends CommonObject
|
||||
|
||||
// Loop on each task, to clone it
|
||||
foreach ($tasksarray as $tasktoclone) {
|
||||
$result_clone = $taskstatic->createFromClone($user, $tasktoclone->id, $clone_project_id, $tasktoclone->fk_parent, $move_date, true, false, $clone_task_file, true, false);
|
||||
$result_clone = $taskstatic->createFromClone($user, $tasktoclone->id, $clone_project_id, $tasktoclone->fk_task_parent, $move_date, true, false, $clone_task_file, true, false);
|
||||
if ($result_clone <= 0) {
|
||||
$this->error .= $taskstatic->error;
|
||||
$error++;
|
||||
|
||||
@@ -135,11 +135,6 @@ class Task extends CommonObjectLine
|
||||
|
||||
public $comments = array();
|
||||
|
||||
/**
|
||||
* @var float budget_amount
|
||||
*/
|
||||
public $budget_amount;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
@@ -150,12 +145,34 @@ class Task extends CommonObjectLine
|
||||
*/
|
||||
public $statuts_short;
|
||||
|
||||
|
||||
// Properties to store project informations
|
||||
public $projectref;
|
||||
public $projectstatus;
|
||||
public $projectlabel;
|
||||
public $opp_amount;
|
||||
public $opp_percent;
|
||||
public $fk_opp_status;
|
||||
public $usage_bill_time;
|
||||
public $public;
|
||||
|
||||
// Properties to store thirdparty of project information
|
||||
public $socid;
|
||||
public $thirdparty_id;
|
||||
public $thirdparty_name;
|
||||
public $thirdparty_email;
|
||||
|
||||
|
||||
/**
|
||||
* @var float budget_amount
|
||||
*/
|
||||
public $budget_amount;
|
||||
|
||||
/**
|
||||
* @var float project_budget_amount
|
||||
*/
|
||||
public $project_budget_amount;
|
||||
|
||||
public $oldcopy;
|
||||
|
||||
|
||||
/**
|
||||
@@ -857,7 +874,7 @@ class Task extends CommonObjectLine
|
||||
* @param string $filterontaskuser Filter on user assigned to task
|
||||
* @param Extrafields $extrafields Show additional column from project or task
|
||||
* @param int $includebilltime Calculate also the time to bill and billed
|
||||
* @param array $search_array_options Array of search
|
||||
* @param array $search_array_options Array of search filters. Not Used yet.
|
||||
* @param int $loadextras Fetch all Extrafields on each task
|
||||
* @param int $loadRoleMode 1= will test Roles on task; 0 used in delete project action
|
||||
* @param string $sortfield Sort field
|
||||
@@ -1053,9 +1070,8 @@ class Task extends CommonObjectLine
|
||||
|
||||
$tasks[$i]->label = $obj->label;
|
||||
$tasks[$i]->description = $obj->description;
|
||||
$tasks[$i]->fk_parent = $obj->fk_task_parent; // deprecated
|
||||
$tasks[$i]->fk_task_parent = $obj->fk_task_parent;
|
||||
$tasks[$i]->duration = $obj->duration_effective;
|
||||
$tasks[$i]->duration_effective = $obj->duration_effective;
|
||||
$tasks[$i]->planned_workload = $obj->planned_workload;
|
||||
|
||||
if ($includebilltime) {
|
||||
|
||||
@@ -288,19 +288,17 @@ if (!empty($search_timespend)) {
|
||||
$morewherefilterarray[] = natural_search('t.duration_effective', $search_timespend, 1, 1);
|
||||
}
|
||||
|
||||
if (!empty($search_progresscalc)) {
|
||||
$filterprogresscalc = 'if '.natural_search('round(100 * $line->duration / $line->planned_workload,2)', $search_progresscalc, 1, 1).'{return 1;} else {return 0;}';
|
||||
} else {
|
||||
$filterprogresscalc = '';
|
||||
}
|
||||
|
||||
if (!empty($search_progressdeclare)) {
|
||||
$morewherefilterarray[] = natural_search('t.progress', $search_progressdeclare, 1, 1);
|
||||
}
|
||||
|
||||
if (!empty($search_progresscalc)) {
|
||||
$morewherefilterarray[] = '(planned_workload IS NULL OR planned_workload = 0 OR '.natural_search('ROUND(100 * duration_effective / planned_workload, 2)', $search_progresscalc, 1, 1).')';
|
||||
//natural_search('round(100 * $line->duration_effective / $line->planned_workload,2)', $filterprogresscalc, 1, 1).' {return 1;} else {return 0;}';
|
||||
}
|
||||
if ($search_task_budget_amount) {
|
||||
$morewherefilterarray[]= natural_search('t.budget_amount', $search_task_budget_amount, 1, 1);
|
||||
}
|
||||
//var_dump($morewherefilterarray);
|
||||
|
||||
$morewherefilter = '';
|
||||
if (count($morewherefilterarray) > 0) {
|
||||
@@ -903,14 +901,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
|
||||
}
|
||||
|
||||
// Filter on categories
|
||||
// Filter on assigned users
|
||||
$moreforfilter = '';
|
||||
if (count($tasksarray) > 0) {
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= img_picto('', 'user', 'class="pictofixedwidth"');
|
||||
$moreforfilter .= $form->select_dolusers($tmpuser->id > 0 ? $tmpuser->id : '', 'search_user_id', $langs->trans("TasksAssignedTo"), null, 0, '', '');
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
if ($moreforfilter) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
@@ -1128,7 +1124,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, $arrayofselected);
|
||||
$nboftaskshown = projectLinesa($j, 0, $tasksarray, $level, true, 0, $tasksrole, $object->id, 1, $object->id, '', ($object->usage_bill_time ? 1 : 0), $arrayfields, $arrayofselected);
|
||||
} else {
|
||||
$colspan = count($arrayfields);
|
||||
if ($object->usage_bill_time) {
|
||||
|
||||
@@ -114,8 +114,10 @@ class Stripe extends CommonObject
|
||||
$obj = $this->db->fetch_object($result);
|
||||
$tokenstring = $obj->tokenstring;
|
||||
|
||||
if ($tokenstring) {
|
||||
$tmparray = json_decode($tokenstring);
|
||||
$key = empty($tmparray->stripe_user_id) ? '' : $tmparray->stripe_user_id;
|
||||
}
|
||||
} else {
|
||||
$tokenstring = '';
|
||||
}
|
||||
@@ -124,6 +126,7 @@ class Stripe extends CommonObject
|
||||
}
|
||||
|
||||
dol_syslog("No dedicated Stripe Connect account available for entity ".$conf->entity);
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user