diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 5b532a3822f..f757663b6d5 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -25,41 +25,27 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/dav/dav.lib.php'; +$langs->loadLangs(array("admin","other","agenda")); if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("other"); -$langs->load("agenda"); +// Parameters +$action = GETPOST('action', 'alpha'); +$backtopage = GETPOST('backtopage', 'alpha'); -$def = array(); -$actionsave=GETPOST('save','alpha'); +$arrayofparameters=array('DAV_ALLOW_PUBLIC_DIR'=>array('css'=>'minwidth200')); -// Sauvegardes parametres -if ($actionsave) -{ - $i=0; - $db->begin(); +/* + * Actions + */ - $i+=dolibarr_set_const($db,'XXX',trim(GETPOST('XXX','alpha')),'chaine',0,'',$conf->entity); - - if ($i >= 4) - { - $db->commit(); - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { - $db->rollback(); - setEventMessages($langs->trans("SaveFailed"), null, 'errors'); - } -} +include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; -/** +/* * View */ @@ -77,30 +63,51 @@ $head=dav_admin_prepare_head(); dol_fiche_head($head, 'webdav', '', -1, 'action'); -print $langs->trans("WebDAVSetupDesc")."
\n"; -print "
\n"; -/* -print ''; +if ($action == 'edit') +{ + print ''; + print ''; + print ''; -print ''; -print ""; -print ""; -//print ""; -print ""; -print ""; + print '
".$langs->trans("Parameter")."".$langs->trans("Value")."".$langs->trans("Examples")." 
'; + print ''; -print ''; -print '"; -print ''; -print ""; -print ""; + foreach($arrayofparameters as $key => $val) + { + print ''; + } + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("PasswordTogetVCalExport")."'; -if (! empty($conf->use_javascript_ajax)) - print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); -print ' 
'; + print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip')); + print '
'; + + print '
'; + print ''; + print '
'; + + print ''; + print '
'; +} +else +{ + print ''; + print ''; + + foreach($arrayofparameters as $key => $val) + { + print ''; + } + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; + print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip')); + print '' . $conf->global->$key . '
'; + + print '
'; + print ''.$langs->trans("Modify").''; + print '
'; +} -print ''; -*/ dol_fiche_end(); @@ -113,7 +120,7 @@ print "\n"; clearstatcache(); -//if ($mesg) print "
$mesg
"; +print $langs->trans("WebDAVSetupDesc")."
\n"; print "
"; @@ -130,34 +137,6 @@ $message.=img_picto('','object_globe.png').' '.$langs->trans("WebDavServer",'Web $message.='
'; print $message; -/*$message =$langs->trans("AgendaUrlOptions1",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptions3",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptionsNotAdmin",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptionsProject",$user->login,$user->login).'
'; -$message.=$langs->trans("AgendaUrlOptionsNotAutoEvent",'systemauto','systemauto').'
'; - -print info_admin($message); -*/ - -/* -if (! empty($conf->use_javascript_ajax)) -{ - print "\n".''; -} -*/ llxFooter(); $db->close(); diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 1e8997fdae4..e52658d38e8 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1515,7 +1515,7 @@ class FactureRec extends CommonInvoice } /** - * Update the auto validate invoice + * Update the auto validate flag of invoice * * @param int $validate 0 to create in draft, 1 to create and validate invoice * @return int <0 if KO, >0 if OK diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index a25f1b9e584..d474da18a85 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2131,7 +2131,7 @@ else else print '
'.$langs->trans("Modify").'
'; } - if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) + if (! empty($conf->facture->enabled) && $object->statut > 0) { $langs->load("bills"); if ($user->rights->facture->creer) print '
'.$langs->trans("CreateBill").'
'; @@ -2199,7 +2199,7 @@ else $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; $genallowed = $user->rights->contrat->lire; $delallowed = $user->rights->contrat->creer; - + print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index ba0057324e9..ccd873ece8a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -642,16 +642,17 @@ class Form /** * Return combo list of activated countries, into language of user * - * @param string $selected Id or Code or Label of preselected country - * @param string $htmlname Name of html select object - * @param string $htmloption Options html on select object - * @param integer $maxlength Max length for labels (0=no limit) - * @param string $morecss More css class - * @param string $usecodeaskey 'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key - * @param int $showempty Show empty choice - * @return string HTML string with select + * @param string $selected Id or Code or Label of preselected country + * @param string $htmlname Name of html select object + * @param string $htmloption Options html on select object + * @param integer $maxlength Max length for labels (0=no limit) + * @param string $morecss More css class + * @param string $usecodeaskey 'code3'=Use code on 3 alpha as key, 'code2"=Use code on 2 alpha as key + * @param int $showempty Show empty choice + * @param int $disablefavorites Disable favorites + * @return string HTML string with select */ - function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1) + function select_country($selected='', $htmlname='country_id', $htmloption='', $maxlength=0, $morecss='minwidth300', $usecodeaskey='', $showempty=1, $disablefavorites=0) { global $conf,$langs; @@ -692,13 +693,14 @@ class Form $i++; } - array_multisort($favorite, SORT_DESC, $label, SORT_ASC, $countryArray); + if (empty($disablefavorites)) array_multisort($favorite, SORT_DESC, $label, SORT_ASC, $countryArray); + else $countryArray = dol_sort_array($countryArray, 'label'); foreach ($countryArray as $row) { if (empty($showempty) && empty($row['rowid'])) continue; - if ($row['favorite'] && $row['code_iso']) $atleastonefavorite++; + if (empty($disablefavorites) && $row['favorite'] && $row['code_iso']) $atleastonefavorite++; if (empty($row['favorite']) && $atleastonefavorite) { $atleastonefavorite=0; @@ -4774,8 +4776,8 @@ class Form * * @param timestamp $set_time Pre-selected date (must be a local PHP server timestamp), -1 to keep date not preselected, '' to use current date (emptydate must be 0). * @param string $prefix Prefix for fields name - * @param int $h 1=Show also hours (-1 has same effect, but hour and minutes are prefilled with 23:59 if $set_time = -1) - * @param int $m 1=Show also minutes + * @param int $h 1 or 2=Show also hours (2=hours on a new line), -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show hour always empty + * @param int $m 1=Show also minutes, -1 has same effect but hour and minutes are prefilled with 23:59 if date is empty, 3 show minutes always empty * @param int $empty 0=Fields required, 1=Empty inputs are allowed, 2=Empty inputs are allowed for hours only * @param string $form_name Not used * @param int $d 1=Show days, month, years @@ -4848,6 +4850,8 @@ class Form $smin = !isset($conf->global->MAIN_DEFAULT_DATE_MIN) ? ($h == -1 ? '59' : '') : $conf->global->MAIN_DEFAULT_DATE_MIN; $ssec = !isset($conf->global->MAIN_DEFAULT_DATE_SEC) ? ($h == -1 ? '59' : '') : $conf->global->MAIN_DEFAULT_DATE_SEC; } + if ($h == 3) $shour = ''; + if ($m == 3) $smin = ''; // You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery' $usecalendar='combo'; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 3d3f38eca2c..744a1326e69 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -454,6 +454,18 @@ function dol_is_file($pathoffile) return is_file($newpathoffile); } +/** + * Return if path is a symbolic link + * + * @param string $pathoffile Path of file + * @return boolean True or false + */ +function dol_is_link($pathoffile) +{ + $newpathoffile=dol_osencode($pathoffile); + return is_link($newpathoffile); +} + /** * Return if path is an URL * diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4cbb3043bda..dcf4b6fb998 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -542,6 +542,13 @@ function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=nu if (preg_match('/[^a-z0-9_\-\.]+/i',$out)) $out=''; } break; + case 'aZ09comma': // great to sanitize sortfield or sortorder params that can be t.abc,t.def_gh + if (! is_array($out)) + { + $out=trim($out); + if (preg_match('/[^a-z0-9_\-\.,]+/i',$out)) $out=''; + } + break; case 'array': if (! is_array($out) || empty($out)) $out=array(); break; @@ -3090,7 +3097,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ //if (in_array($picto, array('switch_off', 'switch_on', 'off', 'on'))) if (empty($srconly) && in_array($pictowithoutext, array( - 'bank', 'close_title', 'delete', 'edit', 'filter', 'grip', 'grip_title', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', + 'bank', 'close_title', 'delete', 'edit', 'ellipsis-h', 'filter', 'grip', 'grip_title', 'off', 'on', 'play', 'playdisabled', 'printer', 'resize', 'switch_off', 'switch_on', 'unlink', 'uparrow') )) { $fakey = $pictowithoutext; diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index c82839d8499..06d0b7aa6d3 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -893,8 +893,9 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id)) { print ''."\n"; - print ''; - print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + print ''; + print $projectstatic->getNomUrl(1,'',0,''.$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1); if ($projectstatic->title) { print ' - '; @@ -916,14 +917,14 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr */ // Project - print ""; + /*print ""; if ($oldprojectforbreak == -1) print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); - print ""; + print "";*/ // Thirdparty - print ''; + /*print ''; if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project', 10); - print ''; + print '';*/ // Ref print ''; @@ -1176,8 +1177,9 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ if (empty($oldprojectforbreak) || ($oldprojectforbreak != -1 && $oldprojectforbreak != $projectstatic->id)) { print ''."\n"; - print ''; - print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + print ''; + print $projectstatic->getNomUrl(1,'',0,''.$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); + if ($thirdpartystatic->id > 0) print ' - '.$thirdpartystatic->getNomUrl(1); if ($projectstatic->title) { print ' - '; @@ -1199,14 +1201,14 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ */ // Project - print ''; + /*print ''; if ($oldprojectforbreak == -1) print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]); - print ""; + print "";*/ // Thirdparty - print ''; + /*print ''; if ($thirdpartystatic->id > 0) print $thirdpartystatic->getNomUrl(1, 'project'); - print ''; + print '';*/ // Ref print ''; diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php index cede86796a0..77525a0b0d1 100644 --- a/htdocs/core/modules/modDav.class.php +++ b/htdocs/core/modules/modDav.class.php @@ -96,7 +96,7 @@ class modDav extends DolibarrModules // Data directories to create when module is enabled. // Example: this->dirs = array("/dav/temp","/dav/subdir"); - $this->dirs = array("/dav/temp","/dav/public"); + $this->dirs = array("/dav/temp","/dav/public","/dav/private"); // Config pages. Put here list of php page, stored into dav/admin directory, to use to setup module. $this->config_page_url = array("dav.php"); diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php index a785fac0ab9..cd19fc294ec 100644 --- a/htdocs/dav/fileserver.php +++ b/htdocs/dav/fileserver.php @@ -52,7 +52,9 @@ if(empty($conf->dav->enabled)) // settings $publicDir = $conf->dav->dir_output.'/public'; -$tmpDir = $conf->dav->dir_output.'/tmp'; +$privateDir = $conf->dav->dir_output.'/private'; +$tmpDir = $conf->dav->dir_temp; +//var_dump($tmpDir);exit; // Authentication callback function $authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $password) @@ -96,7 +98,8 @@ $nodes = array(); // Enable directories and features according to DAV setup // / Public docs -$nodes[] = new \Sabre\DAV\FS\Directory($dolibarr_main_data_root. '/dav/public'); +if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) $nodes[] = new \Sabre\DAV\FS\Directory($dolibarr_main_data_root. '/dav/public'); +$nodes[] = new \Sabre\DAV\FS\Directory($dolibarr_main_data_root. '/dav/private'); // Principals Backend //$principalBackend = new \Sabre\DAVACL\PrincipalBackend\Dolibarr($user,$db); @@ -120,8 +123,14 @@ $baseUri = DOL_URL_ROOT.'/dav/fileserver.php/'; if (isset($baseUri)) $server->setBaseUri($baseUri); // Add authentication function -$server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend)); - +if ((empty($conf->global->DAV_ALLOW_PUBLIC_DIR) + || ! preg_match('/'.preg_quote(DOL_URL_ROOT.'/dav/fileserver.php/public','/').'/', $_SERVER["PHP_SELF"])) + && ! preg_match('/^sabreAction=asset&assetName=[a-zA-Z0-9%\-\/]+\.(png|css|woff|ico|ttf)$/', $_SERVER["QUERY_STRING"]) // URL for Sabre browser resources + ) +{ + //var_dump($_SERVER["QUERY_STRING"]);exit; + $server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend)); +} // Support for LOCK and UNLOCK $lockBackend = new \Sabre\DAV\Locks\Backend\File($tmpDir . '/.locksdb'); $lockPlugin = new \Sabre\DAV\Locks\Plugin($lockBackend); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1927008bad1..b02d90207cf 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1206,6 +1206,9 @@ MustBeUnique=Must be unique? MustBeMandatory=Mandatory to create third parties? MustBeInvoiceMandatory=Mandatory to validate invoices? TechnicalServicesProvided=Technical services provided +#####DAV ##### +WebDAVSetupDesc=This is the links to access the WebDAV directory. It contains a "public" dir open to any user knowing the URL (if public directory access allowed) and a "private" directory that need an existing login account/password to access to. +WebDavServer=Root URL of %s server : %s ##### Webcal setup ##### WebCalUrlForVCalExport=An export link to %s format is available at following link: %s ##### Invoices ##### @@ -1784,7 +1787,6 @@ MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF SetToYesIfGroupIsComputationOfOtherGroups=Set this to yes if this group is a computation of other groups EnterCalculationRuleIfPreviousFieldIsYes=Enter calculcation rule if previous field was set to Yes (For example 'CODEGRP1+CODEGRP2') SeveralLangugeVariatFound=Several language variants found -WebDavServer=URL of %s server : %s COMPANY_AQUARIUM_REMOVE_SPECIAL=Remove special characters COMPANY_AQUARIUM_CLEAN_REGEX=Regex filter to clean value (COMPANY_AQUARIUM_CLEAN_REGEX) ##### Resource #### diff --git a/htdocs/langs/en_US/opensurvey.lang b/htdocs/langs/en_US/opensurvey.lang index 1f8a90b5657..0819a077f71 100644 --- a/htdocs/langs/en_US/opensurvey.lang +++ b/htdocs/langs/en_US/opensurvey.lang @@ -57,4 +57,5 @@ ErrorInsertingComment=There was an error while inserting your comment MoreChoices=Enter more choices for the voters SurveyExpiredInfo=The poll has been closed or voting delay has expired. EmailSomeoneVoted=%s has filled a line.\nYou can find your poll at the link: \n%s -ShowSurvey=Show survey \ No newline at end of file +ShowSurvey=Show survey +UserMustBeSameThanUserUsedToVote=You must have voted and use the same user name, that the one used to vote, to post a comment \ No newline at end of file diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 43720614a2e..9e1c743f77f 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -70,6 +70,7 @@ $search_task_ref=GETPOST('search_task_ref', 'alpha'); $search_task_label=GETPOST('search_task_label', 'alpha'); $search_project_ref=GETPOST('search_project_ref', 'alpha'); $search_thirdparty=GETPOST('search_thirdparty', 'alpha'); +$search_declared_progress=GETPOST('search_declared_progress', 'alpha'); $monthofday=GETPOST('addtimemonth'); $dayofday=GETPOST('addtimeday'); @@ -113,6 +114,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_task_label = ''; $search_project_ref = ''; $search_thirdparty = ''; + $search_declared_progress = ''; } if (GETPOST("button_search_x",'alpha') || GETPOST("button_search.x",'alpha') || GETPOST("button_search",'alpha')) { @@ -331,6 +333,7 @@ if ($search_project_ref) $morewherefilter.=natural_search("p.ref", $search_proje if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label); if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty); +if ($search_declared_progress) $morewherefilter.=natural_search("t.progress", $search_declared_progress, 1); $tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. if ($morewherefilter) // Get all task without any filter, so we can show total of time spent for not visible tasks @@ -357,6 +360,7 @@ $param.=($search_task_label?'&search_task_label='.$search_task_label:''); // Show navigation bar $nav =''.img_previous($langs->trans("Previous"))."\n"; +$nav.=dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"%A").' '; $nav.=" ".dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"day")." \n"; $nav.=''.img_next($langs->trans("Next"))."\n"; $nav.="   (".$langs->trans("Today").")"; @@ -409,7 +413,7 @@ print '
'; $formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1); print '
'; print ' '; -print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth200'); +print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone'); print ''; print ''; @@ -433,9 +437,22 @@ $moreforfilter.='
'; $moreforfilter.='
'.$langs->trans('User'). '
'; $includeonly='hierachyme'; if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); -$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200 marginleftonly'); $moreforfilter.='
'; +if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) +{ + $moreforfilter.='
'; + $moreforfilter.='
'.$langs->trans('Project'). '
'; + $moreforfilter.=''; + $moreforfilter.='
'; + + $moreforfilter.='
'; + $moreforfilter.='
'.$langs->trans('ThirdParty'). '
'; + $moreforfilter.=''; + $moreforfilter.='
'; +} + if (! empty($moreforfilter)) { print '
'; @@ -451,12 +468,11 @@ print '
'; print ''."\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -470,9 +486,8 @@ print ''; print "\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; print ''; @@ -522,7 +537,7 @@ print ''; print ''; print "\n"; -$colspan = 8; +$colspan = 6+(empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:2);; if ($conf->use_javascript_ajax) { @@ -607,13 +622,9 @@ if (count($tasksarray) > 0) if ($isdiff) { print ''; - print ''; - print ''; - print ''; - print ''; - print ''; print ''; print '
'.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("Task").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").''.$langs->trans("Note").'
'; + print ''; print $langs->trans("OtherFilteredTasks"); print ''; $timeonothertasks=($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]); diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index b7d731d786b..61656d79eb5 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -70,6 +70,7 @@ $search_task_ref=GETPOST('search_task_ref', 'alpha'); $search_task_label=GETPOST('search_task_label', 'alpha'); $search_project_ref=GETPOST('search_project_ref', 'alpha'); $search_thirdparty=GETPOST('search_thirdparty', 'alpha'); +$search_declared_progress=GETPOST('search_declared_progress', 'alpha'); $startdayarray=dol_get_first_day_week($day, $month, $year); @@ -124,6 +125,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $search_task_label = ''; $search_project_ref = ''; $search_thirdparty = ''; + $search_declared_progress = ''; } if (GETPOST("button_search_x",'alpha') || GETPOST("button_search.x",'alpha') || GETPOST("button_search",'alpha')) { @@ -290,6 +292,7 @@ if ($action == 'addtime' && $user->rights->projet->lire) $param.=($search_project_ref?'&search_project_ref='.$search_project_ref:''); $param.=($search_usertoprocessid > 0?'&search_usertoprocessid='.$search_usertoprocessid:''); $param.=($search_thirdparty?'&search_thirdparty='.$search_thirdparty:''); + $param.=($search_declared_progress?'&search_declared_progress='.$search_declared_progress:''); $param.=($search_task_ref?'&search_task_ref='.$search_task_ref:''); $param.=($search_task_label?'&search_task_label='.$search_task_label:''); @@ -333,6 +336,7 @@ if ($search_project_ref) $morewherefilter.=natural_search("p.ref", $search_proje if ($search_task_ref) $morewherefilter.=natural_search("t.ref", $search_task_ref); if ($search_task_label) $morewherefilter.=natural_search(array("t.ref", "t.label"), $search_task_label); if ($search_thirdparty) $morewherefilter.=natural_search("s.nom", $search_thirdparty); +if ($search_declared_progress) $morewherefilter.=natural_search("t.progress", $search_declared_progress, 1); $tasksarray=$taskstatic->getTasksArray(0, 0, ($project->id?$project->id:0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid?$search_usertoprocessid:0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. if ($morewherefilter) // Get all task without any filter, so we can show total of time spent for not visible tasks @@ -411,7 +415,7 @@ print '
'; $formproject->selectTasks($socid?$socid:-1, $taskid, 'taskid', 32, 0, 1, 1); print '
'; print ' '; -print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth200'); +print $formcompany->selectTypeContact($object, '', 'type','internal','rowid', 0, 'maxwidth150onsmartphone'); print ''; print ''; @@ -471,6 +475,19 @@ if (empty($user->rights->user->user->lire)) $includeonly=array($user->id); $moreforfilter.=$form->select_dolusers($search_usertoprocessid?$search_usertoprocessid:$usertoprocess->id, 'search_usertoprocessid', $user->rights->user->user->lire?0:0, null, 0, $includeonly, null, 0, 0, 0, '', 0, '', 'maxwidth200'); $moreforfilter.=''; +if (empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) +{ + $moreforfilter.='
'; + $moreforfilter.='
'.$langs->trans('Project'). '
'; + $moreforfilter.=''; + $moreforfilter.='
'; + + $moreforfilter.='
'; + $moreforfilter.='
'.$langs->trans('ThirdParty'). '
'; + $moreforfilter.=''; + $moreforfilter.='
'; +} + if (! empty($moreforfilter)) { print '
'; @@ -485,12 +502,11 @@ print '
'; print ''."\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; for ($idw=0;$idw<7;$idw++) @@ -505,9 +521,8 @@ print ''; print "\n"; print ''; -print ''; -print ''; -//print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; +if (! empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)) print ''; print ''; print ''; print ''; @@ -540,7 +555,7 @@ for ($idw=0; $idw<7; $idw++) print ''; print "\n"; -$colspan=7; +$colspan=5+(empty($conf->global->PROJECT_TIMESHEET_DISABLEBREAK_ON_PROJECT)?0:2); if ($conf->use_javascript_ajax) { @@ -634,7 +649,7 @@ if (count($tasksarray) > 0) if ($isdiff) { print ''; - print ''; for ($idw = 0; $idw < 7; $idw++) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index e29a1d6826e..67dd84a1572 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -464,16 +464,16 @@ else if ($id > 0 || ! empty($ref)) { if ($object->public || $userWrite > 0) { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } else { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } } else { - $linktocreatetask = ''.$langs->trans('AddTask').''; + $linktocreatetask = ''.$langs->trans('AddTask').''; } diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 701a74760dd..0f2ec5f9fcd 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -420,16 +420,16 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) { if ($projectstatic->public || $userWrite > 0) { - $linktocreatetime = ''.$langs->trans('AddTimeSpent').''; + $linktocreatetime = ''.$langs->trans('AddTimeSpent').''; } else { - $linktocreatetime = ''.$langs->trans('AddTime').''; + $linktocreatetime = ''.$langs->trans('AddTime').''; } } else { - $linktocreatetime = ''.$langs->trans('AddTime').''; + $linktocreatetime = ''.$langs->trans('AddTime').''; } //} } @@ -949,7 +949,11 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print '
'.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("RefTask").''.$langs->trans("Project").''.$langs->trans("ThirdParty").''.$langs->trans("Task").''.$langs->trans("PlannedWorkload").''.$langs->trans("ProgressDeclared").'
'; + print ''; print $langs->trans("OtherFilteredTasks"); print ''; if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid) { - print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1); + if (empty($task_time->task_date_withhour)) + { + print $form->select_date(($date2?$date2:$date1),'timeline',3,3,2,"timespent_date",1,0,1); + } + else print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1); } else { @@ -1086,7 +1090,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print $hookmanager->resPrint; // Action column - print ''; + print ''; if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) { print ''; diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 742b949e27c..32cb5f2e1ba 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -66,22 +66,28 @@ if (GETPOST('ajoutcomment','alpha')) $error=0; - if (! GETPOST('comment','none')) + $comment = GETPOST("comment",'none'); + $comment_user = GETPOST('commentuser','nohtml'); + + if (! $comment) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors'); } - if (! GETPOST('commentuser','nohtml')) + if (! $comment_user) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), null, 'errors'); } + if (! in_array($comment_user, $listofvoters)) + { + setEventMessages($langs->trans("UserMustBeSameThanUserUsedToVote"), null, 'errors'); + $error++; + } + if (! $error) { - $comment = GETPOST("comment",'none'); - $comment_user = GETPOST('commentuser','nohtml'); - $resql = $object->addComment($comment, $comment_user); if (! $resql) dol_print_error($db); @@ -729,8 +735,12 @@ if ($comments) print "
" . $langs->trans("CommentsOfVoters") . ":
\n"; foreach ($comments as $obj) { + // ligne d'un usager pré-authentifié + //$mod_ok = (in_array($obj->name, $listofvoters)); + print '
'; - if (in_array($obj->usercomment, $listofvoters)) print ' '.img_picto('', 'delete.png').' '; + if (in_array($obj->usercomment, $listofvoters)) print ' '.img_picto('', 'delete.png', '', false, 0, 0, '', 'nomarginleft').' '; + //else print img_picto('', 'ellipsis-h', '', false, 0, 0, '', 'nomarginleft').' '; print dol_htmlentities($obj->usercomment).': '.dol_nl2br(dol_htmlentities($obj->comment))."
"; } } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b7fa85d5194..578ec142ad5 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -722,6 +722,9 @@ select.flat.selectlimit { .marginleftonly { margin-left: 10px !important; } +.nomarginleft { + margin-left: 0px !important; +} .selectlimit, .selectlimit:focus { border-left: none !important; border-top: none !important; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index fdc0a3e908b..0cafac9a6c2 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -716,6 +716,9 @@ select.flat.selectlimit { .marginleftonly { margin-left: 10px !important; } +.nomarginleft { + margin-left: 0px !important; +} .selectlimit, .selectlimit:focus { border-left: none !important; border-top: none !important;