diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php deleted file mode 100644 index 03b33b19eb1..00000000000 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ /dev/null @@ -1,86 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * or see http://www.gnu.org/ - */ - -/** - * \file htdocs/core/actions_setnotes.inc.php - * \brief Code for actions on setting notes of object page - */ - - -// $action must be defined -// $_FILES may be defined -// $nomessageinsetmoduleoptions can be set to 1 - -// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) -if ($action == 'setModuleOptions') -{ - $db->begin(); - - // Process common param fields - foreach($_POST as $key => $val) - { - if (preg_match('/^param(\d*)$/', $key, $reg)) // Works for POST['param'], POST['param1'], POST['param2'], ... - { - $param=GETPOST("param".$reg[1],'alpha'); - $value=GETPOST("value".$reg[1],'alpha'); - if ($param) - { - $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; - } - } - } - - // Process upload fields - if (GETPOST('upload','alpha') && GETPOST('keyforuploaddir','aZ09')) - { - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $keyforuploaddir=GETPOST('keyforuploaddir','aZ09'); - $listofdir=explode(',',preg_replace('/[\r\n]+/',',',trim($conf->global->$keyforuploaddir))); - foreach($listofdir as $key=>$tmpdir) - { - $tmpdir=trim($tmpdir); - $tmpdir=preg_replace('/DOL_DATA_ROOT/',DOL_DATA_ROOT,$tmpdir); - if (! $tmpdir) { - unset($listofdir[$key]); continue; - } - if (! is_dir($tmpdir)) $texttitle.=img_warning($langs->trans("ErrorDirNotFound",$tmpdir),0); - else - { - $upload_dir=$tmpdir; - } - } - if ($upload_dir) - { - $result = dol_add_file_process($upload_dir, 0, 1, 'uploadfile', ''); - if ($result <= 0) $error++; - } - } - - if (! $error) - { - $db->commit(); - if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { - $db->rollback(); - if (empty($nomessageinsetmoduleoptions)) setEventMessages($langs->trans("SetupNotSaved"), null, 'errors'); - } -} - diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cf6ae18f568..34693cba67a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1391,7 +1391,7 @@ class Form * @deprecated * @see select_dolusers() */ - function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude='',$disabled=0,$include='',$enableonly='',$force_entity=0) + function select_users($selected='',$htmlname='userid',$show_empty=0,$exclude=null,$disabled=0,$include='',$enableonly='',$force_entity=0) { print $this->select_dolusers($selected,$htmlname,$show_empty,$exclude,$disabled,$include,$enableonly,$force_entity); } @@ -1411,13 +1411,13 @@ class Form * @param int $showstatus 0=show user status only if status is disabled, 1=always show user status into label, -1=never show user status * @param string $morefilter Add more filters into sql request * @param integer $show_every 0=default list, 1=add also a value "Everybody" at beginning of list - * @param string $enableonlytext If option $enableonly is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. + * @param string $enableonlytext If option $enableonlytext is set, we use this text to explain into label why record is disabled. Not used if enableonly is empty. * @param string $morecss More css * @param int $noactive Show only active users (this will also happened whatever is this option if USER_HIDE_INACTIVE_IN_COMBOBOX is on). * @return string HTML select string * @see select_dolgroups */ - function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0) + function select_dolusers($selected='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='', $show_every=0, $enableonlytext='', $morecss='', $noactive=0) { global $conf,$user,$langs; @@ -1613,7 +1613,7 @@ class Form * @return string HTML select string * @see select_dolgroups */ - function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude='', $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='') + function select_dolusers_forevent($action='', $htmlname='userid', $show_empty=0, $exclude=null, $disabled=0, $include='', $enableonly='', $force_entity=0, $maxlength=0, $showstatus=0, $morefilter='') { global $conf,$user,$langs; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index bcff0981a70..88ebb816a31 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -358,7 +358,7 @@ class FormCompany * * @param string $selected Title preselected * @param string $htmlname Name of HTML select combo field - * @param string $morecss Add more css on SELECT element + * @param string $morecss Add more css on SELECT element * @return string String with HTML select */ function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100') @@ -563,11 +563,11 @@ class FormCompany $events=array(); // Add an entry 'method' to say 'yes, we must execute url with param action = method'; // Add an entry 'url' to say which url to execute - // Add an entry htmlname to say which element we must change once url is called - // Add entry params => array('cssid' => 'attr') to say to remov or add attribute attr if answer of url return 0 or >0 lines + // Add an entry htmlname to say which element we must change once url is called + // Add entry params => array('cssid' => 'attr') to say to remov or add attribute attr if answer of url return 0 or >0 lines // To refresh contacts list on thirdparty list change $events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); - + if (count($events)) // If there is some ajax events to run once selection is done, we add code here to run events { print ''; } -elseif ($object->id > 0) +elseif ($object->id > 0) { /* * Show or edit */ - + $res=$object->fetch_optionals($object->id,$extralabels); // To verify role of users @@ -711,10 +711,11 @@ elseif ($object->id > 0) print ''; $head=project_prepare_head($object); - dol_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public?'projectpub':'project')); if ($action == 'edit' && $userWrite > 0) { + dol_fiche_head($head, 'project', $langs->trans("Project"), 0, ($object->public?'projectpub':'project')); + print ''; // Ref @@ -835,27 +836,30 @@ elseif ($object->id > 0) } else { + dol_fiche_head($head, 'project', $langs->trans("Project"), -1, ($object->public?'projectpub':'project')); + // Project card - + $linkback = ''.$langs->trans("BackToList").''; - + $morehtmlref='
'; // Title $morehtmlref.=$object->title; // Thirdparty - if ($object->thirdparty->id > 0) + $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : '; + if ($object->thirdparty->id > 0) { - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'project'); + $morehtmlref .= $object->thirdparty->getNomUrl(1, 'project'); } $morehtmlref.='
'; - + // Define a complementary filter for search of next/prev ref. if (! $user->rights->projet->all->lire) { $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0); $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")"; } - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -889,7 +893,7 @@ elseif ($object->id > 0) if (strcmp($object->opp_amount,'')) print price($object->opp_amount,0,$langs,1,0,0,$conf->currency); print ''; } - + // Date start - end print ''; - + // Budget print '
'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").''; $start = dol_print_date($object->date_start,'dayhour'); @@ -899,7 +903,7 @@ elseif ($object->id > 0) print ($end?$end:'?'); if ($object->hasDelay()) print img_warning("Late"); print '
'.$langs->trans("Budget").''; if (strcmp($object->budget_amount, '')) print price($object->budget_amount,0,$langs,1,0,0,$conf->currency); @@ -908,16 +912,16 @@ elseif ($object->id > 0) // Other attributes $cols = 2; include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; - + print '
'; - + print ''; print '
'; print '
'; print '
'; - + print ''; - + // Description print '"; } - + print '
'.$langs->trans("Description").''; print nl2br($object->description); @@ -929,13 +933,13 @@ elseif ($object->id > 0) print $form->showCategories($object->id,'project',1); print "
'; - + print '
'; print '
'; print ''; - + print '
'; } @@ -956,7 +960,7 @@ elseif ($object->id > 0) { $defaultcheckedwhenoppclose=1; if (empty($conf->global->PROJECT_HIDE_TASKS)) $defaultcheckedwhenoppclose=0; - + print ''; print '