Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Juanjo Menent 2018-12-07 11:40:21 +01:00
commit 75780483c3
11 changed files with 70 additions and 23 deletions

View File

@ -380,11 +380,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$sourcedir = $object->source_directory;
$targetdir = ($object->target_directory ? $object->target_directory : ''); // Can be '[Gmail]/Trash' or 'mytag'
$connectstringserver = $object->getConnectStringIMAP();
$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir);
$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir);
$connection = null;
$connectstringserver = '';
$connectstringsource = '';
$connectstringtarget = '';
if (function_exists('imap_open'))
{
$connectstringserver = $object->getConnectStringIMAP();
$connectstringsource = $connectstringserver.imap_utf7_encode($sourcedir);
$connectstringtarget = $connectstringserver.imap_utf7_encode($targetdir);
$connection = imap_open($connectstringsource, $object->user, $object->password);
$connection = imap_open($connectstringsource, $object->user, $object->password);
}
else
{
$morehtml .= 'IMAP functions not available on your PHP';
}
if (! $connection)
{
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
@ -395,8 +408,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtml .= imap_num_msg($connection);
}
imap_close($connection);
if ($connection)
{
imap_close($connection);
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref.'<div class="refidno">'.$morehtml.'</div>', '', 0, '', '', 0, '');
print '<div class="fichecenter">';

View File

@ -142,7 +142,7 @@ function dol_hash($chain, $type='0')
* If constant MAIN_SECURITY_HASH_ALGO is defined, we use this function as hashing function.
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt.
*
* @param string $chain String to hash
* @param string $chain String to hash (not hashed string)
* @param string $hash hash to compare
* @param string $type Type of hash ('0':auto, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
* @return bool True if the computed hash is the same as the given one

View File

@ -150,6 +150,9 @@ UPDATE llx_c_payment_term SET decalage = nbjour, nbjour = 0 where decalage IS NU
UPDATE llx_holiday SET ref = rowid WHERE ref IS NULL;
-- DROP TABLE llx_emailcollector_emailcollectorfilter;
-- DROP TABLE llx_emailcollector_emailcollectoraction;
-- DROP TABLE llx_emailcollector_emailcollector;
CREATE TABLE llx_emailcollector_emailcollector(
-- BEGIN MODULEBUILDER FIELDS

View File

@ -4848,16 +4848,20 @@ function migrate_user_photospath()
{
while ($obj = $db->fetch_object($resql))
{
print '.';
$fuser->fetch($obj->uid);
//echo '<hr>'.$fuser->id.' -> '.$fuser->entity;
$entity = (!empty($fuser->entity)) ? $fuser->entity : 1;
$entity = (empty($fuser->entity) ? 1 : $fuser->entity);
if ($entity > 1) {
$dir = DOL_DATA_ROOT . '/' . $entity . '/users';
} else {
$dir = $conf->user->multidir_output[$entity]; // $conf->user->multidir_output[] for each entity is construct by the multicompany module
}
if ($dir)
{
$origin = $dir .'/'. get_exdir($fuser->id,2,0,0,$fuser,'user');
$destin = $dir.'/'.$fuser->id;
$destin = $dir .'/'. $fuser->id;
$error = 0;
@ -4895,6 +4899,7 @@ function migrate_user_photospath()
}
}
}
}
}
}

View File

@ -56,6 +56,7 @@ WorkloadNotDefined=Workload not defined
NewTimeSpent=Time spent
MyTimeSpent=My time spent
BillTime=Bill the time spent
BillTimeShort=Bill time
Tasks=Tasks
Task=Task
TaskDateStart=Task start date

View File

@ -618,9 +618,9 @@ if ($action == 'create' && $user->rights->projet->creer)
print '<td>';
print '<textarea name="description" wrap="soft" class="centpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST("description",'none')).'</textarea>';
print '</td></tr>';
var_dump($conf->global->PROJECT_USE_TASKS);
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td>';
print '<td><input type="checkbox" name="bill_time"'.(GETPOST('bill_time','alpha')!=''?' checked="checked"':'').'"></td>';
@ -855,7 +855,7 @@ elseif ($object->id > 0)
print '</td></tr>';
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td>';
print '<td><input type="checkbox" name="bill_time"'.((GETPOSTISSET('bill_time')?GETPOST('bill_time','alpha'):$object->bill_time) ? ' checked="checked"' : '').'"></td>';
@ -985,7 +985,7 @@ elseif ($object->id > 0)
print '</td></tr>';
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td>';
print '<td>'.yn($object->bill_time).'</td>';

View File

@ -241,7 +241,7 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>';
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($object->bill_time);

View File

@ -218,7 +218,7 @@ print nl2br($object->description);
print '</td></tr>';
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($object->bill_time);

View File

@ -128,6 +128,7 @@ $arrayfields=array(
'p.fk_opp_status'=>array('label'=>$langs->trans("OpportunityStatusShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>104),
'p.opp_percent'=>array('label'=>$langs->trans("OpportunityProbabilityShort"), 'checked'=>1, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>105),
'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110),
'p.bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115),
'p.datec'=>array('label'=>$langs->trans("DateCreationShort"), 'checked'=>0, 'position'=>500),
'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
'p.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
@ -279,7 +280,7 @@ if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0';
$distinct='DISTINCT'; // We add distinct until we are added a protection to be sure a contact of a project and task is only once.
$sql = "SELECT ".$distinct." p.rowid as id, p.ref, p.title, p.fk_statut, p.fk_opp_status, p.public, p.fk_user_creat";
$sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount";
$sql.= ", p.datec as date_creation, p.dateo as date_start, p.datee as date_end, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount, p.bill_time";
$sql.= ", s.nom as name, s.rowid as socid";
$sql.= ", cls.code as opp_status_code";
// We'll need these fields in order to filter by categ
@ -620,6 +621,12 @@ if (! empty($arrayfields['p.budget_amount']['checked']))
print '<input type="text" class="flat" name="search_budget_amount" size="4" value="'.$search_budget_amount.'">';
print '</td>';
}
if (! empty($arrayfields['p.bill_time']['checked']))
{
print '<td class="liste_titre nowrap" align="right">';
print '';
print '</td>';
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
@ -669,6 +676,7 @@ if (! empty($arrayfields['p.fk_opp_status']['checked'])) print_liste_field_titre
if (! empty($arrayfields['p.opp_amount']['checked'])) print_liste_field_titre($arrayfields['p.opp_amount']['label'],$_SERVER["PHP_SELF"],'p.opp_amount',"",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['p.opp_percent']['checked'])) print_liste_field_titre($arrayfields['p.opp_percent']['label'],$_SERVER["PHP_SELF"],'p.opp_percent',"",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['p.budget_amount']['checked'])) print_liste_field_titre($arrayfields['p.budget_amount']['label'],$_SERVER["PHP_SELF"],'p.budget_amount',"",$param,'align="right"',$sortfield,$sortorder);
if (! empty($arrayfields['p.bill_time']['checked'])) print_liste_field_titre($arrayfields['p.bill_time']['label'],$_SERVER["PHP_SELF"],'p.bill_time',"",$param,'align="right"',$sortfield,$sortorder);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
// Hook fields
@ -847,6 +855,17 @@ while ($i < min($num,$limit))
if (! $i) $totalarray['nbfield']++;
if (! $i) $totalarray['totalbudgetfield']=$totalarray['nbfield'];
}
// Bill time
if (! empty($arrayfields['p.bill_time']['checked']))
{
print '<td align="right">';
if ($obj->bill_time)
{
print yn($obj->bill_time);
}
print '</td>';
if (! $i) $totalarray['nbfield']++;
}
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
// Fields from hook

View File

@ -417,7 +417,7 @@ if ($id > 0 || ! empty($ref))
print '</td></tr>';
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($object->bill_time);

View File

@ -400,7 +400,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
print '</td></tr>';
// Bill time
if (! empty($conf->global->PROJECT_BILL_TIME_SPENT))
if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_BILL_TIME_SPENT))
{
print '<tr><td>'.$langs->trans("BillTime").'</td><td>';
print yn($projectstatic->bill_time);
@ -515,7 +515,10 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
// Planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td>';
print convertSecondToTime($object->planned_workload,'allhourmin');
if ($object->planned_workload)
{
print convertSecondToTime($object->planned_workload,'allhourmin');
}
print '</td></tr>';
print '</table>';
@ -528,7 +531,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
// Progress declared
print '<tr><td class="titlefield">'.$langs->trans("ProgressDeclared").'</td><td>';
print $object->progress.' %';
print $object->progress != '' ? $object->progress.' %' : '';
print '</td></tr>';
// Progress calculated
@ -661,7 +664,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$arrayfields['t.note']=array('label'=>$langs->trans("Note"), 'checked'=>1);
$arrayfields['t.task_duration']=array('label'=>$langs->trans("Duration"), 'checked'=>1);
$arrayfields['value'] =array('label'=>$langs->trans("Value"), 'checked'=>1, 'enabled'=>(empty($conf->salaries->enabled)?0:1));
$arrayfields['valuebilled'] =array('label'=>$langs->trans("AmountInvoiced"), 'checked'=>1, 'enabled'=>(empty($conf->global->PROJECT_BILL_TIME_SPENT)?0:1));
$arrayfields['valuebilled'] =array('label'=>$langs->trans("AmountInvoiced"), 'checked'=>1, 'enabled'=>((! empty($conf->global->PROJECT_HIDE_TASKS) || empty($conf->global->PROJECT_BILL_TIME_SPENT))?0:1));
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
@ -678,7 +681,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$sql = "SELECT t.rowid, t.fk_task, t.task_date, t.task_datehour, t.task_date_withhour, t.task_duration, t.fk_user, t.note, t.thm,";
$sql .= " pt.ref, pt.label,";
$sql .= " u.lastname, u.firstname, u.login, u.photo,";
$sql .= " u.lastname, u.firstname, u.login, u.photo, u.statut as user_status,";
$sql .= " il.fk_facture as invoice_id, il.total_ht";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facturedet as il ON il.rowid = t.invoice_line_id";
@ -960,7 +963,6 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$totalarray=array();
foreach ($tasks as $task_time)
{
print '<tr class="oddeven">';
$date1=$db->jdate($task_time->task_date);
@ -1037,6 +1039,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
$userstatic->lastname = $task_time->lastname;
$userstatic->firstname = $task_time->firstname;
$userstatic->photo = $task_time->photo;
$userstatic->statut = $task_time->user_status;
print $userstatic->getNomUrl(-1);
}
print '</td>';