This commit is contained in:
Maxime Kohlhaas 2017-06-20 22:16:19 +02:00
commit ea616114a9
5 changed files with 70 additions and 76 deletions

View File

@ -162,21 +162,13 @@ if ($type == 'directory')
// Auto area for suppliers invoices // Auto area for suppliers invoices
else if ($module == 'invoice') $upload_dir = $conf->facture->dir_output; else if ($module == 'invoice') $upload_dir = $conf->facture->dir_output;
// Auto area for suppliers invoices // Auto area for suppliers invoices
else if ($module == 'invoice_supplier') else if ($module == 'invoice_supplier') $upload_dir = $conf->fournisseur->facture->dir_output;
{
$relativepath='facture';
$upload_dir = $conf->fournisseur->dir_output.'/'.$relativepath;
}
// Auto area for customers orders // Auto area for customers orders
else if ($module == 'propal') $upload_dir = $conf->propal->dir_output; else if ($module == 'propal') $upload_dir = $conf->propal->dir_output;
// Auto area for customers orders // Auto area for customers orders
else if ($module == 'order') $upload_dir = $conf->commande->dir_output; else if ($module == 'order') $upload_dir = $conf->commande->dir_output;
// Auto area for suppliers orders // Auto area for suppliers orders
else if ($module == 'order_supplier') else if ($module == 'order_supplier') $upload_dir = $conf->fournisseur->commande->dir_output;
{
$relativepath='commande';
$upload_dir = $conf->fournisseur->dir_output.'/'.$relativepath;
}
// Auto area for suppliers invoices // Auto area for suppliers invoices
else if ($module == 'contract') $upload_dir = $conf->contrat->dir_output; else if ($module == 'contract') $upload_dir = $conf->contrat->dir_output;
// Auto area for products // Auto area for products
@ -197,10 +189,12 @@ if ($type == 'directory')
$param.='&module='.$module; $param.='&module='.$module;
$textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound"))); $textifempty=($section?$langs->trans("NoFileFound"):($showonrightsize=='featurenotyetavailable'?$langs->trans("FeatureNotYetAvailable"):$langs->trans("NoFileFound")));
if ($module == 'company') $excludefiles[]='^contact$'; // The subdir 'contact' contains files of contacts with no id of thirdparty.
$filearray=dol_dir_list($upload_dir,"files",1,'', $excludefiles, $sortfield, $sorting,1); $filearray=dol_dir_list($upload_dir,"files",1,'', $excludefiles, $sortfield, $sorting,1);
$formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url); $formfile->list_of_autoecmfiles($upload_dir,$filearray,$module,$param,1,'',$user->rights->ecm->upload,1,$textifempty,$maxlengthname,$url);
} }
//Manual area // Manual area
else else
{ {
$relativepath=$ecmdir->getRelativePath(); $relativepath=$ecmdir->getRelativePath();

View File

@ -1469,7 +1469,7 @@ abstract class CommonObject
$fieldname = 'multicurrency_code'; $fieldname = 'multicurrency_code';
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element; $sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
$sql .= ' SET '.$fieldname.' = "'.$this->db->escape($code).'"'; $sql .= ' SET '.$fieldname." = '".$this->db->escape($code)."'";
$sql .= ' WHERE rowid='.$this->id; $sql .= ' WHERE rowid='.$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))

View File

@ -206,7 +206,7 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_
$s = "\n// Add taks id=".$task["task_id"]." level = ".$level."\n"; $s = "\n// Add taks id=".$task["task_id"]." level = ".$level."\n";
// $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js($name)."','".$start_date."', '".$end_date."', '".$task['task_color']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]>0?1:0).", '".$parent."', 1, '".($depend?$depend:"")."', '".$note."'));"; // $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js($name)."','".$start_date."', '".$end_date."', '".$task['task_color']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]>0?1:0).", '".$parent."', 1, '".($depend?$depend:"")."', '".$note."'));";
// For JSGanttImproved // For JSGanttImproved
$s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js(trim($name))."','".$start_date."', '".$end_date."', '".$task['task_css']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]).", '".$parent."', 1, '".($depend?$depend:$parent."SS")."', '".($percent >= 0 ? $percent.'%' : '0%')."','".$task['note']."'));"; $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js(trim($name))."','".$start_date."', '".$end_date."', '".$task['task_css']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]).", '".$parent."', 1, '".($depend?$depend:$parent."SS")."', '".($percent >= 0 ? $percent.'%' : '0%')."','".dol_escape_js($task['note'])."'));";
echo $s; echo $s;

View File

@ -1392,7 +1392,7 @@ if ($action == 'create')
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; $morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
$morehtmlref.='<input type="hidden" name="action" value="classin">'; $morehtmlref.='<input type="hidden" name="action" value="classin">';
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; $morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
$morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref.=$formproject->select_projects((empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS)?$object->socid:-1), $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; $morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
$morehtmlref.='</form>'; $morehtmlref.='</form>';
} else { } else {