Skip to content

Commit

Permalink
Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
	htdocs/filefunc.inc.php
  • Loading branch information
eldy committed Nov 6, 2018
2 parents 1e801c7 + 7e33af6 commit e0070bd
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 8 deletions.
24 changes: 23 additions & 1 deletion htdocs/admin/modules.php
Expand Up @@ -41,6 +41,7 @@
$mode=GETPOST('mode', 'alpha');
if (empty($mode)) $mode='common';
$action=GETPOST('action','alpha');
//var_dump($_POST);exit;
$value=GETPOST('value', 'alpha');
$page_y=GETPOST('page_y','int');
$search_keyword=GETPOST('search_keyword','alpha');
Expand Down Expand Up @@ -1010,8 +1011,29 @@
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="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 '</form>';

print '<br>';
Expand Down
1 change: 1 addition & 0 deletions htdocs/core/class/html.formfile.class.php
Expand Up @@ -132,6 +132,7 @@ function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm

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).'">';
}

Expand Down
14 changes: 10 additions & 4 deletions htdocs/core/class/html.formprojet.class.php
Expand Up @@ -317,25 +317,31 @@ function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $m
* @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 $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
*/
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;

require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';

if (is_null($usertofilter))
{
$usertofilter = $user;
}

$out='';

$hideunselectables = false;
if (! empty($conf->global->CONTRACT_HIDE_UNSELECTABLES)) $hideunselectables = true;

if (empty($projectsListId))
{
if (empty($user->rights->projet->all->lire))
if (empty($usertofilter->rights->projet->all->lire))
{
$projectstatic=new Project($this->db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter,0,1);
}
}

Expand Down Expand Up @@ -381,7 +387,7 @@ function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24,
{
$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 ($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
}
Expand Down
1 change: 0 additions & 1 deletion htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
Expand Up @@ -147,7 +147,6 @@ function __construct($db=0)
$this->posxpuht=$this->page_largeur - $this->marge_droite;

if (!empty($conf->global->SHIPPING_PDF_DISPLAY_AMOUNT_HT)) { // Show also the prices

$this->posxweightvol=$this->page_largeur - $this->marge_droite - 118;
$this->posxqtyordered=$this->page_largeur - $this->marge_droite - 96;
$this->posxqtytoship=$this->page_largeur - $this->marge_droite - 68;
Expand Down
2 changes: 1 addition & 1 deletion htdocs/projet/activity/perday.php
Expand Up @@ -416,7 +416,7 @@
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
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 ' ';
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone');
Expand Down
2 changes: 1 addition & 1 deletion htdocs/projet/activity/perweek.php
Expand Up @@ -418,7 +418,7 @@
$titleassigntask = $langs->transnoentities("AssignTaskToMe");
if ($usertoprocess->id != $user->id) $titleassigntask = $langs->transnoentities("AssignTaskToUser", $usertoprocess->getFullName($langs));
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 ' ';
print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone');
Expand Down

0 comments on commit e0070bd

Please sign in to comment.