Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
	htdocs/filefunc.inc.php
This commit is contained in:
Laurent Destailleur 2018-11-06 18:30:57 +01:00
commit e0070bd348
6 changed files with 36 additions and 8 deletions

View File

@ -41,6 +41,7 @@ $langs->loadLangs(array("errors","admin","modulebuilder"));
$mode=GETPOST('mode', 'alpha'); $mode=GETPOST('mode', 'alpha');
if (empty($mode)) $mode='common'; if (empty($mode)) $mode='common';
$action=GETPOST('action','alpha'); $action=GETPOST('action','alpha');
//var_dump($_POST);exit;
$value=GETPOST('value', 'alpha'); $value=GETPOST('value', 'alpha');
$page_y=GETPOST('page_y','int'); $page_y=GETPOST('page_y','int');
$search_keyword=GETPOST('search_keyword','alpha'); $search_keyword=GETPOST('search_keyword','alpha');
@ -1010,8 +1011,29 @@ if ($mode == 'deploy')
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">'; print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
print '<input type="hidden" name="action" value="install">'; print '<input type="hidden" name="action" value="install">';
print '<input type="hidden" name="mode" value="deploy">'; print '<input type="hidden" name="mode" value="deploy">';
print $langs->trans("YouCanSubmitFile").' <input type="file" name="fileinstall"> ';
print $langs->trans("YouCanSubmitFile");
$max=$conf->global->MAIN_UPLOAD_DOC; // En Kb
$maxphp=@ini_get('upload_max_filesize'); // En inconnu
if (preg_match('/k$/i',$maxphp)) $maxphp=$maxphp*1;
if (preg_match('/m$/i',$maxphp)) $maxphp=$maxphp*1024;
if (preg_match('/g$/i',$maxphp)) $maxphp=$maxphp*1024*1024;
if (preg_match('/t$/i',$maxphp)) $maxphp=$maxphp*1024*1024*1024;
// Now $max and $maxphp are in Kb
$maxmin = $max;
if ($maxphp > 0) $maxmin=min($max,$maxphp);
if ($maxmin > 0)
{
// MAX_FILE_SIZE doit précéder le champ input de type file
print '<input type="hidden" name="max_file_size" value="'.($maxmin*1024).'">';
}
print '<input class="flat minwidth400" type="file" name="fileinstall"> ';
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">'; print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
print '</form>'; print '</form>';
print '<br>'; print '<br>';

View File

@ -132,6 +132,7 @@ class FormFile
if ($maxmin > 0) if ($maxmin > 0)
{ {
// MAX_FILE_SIZE doit précéder le champ input de type file
$out .= '<input type="hidden" name="max_file_size" value="'.($maxmin*1024).'">'; $out .= '<input type="hidden" name="max_file_size" value="'.($maxmin*1024).'">';
} }

View File

@ -317,14 +317,20 @@ class FormProjets
* @param string $morecss More css added to the select component * @param string $morecss More css added to the select component
* @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids. * @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids.
* @param string $showproject 'all' = Show project info, ''=Hide project info * @param string $showproject 'all' = Show project info, ''=Hide project info
* @param User $usertofilter User object to use for filtering
* @return int Nbr of project if OK, <0 if KO * @return int Nbr of project if OK, <0 if KO
*/ */
function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all') function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all', $usertofilter=null)
{ {
global $user,$conf,$langs; global $user,$conf,$langs;
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
if (is_null($usertofilter))
{
$usertofilter = $user;
}
$out=''; $out='';
$hideunselectables = false; $hideunselectables = false;
@ -332,10 +338,10 @@ class FormProjets
if (empty($projectsListId)) if (empty($projectsListId))
{ {
if (empty($user->rights->projet->all->lire)) if (empty($usertofilter->rights->projet->all->lire))
{ {
$projectstatic=new Project($this->db); $projectstatic=new Project($this->db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter,0,1);
} }
} }
@ -381,7 +387,7 @@ class FormProjets
{ {
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
// If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project. // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project.
if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire)) if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($usertofilter->rights->societe->lire))
{ {
// Do nothing // Do nothing
} }

View File

@ -147,7 +147,6 @@ class pdf_rouget extends ModelePdfExpedition
$this->posxpuht=$this->page_largeur - $this->marge_droite; $this->posxpuht=$this->page_largeur - $this->marge_droite;
if (!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT)) { // Show also the prices if (!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT)) { // Show also the prices
$this->posxweightvol=$this->page_largeur - $this->marge_droite - 118; $this->posxweightvol=$this->page_largeur - $this->marge_droite - 118;
$this->posxqtyordered=$this->page_largeur - $this->marge_droite - 96; $this->posxqtyordered=$this->page_largeur - $this->marge_droite - 96;
$this->posxqtytoship=$this->page_largeur - $this->marge_droite - 68; $this->posxqtytoship=$this->page_largeur - $this->marge_droite - 68;

View File

@ -416,7 +416,7 @@ print '<div class="colorback float valignmiddle">';
$titleassigntask = $langs->transnoentities("AssignTaskToMe"); $titleassigntask = $langs->transnoentities("AssignTaskToMe");
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
print '<div class="taskiddiv inline-block">'; print '<div class="taskiddiv inline-block">';
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1); $formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1, 0, 0, '', '', 'all', $usertoprocess);
print '</div>'; print '</div>';
print ' '; print ' ';
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone'); print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone');

View File

@ -418,7 +418,7 @@ print '<div class="colorback float valignmiddle">';
$titleassigntask = $langs->transnoentities("AssignTaskToMe"); $titleassigntask = $langs->transnoentities("AssignTaskToMe");
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs)); if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
print '<div class="taskiddiv inline-block">'; print '<div class="taskiddiv inline-block">';
$formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1); $formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1, 0, 0, '', '', 'all', $usertoprocess);
print '</div>'; print '</div>';
print ' '; print ' ';
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone'); print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone');