diff --git a/dev/dolibarr_changes.txt b/dev/dolibarr_changes.txt index 204988c5442..cbfecbbc19f 100644 --- a/dev/dolibarr_changes.txt +++ b/dev/dolibarr_changes.txt @@ -275,6 +275,13 @@ RESTLER: with $loaders = array_unique(static::$rogueLoaders, SORT_REGULAR); + +* Replace CommentParser.php line 423 + elseif (count($value) && is_numeric($value[0])) + + with + + elseif (count($value) && isset($value[0]) && is_numeric($value[0])) +With swagger 2 provided into /explorer: diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 5c1a356e102..6453210e596 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -511,7 +511,7 @@ $tabcond[25] = !empty($conf->website->enabled); //$tabcond[26]= !empty($conf->product->enabled); $tabcond[27] = !empty($conf->societe->enabled); $tabcond[28] = !empty($conf->holiday->enabled); -$tabcond[29] = !empty($conf->projet->enabled); +$tabcond[29] = !empty($conf->project->enabled); $tabcond[30] = !empty($conf->label->enabled); //$tabcond[31]= !empty($conf->accounting->enabled); $tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled)); diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 4f3cf10e77b..ab4f0c7def0 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -550,7 +550,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea 'recordjoinpiece'=>'AttachJoinedDocumentsToObject', 'recordevent'=>'RecordEvent'); $arrayoftypesnocondition = $arrayoftypes; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $arrayoftypes['project'] = 'CreateLeadAndThirdParty'; } $arrayoftypesnocondition['project'] = 'CreateLeadAndThirdParty'; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index fc63940f0b8..e5169ce55cc 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -148,7 +148,7 @@ if ($action == 'updateMask') { $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); $res3 = 0; - if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided + if (!empty($conf->project->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity); } @@ -471,7 +471,7 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm print ''; print ''."\n"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { print ''; print $langs->trans('ProjectIsRequiredOnExpenseReports'); print ''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 619a5003161..e01c3142cc0 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -185,7 +185,7 @@ if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->re if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) { $elementList['thirdparty'] = img_picto('', 'company', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToThirdparty')); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $elementList['project'] = img_picto('', 'project', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToProject')); } if (!empty($conf->propal->enabled) && !empty($user->rights->propal->lire)) { diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 8729fce71d3..b95f73a399f 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -108,7 +108,7 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity); } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { if (GETPOST('PDF_SHOW_PROJECT_REF_OR_LABEL') == 'no') { dolibarr_del_const($db, "PDF_SHOW_PROJECT", $conf->entity); dolibarr_del_const($db, "PDF_SHOW_PROJECT_TITLE", $conf->entity); @@ -482,7 +482,7 @@ print ''; // Show project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { print ''.$langs->trans("PDF_SHOW_PROJECT").''; $tmparray = array('no' => 'No', 'showprojectref' => 'RefProject', 'showprojectlabel' => 'ShowProjectLabel'); $showprojectref = empty($conf->global->PDF_SHOW_PROJECT) ? (empty($conf->global->PDF_SHOW_PROJECT_TITLE) ? 'no' : 'showprojectlabel') : 'showprojectref'; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index 53760aaa586..5f51bccb240 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -95,7 +95,7 @@ $tabfield[1] = "ref,description,virtualhost,position,date_creation"; // Nom des champs d'edition pour modification d'un enregistrement $tabfieldvalue = array(); -$tabfieldvalue[1] = "ref,description,virtualhost,position"; +$tabfieldvalue[1] = "ref,description,virtualhost,position,entity"; // Nom des champs dans la table pour insertion d'un enregistrement $tabfieldinsert = array(); diff --git a/htdocs/asset/model/card.php b/htdocs/asset/model/card.php index f4cf1074dd2..3d3ec2f67d2 100644 --- a/htdocs/asset/model/card.php +++ b/htdocs/asset/model/card.php @@ -300,7 +300,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } // Clone - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&token=' . newToken(), '', $permissiontoadd); + print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . (!empty($socid) ? '&socid=' . $socid : '') . '&action=clone&token=' . newToken(), '', $permissiontoadd); // Delete (need delete permission, or if draft, just need create/modify permission) print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd)); diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index bce63ed0625..d2c64eea0b6 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -150,7 +150,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index a5c9dd5cf68..ee619a589e3 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -476,7 +476,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b1ae9dee61b..351ab9212bc 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1234,7 +1234,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $projectid = GETPOST('projectid', 'int'); @@ -1737,7 +1737,7 @@ if ($id > 0) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print ''.$langs->trans("Project").''; @@ -1762,7 +1762,7 @@ if ($id > 0) { print ''; print ''.$langs->trans("LinkedObject").''; - if ($object->elementtype == 'task' && !empty($conf->projet->enabled)) { + if ($object->elementtype == 'task' && !empty($conf->project->enabled)) { print ''; $urloption = '?action=create&donotclearsession=1'; // we use create not edit for more flexibility @@ -1946,7 +1946,7 @@ if ($id > 0) { // Thirdparty //$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
'.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').' '; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 38779e300ed..90ed4ea1944 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -159,7 +159,7 @@ if ($object->id > 0) { // Thirdparty //$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
'.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').': '; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index ec80dc90a4c..9fcb8375193 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -848,7 +848,6 @@ if ($resql) { $event->fk_project = $obj->fk_project; $event->socid = $obj->fk_soc; - $event->thirdparty_id = $obj->fk_soc; $event->contact_id = $obj->fk_contact; // Defined date_start_in_calendar and date_end_in_calendar property diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 19f4c4bfa03..0ea24279df4 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -86,7 +86,7 @@ $morehtmlref = '
'; // Thirdparty //$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
'.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').': '; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 4005ba45e65..01d7102a47c 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -78,7 +78,7 @@ if (!empty($conf->expedition->enabled)) { if (isModEnabled('facture')) { $langs->load("bills"); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); } if (!empty($conf->ficheinter->enabled)) { diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 95639a25997..aaf100d191a 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -640,10 +640,10 @@ if ($object->fetch($id) >= 0) { $obj = $db->fetch_object($resql); print ''; - print ''.img_picto('$obj->email', 'email', 'class="paddingright"').$obj->email.''; - print ''.$obj->lastname.''; - print ''.$obj->firstname.''; - print ''.$obj->other.''; + print ''.img_picto('$obj->email', 'email', 'class="paddingright"').dol_escape_htmltag($obj->email).''; + print ''.dol_escape_htmltag($obj->lastname).''; + print ''.dol_escape_htmltag($obj->firstname).''; + print ''.dol_escape_htmltag($obj->other).''; print ''; if (empty($obj->source_id) || empty($obj->source_type)) { print empty($obj->source_url) ? '' : $obj->source_url; // For backward compatibility diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 10ab441f442..5e327e1b706 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -124,7 +124,7 @@ $usercancreateorder = $user->rights->commande->creer; $usercancreateinvoice = $user->rights->facture->creer; $usercancreatecontract = $user->rights->contrat->creer; $usercancreateintervention = $user->hasRight('ficheinter', 'creer'); -$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer); +$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer')); $permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php $permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php @@ -1522,7 +1522,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formpropal = new FormPropal($db); $formmargin = new FormMargin($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1779,7 +1779,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print ''; print ''.$langs->trans("Project").''; @@ -2211,7 +2211,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').''; if ($usercancreate) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 73e73fbe2f9..1ad6f121848 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -297,7 +297,7 @@ class Propal extends CommonObject 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>22), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>40), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'position'=>23), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>24), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>24), 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55), 'datep' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>60), @@ -1367,7 +1367,7 @@ class Propal extends CommonObject $object->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); $object->fk_delivery_address = ''; - /*if (!empty($conf->projet->enabled)) + /*if (!empty($conf->project->enabled)) { $project = new Project($db); if ($this->fk_project > 0 && $project->fetch($this->fk_project)) { diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 989dcfe7098..d9942e9153c 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -137,7 +137,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 804fedd623b..31cf2c18f42 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -136,7 +136,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php index dc43af9ceff..65ff9c19e2b 100644 --- a/htdocs/comm/propal/info.php +++ b/htdocs/comm/propal/info.php @@ -28,7 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -83,7 +83,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 103ef815e48..e490a5ca7ac 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -204,8 +204,8 @@ $checkedtypetiers = 0; $arrayfields = array( 'p.ref'=>array('label'=>"Ref", 'checked'=>1), 'p.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1), - 'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)), - 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)), + 'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)), + 'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1), 's.town'=>array('label'=>"Town", 'checked'=>-1), diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index 13fa42edb29..7e40552fefb 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -107,7 +107,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->propal->creer) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 1432d1f132f..a3d1fa2da04 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -48,7 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -1492,7 +1492,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formorder = new FormOrder($db); $formmargin = new FormMargin($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1755,8 +1755,7 @@ if ($action == 'create' && $usercancreate) { // Shipping Method if (isModEnabled('expedition')) { print ''.$langs->trans('SendingMethod').''; - print img_picto('', 'object_dolly', 'class="pictofixedwidth"'); - print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); + print img_picto('', 'object_dolly', 'class="pictofixedwidth"').$form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); print ''; } @@ -1778,7 +1777,7 @@ if ($action == 'create' && $usercancreate) { // TODO How record was recorded OrderMode (llx_c_input_method) // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print ''; print ''.$langs->trans("Project").''; @@ -2246,7 +2245,7 @@ if ($action == 'create' && $usercancreate) { $morehtmlref .= ' ('.$langs->trans("OtherOrders").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 44cc5c6effd..3427e38d99e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -314,7 +314,7 @@ class Commande extends CommonOrder 'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>27), // deprecated 'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>20), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>25), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>25), 'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60), 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62), 'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65), @@ -2123,9 +2123,9 @@ class Commande extends CommonOrder $line->product_ref = $objp->product_ref; $line->product_label = $objp->product_label; - $line->product_desc = $objp->product_desc; $line->product_tosell = $objp->product_tosell; $line->product_tobuy = $objp->product_tobuy; + $line->product_desc = $objp->product_desc; $line->product_tobatch = $objp->product_tobatch; $line->product_barcode = $objp->product_barcode; diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index b89623fc3a0..5f4de8b59a0 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -131,7 +131,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 684d8e61334..d85400243e7 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -130,7 +130,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php index 38d8beba2ec..93b80b80f1c 100644 --- a/htdocs/commande/info.php +++ b/htdocs/commande/info.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -83,7 +83,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index b4e1f19554e..350674370e9 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -165,8 +165,8 @@ $checkedtypetiers = 0; $arrayfields = array( 'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5), 'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25), + 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>20), + 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>25), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1, 'position'=>31), 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>35), diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php index 55140c30ae2..75d8e587ccb 100644 --- a/htdocs/commande/note.php +++ b/htdocs/commande/note.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index cee2874d8c5..13fdffcb3c9 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1206,7 +1206,7 @@ class Account extends CommonObject * Return current sold * * @param int $option 1=Exclude future operation date (this is to exclude input made in advance and have real account sold) - * @param tms $date_end Date until we want to get bank account sold + * @param int $date_end Date until we want to get bank account sold * @param string $field dateo or datev * @return int current sold (value date <= today) */ diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index ab4b24e3889..95d5ffa0e9e 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -311,7 +311,7 @@ $form = new Form($db); if (!empty($conf->accounting->enabled)) { $formaccounting = new FormAccounting($db); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -481,7 +481,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); // Associated project @@ -553,7 +553,7 @@ if ($id) { $morehtmlref = '
'; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->banque->modifier) { diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index ad199caaf5a..b7cb8ee6bbf 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -97,7 +97,7 @@ if ($object->id) { $morehtmlref = '
'; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' : '; if ($user->rights->banque->modifier && 0) { diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php index e50dc10ff7f..b46ab36ddf6 100644 --- a/htdocs/compta/bank/various_payment/info.php +++ b/htdocs/compta/bank/various_payment/info.php @@ -57,7 +57,7 @@ print dol_get_fiche_head($head, 'info', $langs->trans("VariousPayment"), -1, $ob $morehtmlref = '
'; // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' : '; if ($user->rights->banque->modifier && 0) { diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 98cb0e27804..0091dc39512 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -161,7 +161,7 @@ $arrayfields = array( 'datep' =>array('label'=>"DatePayment", 'checked'=>1, 'position'=>120), 'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130), 'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140), - 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->projet->enabled)), + 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)), 'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>!empty($conf->banque->enabled)), 'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>!empty($conf->banque->enabled)), 'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>!empty($conf->accounting->enabled)), diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 33b453cd0b4..59c2b373d1a 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -422,7 +422,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); print ''; print ''; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index e8346a11896..18a935cedb4 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -34,7 +34,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; //include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; } @@ -924,7 +924,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); @@ -954,7 +954,7 @@ if ($action == 'create') { print dol_get_fiche_head(null, '', '', 0); $rowspan = 4; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $rowspan++; } if ($object->fk_account > 0) { @@ -1047,7 +1047,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { + if (!empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { $projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project; $langs->load('projects'); print ''.$langs->trans('Project').''; @@ -1203,7 +1203,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0fefbbab118..ca07f30f838 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -54,7 +54,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (!empty($conf->commande->enabled)) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -2874,7 +2874,7 @@ $formmargin = new FormMargin($db); $soc = new Societe($db); $paymentstatic = new Paiement($db); $bankaccountstatic = new Account($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -3658,7 +3658,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); print ''.$langs->trans('Project').''; print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); @@ -4284,7 +4284,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { @@ -4803,7 +4803,7 @@ if ($action == 'create') { $nbrows = 8; $nbcols = 3; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nbrows++; } if (!empty($conf->banque->enabled)) { diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 34df7bcf097..f15f65954cf 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -181,7 +181,7 @@ class FactureRec extends CommonInvoice 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total', 'enabled'=>1, 'visible'=>-1, 'position'=>70, 'isameasure'=>1), 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>75, 'isameasure'=>1), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>85), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>85), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95), 'date_lim_reglement' =>array('type'=>'date', 'label'=>'Date lim reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>100), diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index b1799350ce8..1b75d43753e 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index f55e9c4b36f..1685da08a2e 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/info.php b/htdocs/compta/facture/info.php index ceea7dcbb62..8b198e5f991 100644 --- a/htdocs/compta/facture/info.php +++ b/htdocs/compta/facture/info.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -97,7 +97,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 02925225df9..1f516c31795 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -257,7 +257,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), 'ch-facture.html#s-fac-factur $form = new Form($db); $formother = new FormOther($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 54de9440b8b..cac6229f86b 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -215,8 +215,8 @@ $arrayfields = array( 'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22), 'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1, 'position'=>25), 'f.date_closing'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>30), - 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>40), - 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>41), + 'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>40), + 'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>41), 's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50), 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51), 's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>55), diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index cab6d3ac680..5b30d39da12 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -114,7 +114,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index afdd871371c..8bd953f98b5 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -349,7 +349,7 @@ if ($object->id > 0) { } } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 900f1a179e9..fed5a42c04e 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -332,7 +332,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formsocialcontrib = new FormSocialContrib($db); $bankaccountstatic = new Account($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -406,7 +406,7 @@ if ($action == 'create') { print ''.img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($fk_user, 'userid', 1).''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); // Associated project @@ -539,7 +539,7 @@ if ($id > 0) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->tax->charges->creer) { diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 3de8687433f..2b0d17337a5 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -101,7 +101,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -121,7 +121,7 @@ if ($object->id) { $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' : '; if (!empty($object->fk_project)) { diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 8363459171b..0976a76c26d 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -25,7 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -68,7 +68,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) { $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -90,7 +90,7 @@ $morehtmlref = '
'; $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' : '; if (!empty($object->fk_project)) { diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 082a485f817..93c8dea0a3e 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -112,7 +112,7 @@ $arrayfields = array( 'cs.fk_type' =>array('label'=>"Type", 'checked'=>1, 'position'=>30), 'cs.date_ech' =>array('label'=>"Date", 'checked'=>1, 'position'=>40), 'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50), - 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->projet->enabled))), + 'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->project->enabled))), 'cs.fk_user' =>array('label'=>"Employee", 'checked'=>1, 'position'=>70), 'cs.fk_mode_reglement' =>array('checked'=>-1, 'position'=>80, 'label'=>"DefaultPaymentMode"), 'cs.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>100), @@ -191,7 +191,7 @@ $formother = new FormOther($db); $bankstatic = new Account($db); $formsocialcontrib = new FormSocialContrib($db); $chargesociale_static = new ChargeSociales($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projectstatic = new Project($db); } @@ -199,7 +199,7 @@ llxHeader('', $langs->trans("SocialContributions")); $sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,"; $sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; } $sql .= " c.libelle as type_label, c.accountancy_code as type_accountancy_code,"; @@ -209,7 +209,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql .= " ".MAIN_DB_PREFIX."chargesociales as cs"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (cs.fk_account = ba.rowid)"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pay ON (cs.fk_mode_reglement = pay.id)'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cs.fk_projet"; } $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; @@ -223,7 +223,7 @@ if ($search_ref) { if ($search_label) { $sql .= natural_search("cs.libelle", $search_label); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { if ($search_project_ref != '') { $sql .= natural_search("p.ref", $search_project_ref); } @@ -259,7 +259,7 @@ if ($search_typeid > 0) { $sql .= " AND cs.fk_type = ".((int) $search_typeid); } $sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= ", p.rowid, p.ref, p.title"; } $sql .= $db->order($sortfield, $sortorder); @@ -560,7 +560,7 @@ while ($i < min($num, $limit)) { $chargesociale_static->label = $obj->label; $chargesociale_static->type_label = $obj->type_label; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $projectstatic->id = $obj->project_id; $projectstatic->ref = $obj->project_ref; $projectstatic->title = $obj->project_label; diff --git a/htdocs/compta/sociales/note.php b/htdocs/compta/sociales/note.php index 0447d3168b1..8ede1c3b502 100644 --- a/htdocs/compta/sociales/note.php +++ b/htdocs/compta/sociales/note.php @@ -25,7 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -93,7 +93,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' : '; if (!empty($object->fk_project)) { diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 22b3f988a70..dc362e60051 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -102,7 +102,7 @@ if ($action == 'setlib' && $permissiontoadd) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 70761162153..a8dc5e7ee3b 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -110,7 +110,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -171,7 +171,7 @@ if ($id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 3202d8598d0..ecc8ec22660 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; if (!empty($conf->propal->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -1002,7 +1002,7 @@ llxHeader('', $langs->trans("Contract"), $help_url); $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1161,7 +1161,7 @@ if ($action == 'create') { print ""; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); $formproject = new FormProjets($db); @@ -1321,7 +1321,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 367fcba3a46..8b6d7490eaf 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -233,7 +233,7 @@ class Contrat extends CommonObject 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>40), 'date_contrat' =>array('type'=>'datetime', 'label'=>'Date contrat', 'enabled'=>1, 'visible'=>-1, 'position'=>45), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>70), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>75), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>75), 'fk_commercial_signature' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative Signature', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'fk_commercial_suivi' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative follower', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90), diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index d053a9a4fa0..1bd9d3388f6 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -154,7 +154,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 953fd0002d2..ce386fe21b9 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -144,7 +144,7 @@ if ($object->id) { $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 01378a65786..540491698c1 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -111,7 +111,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
'.$langs->trans('Project').' '; if ($user->rights->contrat->creer) { diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index a4fbbd16c58..969d590be34 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -144,7 +144,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { $urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist; $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation - if (!empty($noback)) { + if (empty($noback)) { header("Location: " . $urltogo); exit; } @@ -320,7 +320,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) { // Delete OK setEventMessages("RecordDeleted", null, 'mesgs'); - if (!empty($noback)) { + if (empty($noback)) { header("Location: " . $backurlforlist); exit; } @@ -366,7 +366,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs'); - if (!empty($noback)) { + if (empty($noback)) { header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); exit; } @@ -507,7 +507,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd)) $newid = $result; } - if (!empty($noback)) { + if (empty($noback)) { header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $newid); // Open record of new object exit; } diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index c813e8af4a0..69d46dae51c 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -26,7 +26,7 @@ // $id must be defined // $object must be defined and must have a method generateDocument(). // $permissiontoadd must be defined -// $upload_dir must be defined (example $conf->projet->dir_output . "/";) +// $upload_dir must be defined (example $conf->project->dir_output . "/";) // $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not. if (!empty($permissioncreate) && empty($permissiontoadd)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 5acc6b22ee2..9ec4db2bd11 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -31,7 +31,7 @@ // $parameters, $object, $action must be defined for the hook. // $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined -// $uploaddir may be defined (example to $conf->projet->dir_output."/";) +// $uploaddir may be defined (example to $conf->project->dir_output."/";) // $toselect may be defined // $diroutputmassaction may be defined @@ -455,7 +455,7 @@ if (!$error && $massaction == 'confirm_presend') { //var_dump($oneemailperrecipient); var_dump($listofqualifiedobj); var_dump($listofqualifiedref); foreach ($looparray as $objectid => $objecttmp) { // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object // Make substitution in email content - if (!empty($conf->projet->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) { + if (!empty($conf->project->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) { $objecttmp->fetch_projet(); } $substitutionarray = getCommonSubstitutionArray($langs, 0, null, $objecttmp); diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index c4b79d89920..ce47cc3568f 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -252,9 +252,9 @@ if ($type == 'directory') { } elseif ($module == 'salaries') { $upload_dir = $conf->salaries->dir_output; } elseif ($module == 'project') { - $upload_dir = $conf->projet->dir_output; + $upload_dir = $conf->project->dir_output; } elseif ($module == 'project_task') { - $upload_dir = $conf->projet->dir_output; + $upload_dir = $conf->project->dir_output; } elseif ($module == 'fichinter') { $upload_dir = $conf->ficheinter->dir_output; } elseif ($module == 'user') { diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index de69e19c3e2..c1199477f58 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -89,10 +89,10 @@ if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->glob $arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { +if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) { $arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { +if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) { $arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index 28461e07de5..b25a42228e7 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -133,7 +133,7 @@ class box_dolibarr_state_board extends ModeleBoxes 'supplier_orders' => !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS), 'supplier_invoices' => !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS), 'supplier_proposals' => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS), - 'projects' => !empty($conf->projet->enabled) && $user->rights->projet->lire, + 'projects' => !empty($conf->project->enabled) && $user->rights->projet->lire, 'expensereports' => !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire, 'holidays' => !empty($conf->holiday->enabled) && $user->rights->holiday->read, 'ticket' => !empty($conf->ticket->enabled) && $user->rights->ticket->read, diff --git a/htdocs/core/boxes/box_project.php b/htdocs/core/boxes/box_project.php index 63a4e90cdd0..909ff32acb9 100644 --- a/htdocs/core/boxes/box_project.php +++ b/htdocs/core/boxes/box_project.php @@ -84,6 +84,7 @@ class box_project extends ModeleBoxes $textHead = $langs->trans("OpenedProjects"); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); + $i = 0; // list the summary of the orders if ($user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -113,7 +114,6 @@ class box_project extends ModeleBoxes if ($result) { $num = $this->db->num_rows($result); - $i = 0; while ($i < min($num, $max)) { $objp = $this->db->fetch_object($result); diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 410bf41a601..870d4c1d8df 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -72,11 +72,23 @@ abstract class CommonOrderLine extends CommonObjectLine */ public $product_label; + /** + * Boolean that indicates whether the product is available for sale '1' or not '0' + * @var int + */ + public $product_tosell=0; + + /** + * Boolean that indicates whether the product is available for purchase '1' or not '0' + * @var int + */ + public $product_tobuy=0; + /** * Product description * @var string */ - public $product_desc; + public $product_desc; /** * Product use lot diff --git a/htdocs/core/class/evalmath.class.php b/htdocs/core/class/evalmath.class.php index ccd495bb623..7ae9e5fcd90 100644 --- a/htdocs/core/class/evalmath.class.php +++ b/htdocs/core/class/evalmath.class.php @@ -366,9 +366,9 @@ class EvalMath } /** - * evaluate postfix notation + * Evaluate postfix notation * - * @param string $tokens Expression + * @param string $tokens An array of expression to evaluate ('operators'). The operand are into ->stack. * @param array $vars Array * @return string Output */ diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9f34fa3a15f..4f9b0d06f16 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1709,7 +1709,9 @@ class ExtraFields $toprint = array(); if (is_array($value_arr)) { foreach ($value_arr as $keyval => $valueval) { - $toprint[] = '
  • '.$param['options'][$valueval].'
  • '; + if (!empty($valueval)) { + $toprint[] = '
  • '.$param['options'][$valueval].'
  • '; + } } } $value = '
      '.implode(' ', $toprint).'
    '; diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 8e325fd13e2..b1e085fbff7 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -72,7 +72,7 @@ class FileUpload } elseif ($element == 'project_task') { $pathname = 'projet'; $filename = 'task'; - $dir_output = $conf->projet->dir_output; + $dir_output = $conf->project->dir_output; $parentForeignKey = 'fk_project'; $parentClass = 'Project'; $parentElement = 'projet'; diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 957026c2180..f1c6e12e925 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -47,6 +47,9 @@ class FormTicket */ public $db; + /** + * @var string The track_id of the ticket. Used also for the $keytoavoidconflict to name session vars to upload files. + */ public $track_id; /** @@ -612,7 +615,7 @@ class FormTicket } if ($subelement != 'project') { - if (!empty($conf->projet->enabled) && !$this->ispublic) { + if (!empty($conf->project->enabled) && !$this->ispublic) { $formproject = new FormProjets($this->db); print ''; print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); @@ -1211,7 +1214,7 @@ class FormTicket dol_delete_dir_recursive($upload_dir); } - $keytoavoidconflict = empty($this->trackid) ? '' : '-'.$this->trackid; // this->trackid must be defined + $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid unset($_SESSION["listofpaths".$keytoavoidconflict]); unset($_SESSION["listofnames".$keytoavoidconflict]); unset($_SESSION["listofmimes".$keytoavoidconflict]); @@ -1269,7 +1272,7 @@ class FormTicket $listofpaths = array(); $listofnames = array(); $listofmimes = array(); - $keytoavoidconflict = empty($this->trackid) ? '' : '-'.$this->trackid; // this->trackid must be defined + $keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) { if (!empty($arraydefaultmessage->joinfiles) && is_array($this->param['fileinit'])) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 896921ac436..cc99471a69f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -138,7 +138,7 @@ function societe_prepare_head(Societe $object) $h++; } - if (!empty($conf->projet->enabled) && (!empty($user->rights->projet->lire))) { + if (!empty($conf->project->enabled) && (!empty($user->rights->projet->lire))) { $nbProject = 0; // Enable caching of thirdrparty count projects require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -781,11 +781,11 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel $i = -1; - if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && $user->rights->projet->lire) { $langs->load("projects"); $newcardbutton = ''; - if (!empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { + if (!empty($conf->project->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); } diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 8ade2200724..b63e7b025c7 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -57,7 +57,7 @@ function contact_prepare_head(Contact $object) $head[$tab][2] = 'perso'; $tab++; - if (!empty($conf->projet->enabled) && (!empty($user->rights->projet->lire))) { + if (!empty($conf->project->enabled) && $user->hasRight('project', 'lire')) { $nbProject = 0; // Enable caching of thirdrparty count projects require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php'; @@ -170,11 +170,11 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $ $i = -1; - if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && $user->rights->projet->lire) { $langs->load("projects"); $newcardbutton = ''; - if (!empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { + if (!empty($conf->project->enabled) && $user->rights->projet->creer && empty($nocreatelink)) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage)); } diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 237adc9447a..558ba2aa322 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -322,20 +322,28 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l * Generate a SQL string to make a filter into a range (for second of date until last second of date). * This method allows to maje SQL request that will deal correctly the timezone of server. * - * @param string $datefield Name of SQL field where apply sql date filter - * @param int $day_date Day date - * @param int $month_date Month date - * @param int $year_date Year date - * @param int $excludefirstand Exclude first and - * @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ. - * Note: In database, dates are always fot the server TZ. - * @return string $sqldate String with SQL filter + * @param string $datefield Name of SQL field where apply sql date filter + * @param int|string $day_date Day date (Can be 0 or '' for filter on a month) + * @param int|string $month_date Month date (Can be 0 or '' for filter on a year) + * @param int|string $year_date Year date + * @param int $excludefirstand Exclude first and + * @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ. + * Note: In database, dates are always fot the server TZ. + * @return string $sqldate String with SQL filter */ function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0, $gm = false) { global $db; - $sqldate = ""; + $sqldate = ''; + + $day_date = intval($day_date); + $month_date = intval($month_date); + $year_date = intval($year_date); + if ($month_date > 0) { + if ($month_date > 12) { // protection for bad value of month + return " AND 1 = 2"; + } if ($year_date > 0 && empty($day_date)) { $sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, $gm)); $sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, $gm))."'"; diff --git a/htdocs/core/lib/doc.lib.php b/htdocs/core/lib/doc.lib.php index d1a7cea5d9a..92cc140f299 100644 --- a/htdocs/core/lib/doc.lib.php +++ b/htdocs/core/lib/doc.lib.php @@ -78,12 +78,12 @@ function doc_getlinedesc($line, $outputlangs, $hideref = 0, $hidedesc = 0, $issu if ($desc == '(CREDIT_NOTE)' && $line->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($line->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromCreditNote", $sourceref); } elseif ($desc == '(DEPOSIT)' && $line->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($line->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref); // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) { diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 76948308c70..482831191d6 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1443,7 +1443,7 @@ function dol_delete_preview($object) } elseif ($object->element == 'invoice_supplier') { $dir = $conf->fournisseur->facture->dir_output; } elseif ($object->element == 'project') { - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; } elseif ($object->element == 'shipping') { $dir = $conf->expedition->dir_output.'/sending'; } elseif ($object->element == 'delivery') { @@ -1525,7 +1525,7 @@ function dol_meta_create($object) } elseif ($object->element == 'invoice_supplier') { $dir = $conf->fournisseur->dir_output.'/facture'; } elseif ($object->element == 'project') { - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; } elseif ($object->element == 'shipping') { $dir = $conf->expedition->dir_output.'/sending'; } elseif ($object->element == 'delivery') { @@ -2812,7 +2812,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } $original_file = $conf->commande->multidir_output[$entity].'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('order').")"; - } elseif ($modulepart == 'project' && !empty($conf->projet->dir_output)) { + } elseif ($modulepart == 'project' && !empty($conf->project->dir_output)) { // Wrapping pour les projets if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; @@ -2824,9 +2824,9 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = checkUserAccessToObject($user, array('projet'), $tmpproject->id, 'projet&project', '', '', 'rowid', ''); } } - $original_file = $conf->projet->dir_output.'/'.$original_file; + $original_file = $conf->project->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; - } elseif ($modulepart == 'project_task' && !empty($conf->projet->dir_output)) { + } elseif ($modulepart == 'project_task' && !empty($conf->project->dir_output)) { if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project @@ -2837,7 +2837,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = checkUserAccessToObject($user, array('projet_task'), $tmptask->id, 'projet_task&project', '', '', 'rowid', ''); } } - $original_file = $conf->projet->dir_output.'/'.$original_file; + $original_file = $conf->project->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")"; } elseif (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output)) { // Wrapping pour les commandes fournisseurs diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 45bf99577d4..13d44e1ec8a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7313,7 +7313,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__'; $substitutionarray['__CANDIDATE_LASTNAME__'] = '__CANDIDATE_LASTNAME__'; } - if (!empty($conf->projet->enabled)) { // Most objects + if (!empty($conf->project->enabled)) { // Most objects $substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__'; $substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__'; $substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__'; @@ -8505,7 +8505,7 @@ function verifCond($strToEvaluate) //dol_eval($str, 0, 1, '2'); // The dol_eval must contains all the global $xxx used into a condition //var_dump($strToEvaluate); $rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx for all variables $xxx found into the string condition - $rights = (($rep && strpos($rep, 'Bad string syntax to evaluate') === false) ? true : false); + $rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false); //var_dump($rights); } return $rights; @@ -8949,8 +8949,12 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, foreach ($conf->modules_parts['tabs'][$type] as $value) { $values = explode(':', $value); + $reg = array(); if ($mode == 'add' && !preg_match('/^\-/', $values[1])) { - if (count($values) == 6) { // new declaration with permissions: $value='objecttype:+tabname1:Title1:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__' + if (count($values) == 6) { + // new declaration with permissions: + // $value='objecttype:+tabname1:Title1:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__' + // $value='objecttype:+tabname1:Title1,class,pathfile,method:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__' if ($values[0] != $type) { continue; } @@ -8964,7 +8968,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, complete_substitutions_array($substitutionarray, $langs, $object, array('needforkey'=>$values[2])); $label = make_substitutions($reg[1], $substitutionarray); } else { - $labeltemp = explode(':', $values[2]); + $labeltemp = explode(',', $values[2]); $label = $langs->trans($labeltemp[0]); if (!empty($labeltemp[1]) && is_object($object) && !empty($object->id)) { dol_include_once($labeltemp[2]); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 709d6e5d404..ff0350a9552 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1490,12 +1490,12 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, if ($desc == '(CREDIT_NOTE)' && $object->lines[$i]->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($object->lines[$i]->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromCreditNote", $sourceref); } elseif ($desc == '(DEPOSIT)' && $object->lines[$i]->fk_remise_except) { $discount = new DiscountAbsolute($db); $discount->fetch($object->lines[$i]->fk_remise_except); - $sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source; + $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source; $libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref); // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index bcc6fde98c8..d53870128fc 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -186,7 +186,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (!empty($conf->tax->enabled)) { $nbElements += $project->getElementCount('chargesociales', 'chargesociales'); } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nbElements += $project->getElementCount('project_task', 'projet_task'); } if (!empty($conf->stock->enabled)) { @@ -275,7 +275,7 @@ function project_prepare_head(Project $project, $moreparam = '') } else { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($project->ref); + $upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($project->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks = Link::count($db, $project->element, $project->id); $totalAttached = $nbFiles + $nbLinks; @@ -401,7 +401,7 @@ function task_prepare_head($object) } $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : ''); - $filesdir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref); + $filesdir = $conf->project->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $nbFiles = count(dol_dir_list($filesdir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 19b4d01f9d9..056d28ab2cd 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -774,7 +774,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } if (in_array($feature, $checkproject)) { - if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire)) { + if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) { $projectid = $objectid; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -795,7 +795,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl $checkonentitydone = 1; } if (in_array($feature, $checktask)) { - if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire)) { + if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) { $task = new Task($db); $task->fetch($objectid); $projectid = $task->fk_project; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 9270b946199..96625dd1f95 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -15,7 +15,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', '$conf->product->enabled || $conf->service->enabled', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__); -insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->projet->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); +insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->project->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__); insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__); @@ -404,19 +404,19 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left -- Project -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&leftmenu=projects&action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__); -- Project - Categories insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&leftmenu=cat&type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ddb4b1fab95..9e88d4dda3d 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -2211,6 +2211,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="pictofixedwidth"')); + $newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire); } } } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index 907688b4878..6dae41ca2af 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -152,7 +152,7 @@ class pdf_standard extends ModeleExpenseReport $this->posxqty = 150; $this->postotalht = 160; $this->postotalttc = 180; - // if (empty($conf->projet->enabled)) { + // if (empty($conf->project->enabled)) { // $this->posxtva-=20; // $this->posxup-=20; // $this->posxqty-=20; @@ -581,7 +581,7 @@ class pdf_standard extends ModeleExpenseReport if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { $nextColumnPosX = $this->posxtva; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nextColumnPosX = $this->posxprojet; } @@ -597,7 +597,7 @@ class pdf_standard extends ModeleExpenseReport //$pdf->MultiCell($nextColumnPosX-$this->posxtype-0.8, 4, $expensereporttypecodetoshow, 0, 'C'); // Project - //if (! empty($conf->projet->enabled)) + //if (! empty($conf->project->enabled)) //{ // $pdf->SetFont('','', $default_font_size - 1); // $pdf->SetXY($this->posxprojet, $curY); @@ -955,7 +955,7 @@ class pdf_standard extends ModeleExpenseReport // $pdf->MultiCell($this->posxprojet-$this->posxtype - 1, 2, $outputlangs->transnoentities("Type"), '', 'C'); //} - //if (!empty($conf->projet->enabled)) + //if (!empty($conf->project->enabled)) //{ // // Project // $pdf->line($this->posxprojet - 1, $tab_top, $this->posxprojet - 1, $tab_top + $tab_height); diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index e3e349d2a17..decbc81716b 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -310,7 +310,7 @@ class mailing_contacts1 extends MailingTargets // Choose language require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($this->db); - $s .= $langs->trans("DefaultLang").': '; + $s .= ''.$langs->trans("DefaultLang").': '; $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1); return $s; diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 073d45439eb..89bc2cf2b5e 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -117,6 +117,10 @@ class mailing_thirdparties extends MailingTargets $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('default_lang', 'alpha'))."%'"; $addDescription = $langs->trans('DefaultLang')."="; } + if (GETPOST('filter_lang_thirdparties', 'alpha')) { + $addFilter .= " AND s.default_lang LIKE '".$this->db->escape(GETPOST('filter_lang_thirdparties', 'alpha'))."%'"; + $addDescription = $langs->trans('DefaultLang')."="; + } $sql = "SELECT s.rowid as id, s.email as email, s.nom as name, null as fk_contact, null as firstname, c.label as label"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."categorie_societe as cs, ".MAIN_DB_PREFIX."categorie as c"; @@ -315,8 +319,8 @@ class mailing_thirdparties extends MailingTargets // Choose language require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($this->db); - $s .= $langs->trans("DefaultLang").': '; - $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1); + $s .= ''.$langs->trans("DefaultLang").': '; + $s .= $formadmin->select_language($langs->getDefaultLang(1), 'filter_lang_thirdparties', 0, null, 1, 0, 0, '', 0, 0, 0, null, 1); return $s; } diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index 77044ddb29e..9a80484f83b 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -151,10 +151,12 @@ class mailing_xinputfile extends MailingTargets $cpt++; $buffer = trim(fgets($handle)); $tab = explode(';', $buffer, 4); - $email = $tab[0]; - $name = $tab[1]; - $firstname = $tab[2]; - $other = $tab[3]; + + $email = dol_string_nohtmltag($tab[0]); + $name = dol_string_nohtmltag(empty($tab[1]) ? '' : $tab[1]); + $firstname = dol_string_nohtmltag(empty($tab[2]) ? '' : $tab[2]); + $other = dol_string_nohtmltag(empty($tab[3]) ? '' : $tab[3]); + if (!empty($buffer)) { //print 'xx'.dol_strlen($buffer).empty($buffer)."
    \n"; if (isValidEMail($email)) { diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index 117a5722c3c..74ed18ba91f 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -127,10 +127,11 @@ class mailing_xinputuser extends MailingTargets require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $tmparray = explode(';', GETPOST('xinputuser')); + $email = $tmparray[0]; - $lastname = $tmparray[1]; - $firstname = $tmparray[2]; - $other = $tmparray[3]; + $lastname = empty($tmparray[1]) ? '' : $tmparray[1]; + $firstname = empty($tmparray[2]) ? '' : $tmparray[2]; + $other = empty($tmparray[3]) ? '' : $tmparray[3]; $cibles = array(); if (!empty($email)) { diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index c9a28863c97..57ac7a637dc 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -145,7 +145,7 @@ class modCategorie extends DolibarrModules if (!empty($conf->bank->enabled)) { $typeexample .= ($typeexample ? " / " : "")."5=Bank account"; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $typeexample .= ($typeexample ? " / " : "")."6=Project"; } if (!empty($conf->user->enabled)) { @@ -379,7 +379,7 @@ class modCategorie extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_6_'.Categorie::$MAP_ID_TO_CODE[6]; $this->export_label[$r] = 'CatProjectsList'; $this->export_icon[$r] = $this->picto; - $this->export_enabled[$r] = '!empty($conf->projet->enabled)'; + $this->export_enabled[$r] = '!empty($conf->project->enabled)'; $this->export_permission[$r] = array(array("categorie", "lire"), array("projet", "export")); $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', 's.rowid'=>"IdThirdParty", 's.nom'=>"Name"); $this->export_TypeFields_array[$r] = array('cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'List:categorie:label:rowid', 'p.ref'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>"Text"); @@ -568,7 +568,7 @@ class modCategorie extends DolibarrModules // 5 Bank accounts, TODO ? // 6 Projects - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $r++; $this->import_code[$r] = $this->rights_class.'_6_'.Categorie::$MAP_ID_TO_CODE[6]; $this->import_label[$r] = "CatProjectsLinks"; // Translation key diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 10b78673cf5..8bd8d030a37 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -522,7 +522,7 @@ class doc_generic_project_odt extends ModelePDFProjects // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; @@ -536,7 +536,7 @@ class doc_generic_project_odt extends ModelePDFProjects $object->fetch_thirdparty(); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -575,9 +575,9 @@ class doc_generic_project_odt extends ModelePDFProjects //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; - dol_mkdir($conf->projet->dir_temp); - if (!is_writable($conf->projet->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp; + dol_mkdir($conf->project->dir_temp); + if (!is_writable($conf->project->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->project->dir_temp; dol_syslog('Error in write_file: '.$this->error, LOG_ERR); return -1; } @@ -615,7 +615,7 @@ class doc_generic_project_odt extends ModelePDFProjects $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->projet->dir_temp, + 'PATH_TO_TMP' => $conf->project->dir_temp, 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'DELIMITER_LEFT' => '{', 'DELIMITER_RIGHT' => '}' @@ -826,7 +826,7 @@ class doc_generic_project_odt extends ModelePDFProjects // Replace tags of project files $listtasksfiles = $listlines->__get('tasksfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref).'/'.dol_sanitizeFileName($task->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref).'/'.dol_sanitizeFileName($task->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); @@ -861,7 +861,7 @@ class doc_generic_project_odt extends ModelePDFProjects try { $listlines = $odfHandler->setSegment('projectfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); foreach ($filearray as $filedetail) { diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index cf9e84a3deb..bb6eb75bf75 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -195,11 +195,11 @@ class pdf_baleine extends ModelePDFProjects // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { //$nblines = count($object->lines); // This is set later with array of tasks $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; } diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index abd05f63651..4aa6f754ad9 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -242,11 +242,11 @@ class pdf_beluga extends ModelePDFProjects // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { //$nblines = count($object->lines); // This is set later with array of tasks $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; } diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index cb7430c3011..741476de117 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -195,11 +195,11 @@ class pdf_timespent extends ModelePDFProjects // Load traductions files required by page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { //$nblines = count($object->lines); // This is set later with array of tasks $objectref = dol_sanitizeFileName($object->ref); - $dir = $conf->projet->dir_output; + $dir = $conf->project->dir_output; if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; } diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 3702b1c8452..e26318b749c 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -133,8 +133,8 @@ class doc_generic_task_odt extends ModelePDFTask // Get source company $this->emetteur = $mysoc; - if (!$this->emetteur->pays_code) { - $this->emetteur->pays_code = substr($langs->defaultlang, -2); // By default, if was not defined + if (!$this->emetteur->country_code) { + $this->emetteur->country_code = substr($langs->defaultlang, -2); // By default, if was not defined } } @@ -481,7 +481,7 @@ class doc_generic_task_odt extends ModelePDFTask // Load translation files required by the page $outputlangs->loadLangs(array("main", "dict", "companies", "projects")); - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { // If $object is id instead of object if (!is_object($object)) { $id = $object; @@ -496,7 +496,7 @@ class doc_generic_task_odt extends ModelePDFTask $project->fetch($object->fk_project); $project->fetch_thirdparty(); - $dir = $conf->projet->dir_output."/".$project->ref."/"; + $dir = $conf->project->dir_output."/".$project->ref."/"; $objectref = dol_sanitizeFileName($object->ref); if (!preg_match('/specimen/i', $objectref)) { $dir .= "/".$objectref; @@ -525,9 +525,9 @@ class doc_generic_task_odt extends ModelePDFTask //print "file=".$file; //print "conf->societe->dir_temp=".$conf->societe->dir_temp; - dol_mkdir($conf->projet->dir_temp); - if (!is_writable($conf->projet->dir_temp)) { - $this->error = "Failed to write in temp directory ".$conf->projet->dir_temp; + dol_mkdir($conf->project->dir_temp); + if (!is_writable($conf->project->dir_temp)) { + $this->error = "Failed to write in temp directory ".$conf->project->dir_temp; dol_syslog('Error in write_file: '.$this->error, LOG_ERR); return -1; } @@ -550,7 +550,7 @@ class doc_generic_task_odt extends ModelePDFTask $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->projet->dir_temp, + 'PATH_TO_TMP' => $conf->project->dir_temp, 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. 'DELIMITER_LEFT' => '{', 'DELIMITER_RIGHT' => '}' @@ -708,7 +708,7 @@ class doc_generic_task_odt extends ModelePDFTask // Replace tags of project files $listtasksfiles = $odfHandler->setSegment('tasksfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($object->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); @@ -741,7 +741,7 @@ class doc_generic_task_odt extends ModelePDFTask try { $listlines = $odfHandler->setSegment('projectfiles'); - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref); $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', 'name', SORT_ASC, 1); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 382e78df8d3..dba3d0de437 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -43,7 +43,7 @@ if (!empty($conf->expedition_bon->enabled)) { if (!empty($conf->stock->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -328,7 +328,7 @@ if ($action == 'create') { // Create. Seems to no be used // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$expedition->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 960ff7e7b2d..30a3ec24c6c 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -382,7 +382,7 @@ llxHeader('', $title, $help_url); $form = new Form($db); $formfile = new FormFile($db); $formcompany = new FormCompany($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -511,7 +511,7 @@ if ($action == 'create') { print ''; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print "".$langs->trans("Project").""; $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500'); print "\n"; @@ -639,7 +639,7 @@ if (!empty($id) && $action == 'edit') { print "".''.$langs->trans("Status").''.$object->getLibStatut(4).''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); @@ -700,7 +700,7 @@ if (!empty($id) && $action != 'edit') { $morehtmlref = '
    '; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/don/document.php b/htdocs/don/document.php index ab99ba3df1d..030ca5cb085 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -99,7 +99,7 @@ if ($action == 'classin' && $user->rights->don->creer) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -129,7 +129,7 @@ if ($object->id) { $morehtmlref = '
    '; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/don/info.php b/htdocs/don/info.php index 0057bf87dce..f326972f782 100644 --- a/htdocs/don/info.php +++ b/htdocs/don/info.php @@ -25,7 +25,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -63,7 +63,7 @@ $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:M llxHeader('', $title, $help_url); $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -77,7 +77,7 @@ $linkback = ''; // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/don/list.php b/htdocs/don/list.php index d7697dba43d..891f7e6877b 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -93,7 +93,7 @@ $fieldstosearchall = array( $donationstatic = new Don($db); $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projectstatic = new Project($db); } @@ -219,7 +219,7 @@ if ($resql) { print ''; print ' '; print ''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; print ' '; print ''; @@ -249,7 +249,7 @@ if ($resql) { } print_liste_field_titre("Name", $_SERVER["PHP_SELF"], "d.lastname", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.datedon", "", $param, '', $sortfield, $sortorder, 'center '); - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); print_liste_field_titre("Project", $_SERVER["PHP_SELF"], "d.fk_projet", "", $param, "", $sortfield, $sortorder); } @@ -280,7 +280,7 @@ if ($resql) { } print "".$donationstatic->getFullName($langs).""; print ''.dol_print_date($db->jdate($objp->datedon), 'day').''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ""; if ($objp->pid) { $projectstatic->id = $objp->pid; diff --git a/htdocs/don/note.php b/htdocs/don/note.php index 1629aa0f28f..8e1b5192ee2 100644 --- a/htdocs/don/note.php +++ b/htdocs/don/note.php @@ -29,7 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -84,7 +84,7 @@ $help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:M llxHeader('', $title, $help_url); $form = new Form($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref = '
    '; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($user->rights->don->creer) { diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 51a3f7ced7b..1fcdac35b0f 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -347,9 +347,9 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>$conf->salaries->enabled, 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries"))); } - if (!empty($conf->projet->enabled)) { - $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); - $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks"))); + if (!empty($conf->project->enabled)) { + $rowspan++; $sectionauto[] = array('position'=>130, 'level'=>1, 'module'=>'project', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); + $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks"))); } if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index a6782317802..27a76d2ae6e 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -143,8 +143,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU if (!empty($conf->tax->enabled)) { $langs->load("compta"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions"))); } -if (!empty($conf->projet->enabled)) { - $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); +if (!empty($conf->project->enabled)) { + $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->project->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); } if (!empty($conf->ficheinter->enabled)) { $langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 292b55d0dc9..2ab747f12c1 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -107,7 +107,7 @@ class ConferenceOrBooth extends ActionComm 'ref' => array('type'=>'integer', 'label'=>'Ref', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>2, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>0, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'help'=>"Help text", 'showoncombobox'=>'1',), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:t.usage_organize_event=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), 'note' => array('type'=>'text', 'label'=>'Description', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1), 'fk_action' => array('type'=>'sellist:c_actioncomm:libelle:id::module LIKE (\'%@eventorganization\')', 'label'=>'Format', 'enabled'=>'1', 'position'=>60, 'notnull'=>1, 'visible'=>1, 'css'=>'width300'), 'datep' => array('type'=>'datetime', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>70, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'2',), diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 533c9f4e8c0..b65d152189f 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -104,7 +104,7 @@ class ConferenceOrBoothAttendee extends CommonObject 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), 'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'), 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1, 'searchall'=>1), 'firstname' => array('type'=>'varchar(100)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1), 'lastname' => array('type'=>'varchar(100)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>32, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1), diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index da6c0f8ee04..57f2a76c042 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -392,7 +392,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index b8fb87d39fa..4c5b2f394a9 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -151,7 +151,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/eventorganization/core/actions_massactions_mail.inc.php b/htdocs/eventorganization/core/actions_massactions_mail.inc.php index cda9274e6d6..a446c04ca9a 100644 --- a/htdocs/eventorganization/core/actions_massactions_mail.inc.php +++ b/htdocs/eventorganization/core/actions_massactions_mail.inc.php @@ -31,7 +31,7 @@ // $parameters, $object, $action must be defined for the hook. // $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined -// $uploaddir may be defined (example to $conf->projet->dir_output."/";) +// $uploaddir may be defined (example to $conf->project->dir_output."/";) // $toselect may be defined // $diroutputmassaction may be defined diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index af508cf3291..e873ef6e056 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -56,7 +56,7 @@ if (!empty($conf->propal->enabled)) { if (!empty($conf->productbatch->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -815,7 +815,7 @@ if (empty($action)) { $form = new Form($db); $formfile = new FormFile($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -902,7 +902,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; if (empty($projectid) && !empty($object->fk_project)) { $projectid = $object->fk_project; @@ -1571,7 +1571,8 @@ if ($action == 'create') { } } - // Line extrafield + // Display lines for extrafields of the Shipment line + // $line is a 'Order line' if (!empty($extrafields)) { //var_dump($line); $colspan = 5; @@ -1580,6 +1581,7 @@ if ($action == 'create') { $srcLine = new OrderLine($db); $srcLine->id = $line->id; $srcLine->fetch_optionals(); // fetch extrafields also available in orderline + $expLine->array_options = array_merge($expLine->array_options, $srcLine->array_options); print $expLine->showOptionals($extrafields, 'edit', array('style'=>'class="drag drop oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1); @@ -1716,7 +1718,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment @@ -2414,7 +2416,8 @@ if ($action == 'create') { } print ""; - // Display lines extrafields + // Display lines extrafields. + // $line is a line of shipment if (!empty($extrafields)) { $colspan = 6; if ($origin && $origin_id > 0) { diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 944f76266d2..669c6f8e56d 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -149,7 +149,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 68336e8dbf6..d0729879017 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -123,7 +123,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index d8d70b3cc49..e391d5be180 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 2919a42bdb7..a64e6c2b761 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -227,7 +227,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -287,7 +287,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$soc->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 818b3d564a6..1a2718e7d9a 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -117,7 +117,7 @@ $permissiontoadd = $user->rights->expensereport->creer; // Used by the include o $upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); -$projectRequired = $conf->projet->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); +$projectRequired = $conf->project->enabled && ! empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED); $fileRequired = !empty($conf->global->EXPENSEREPORT_FILE_IS_REQUIRED); if ($object->id > 0) { @@ -1691,7 +1691,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; @@ -2055,7 +2055,7 @@ if ($action == 'create') { print ''.$langs->trans('LineNb').''; //print ''.$langs->trans('Piece').''; print ''.$langs->trans('Date').''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''.$langs->trans('Project').''; } print ''.$langs->trans('Type').''; @@ -2100,7 +2100,7 @@ if ($action == 'create') { print ''.dol_print_date($db->jdate($line->date), 'day').''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; if ($line->fk_project > 0) { $projecttmp->id = $line->fk_project; @@ -2261,7 +2261,7 @@ if ($action == 'create') { if ($action == 'editline' && $line->rowid == GETPOST('rowid', 'int')) { // Add line with link to add new file or attach line to an existing file $colspan = 11; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $colspan++; } if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { @@ -2336,7 +2336,7 @@ if ($action == 'create') { print ''; // Select project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; $formproject->select_projects(-1, $line->fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth300'); print ''; @@ -2409,7 +2409,7 @@ if ($action == 'create') { if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) { $colspan++; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $colspan++; } if ($action != 'editline') { @@ -2486,7 +2486,7 @@ if ($action == 'create') { print ''; print ''; print ''.$langs->trans('Date').''; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''.$form->textwithpicto($langs->trans('Project'), $langs->trans("ClosedProjectsAreHidden")).''; } print ''.$langs->trans('Type').''; @@ -2515,7 +2515,7 @@ if ($action == 'create') { print ''; // Select project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; $formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, $projectRequired ? 0 : 1, -1, 0, 0, 0, '', 0, 0, 'maxwidth300'); print ''; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 1a289e61e2e..3f644b074bd 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -178,7 +178,6 @@ if ($action == 'add') { $newinter->entity = $object->entity; $newinter->duree = $object->duree; - $newinter->datei = $object->date; $newinter->description = $object->description; $newinter->note_private = $object->note_private; @@ -245,7 +244,7 @@ $companystatic = new Societe($db); if (!empty($conf->contrat->enabled)) { $contratstatic = new Contrat($db); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projectstatic = new Project($db); } @@ -273,7 +272,7 @@ if ($action == 'create') { print dol_get_fiche_head(); $rowspan = 4; - if (!empty($conf->projet->enabled) && $object->fk_project > 0) { + if (!empty($conf->project->enabled) && $object->fk_project > 0) { $rowspan++; } if (!empty($conf->contrat->enabled) && $object->fk_contrat > 0) { @@ -315,7 +314,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); print "".$langs->trans("Project").""; $projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project; @@ -485,7 +484,7 @@ if ($action == 'create') { $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; @@ -804,7 +803,7 @@ if ($action == 'create') { if (!empty($conf->contrat->enabled)) { print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print_liste_field_titre("Project", $_SERVER['PHP_SELF'], "f.fk_project", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); } print_liste_field_titre("Duration", $_SERVER['PHP_SELF'], 'f.duree', '', '', 'width="50px"', $sortfield, $sortorder, 'right '); @@ -843,7 +842,7 @@ if ($action == 'create') { } print ''; } - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { print ''; if ($objp->fk_project > 0) { $projectstatic->fetch($objp->fk_project); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 4b7686449c7..09411f29d50 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/fichinter/modules_fichinter.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -787,7 +787,7 @@ $formfile = new FormFile($db); if (!empty($conf->contrat->enabled)) { $formcontract = new FormContract($db); } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -908,7 +908,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load("project"); @@ -1161,7 +1161,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer'); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->ficheinter->creer) { diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index ac0f47ee4b3..b9f0264ad46 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -40,7 +40,7 @@ class Fichinter extends CommonObject public $fields = array( 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>15), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>20), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>20), 'fk_contrat' =>array('type'=>'integer', 'label'=>'Fk contrat', 'enabled'=>'$conf->contrat->enabled', 'visible'=>-1, 'position'=>25), 'ref' =>array('type'=>'varchar(30)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>30), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), @@ -1473,9 +1473,19 @@ class FichinterLigne extends CommonObjectLine */ public $fk_fichinter; - public $desc; // Description ligne - public $datei; // Date intervention - public $duration; // Duree de l'intervention + public $desc; // Description ligne + + /** + * @var int Date of intervention + */ + public $date; // Date intervention + /** + * @var int Date of intervention + * @deprecated + */ + public $datei; // Date intervention + + public $duration; // Duration of intervention public $rang = 0; /** diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index f2f50963287..ef6ffc80881 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -123,7 +123,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->ficheinter->creer) { diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index 7fdcaa151a0..d0dd326df07 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -123,7 +123,7 @@ if ($object->id) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php index e5eea9f846c..589f1901cd6 100644 --- a/htdocs/fichinter/info.php +++ b/htdocs/fichinter/info.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -78,7 +78,7 @@ $morehtmlref = '
    '; // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 125b88c5b8e..ef71f01e228 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } if (!empty($conf->contrat->enabled)) { @@ -43,7 +43,7 @@ if (!empty($conf->contrat->enabled)) { // Load translation files required by the page $langs->loadLangs(array('companies', 'bills', 'interventions')); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); } if (!empty($conf->contrat->enabled)) { @@ -120,7 +120,7 @@ $arrayfields = array( 'f.ref'=>array('label'=>'Ref', 'checked'=>1), 'f.ref_client'=>array('label'=>'RefCustomer', 'checked'=>1), 's.nom'=>array('label'=>'ThirdParty', 'checked'=>1), - 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)), + 'pr.ref'=>array('label'=>'Project', 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)), 'c.ref'=>array('label'=>'Contract', 'checked'=>1, 'enabled'=>(empty($conf->contrat->enabled) ? 0 : 1)), 'f.description'=>array('label'=>'Description', 'checked'=>1), 'f.datec'=>array('label'=>'DateCreation', 'checked'=>0, 'position'=>500), @@ -202,7 +202,7 @@ $form = new Form($db); $formfile = new FormFile($db); $objectstatic = new Fichinter($db); $companystatic = new Societe($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $projetstatic = new Project($db); } if (!empty($conf->contrat->enabled)) { @@ -234,7 +234,7 @@ if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .= " fd.rowid as lineid, fd.description as descriptiondetail, fd.date as dp, fd.duree,"; } $sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.status as thirdpartystatus"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title"; } if (!empty($conf->contrat->enabled)) { @@ -251,7 +251,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid"; } if (!empty($conf->contrat->enabled)) { diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php index 579760cf55f..be5f67da555 100644 --- a/htdocs/fichinter/note.php +++ b/htdocs/fichinter/note.php @@ -27,7 +27,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -88,7 +88,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 418d8fa6600..17146eecd35 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -473,7 +473,6 @@ class SupplierInvoices extends DolibarrApi $paiement->multicurrency_amounts = $multicurrency_amounts; // Array with all payments dispatching $paiement->paiementid = $payment_mode_id; $paiement->paiementcode = dol_getIdFromCode($this->db, $payment_mode_id, 'c_paiement', 'id', 'code', 1); - $paiement->oper = $paiement->paiementcode; // For backward compatibility $paiement->num_payment = $num_payment; $paiement->note_public = $comment; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 1d0e370355f..00208d53a19 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -218,7 +218,7 @@ class CommandeFournisseur extends CommonOrder 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25, 'searchall'=>1), 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), 'ref_supplier' =>array('type'=>'varchar(255)', 'label'=>'RefOrderSupplierShort', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>1), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>45), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>45), 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60), 'date_approve' =>array('type'=>'datetime', 'label'=>'DateApprove', 'enabled'=>1, 'visible'=>-1, 'position'=>62), 'date_approve2' =>array('type'=>'datetime', 'label'=>'DateApprove2', 'enabled'=>1, 'visible'=>3, 'position'=>64), diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 5bfafff57b5..27c991e5896 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -75,7 +75,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine public $fk_product; /** - * @var int ID + * @var int ID. Should be named fk_origin_line ? */ public $fk_commandefourndet; diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 9464c06bd4c..fe9c00c75f3 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -195,7 +195,7 @@ class FactureFournisseurRec extends CommonInvoice 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>210), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>85), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>85), 'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>'$conf->banque->enabled', 'visible'=>-1, 'position'=>175), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95), diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 948e1c01deb..48c5e88c2c5 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -297,7 +297,7 @@ class FactureFournisseur extends CommonInvoice 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>130), 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>135), 'fk_facture_source' =>array('type'=>'integer', 'label'=>'Fk facture source', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>145), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>145), 'fk_account' =>array('type'=>'integer', 'label'=>'Account', 'enabled'=>'$conf->banque->enabled', 'visible'=>-1, 'position'=>150), 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>155), 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>160), diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 0417554f8fd..b1f746b2245 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -49,7 +49,7 @@ if (!empty($conf->supplier_proposal->enabled)) { if (!empty($conf->product->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -160,7 +160,7 @@ $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatede // Project permission $caneditproject = false; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $caneditproject = empty($conf->global->SUPPLIER_ORDER_FORBID_EDIT_PROJECT) || ($object->statut == CommandeFournisseur::STATUS_DRAFT && preg_match('/^[\(]?PROV/i', $object->ref)); } @@ -1534,7 +1534,7 @@ $form = new Form($db); $formfile = new FormFile($db); $formorder = new FormOrder($db); $productstatic = new Product($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1746,7 +1746,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); @@ -2034,7 +2034,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index e521caf1080..f05251993a7 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -135,7 +135,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 362741e1641..7b352a01abc 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -553,7 +553,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index d54d5553efb..ca43b69fd5e 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -131,7 +131,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 728986f5a88..771a6faf23f 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -139,7 +139,7 @@ $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_ // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php index 1c67c03d727..d2c7398a98c 100644 --- a/htdocs/fourn/commande/note.php +++ b/htdocs/fourn/commande/note.php @@ -28,7 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -106,7 +106,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index cefc46599c4..e996f29b3c8 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; -if (! empty($conf->projet->enabled)) { +if (! empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; } require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; @@ -869,7 +869,7 @@ llxHeader('', $langs->trans("RepeatableSupplierInvoice"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (! empty($conf->projet->enabled)) { +if (! empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); @@ -898,7 +898,7 @@ if ($action == 'create') { print dol_get_fiche_head(null, '', '', 0); $rowspan = 4; - if (! empty($conf->projet->enabled)) $rowspan++; + if (! empty($conf->project->enabled)) $rowspan++; if ($object->fk_account > 0) $rowspan++; print ''; @@ -986,7 +986,7 @@ if ($action == 'create') { print ""; // Project - if (! empty($conf->projet->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { + if (! empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) { $projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project; $langs->load('projects'); print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); // Projet associe @@ -424,7 +424,7 @@ if ($id > 0) { $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, $user->rights->loan->write, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->loadLangs(array("projects")); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 1ed3e644b7f..3bc60980245 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -103,7 +103,7 @@ if ($object->id) { $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php index 3a5e95c7823..a0db5ca35a7 100644 --- a/htdocs/loan/info.php +++ b/htdocs/loan/info.php @@ -26,7 +26,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -67,7 +67,7 @@ $morehtmlref = '
    '; $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 0b982728b9e..c9b6ef0e679 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -30,7 +30,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/loan.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -92,7 +92,7 @@ if ($id > 0) { $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->loadLangs(array("projects")); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 62ad7519ac9..0944142bc1c 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -149,7 +149,7 @@ $morehtmlref = '
    '; $morehtmlref .= $form->editfieldkey("Label", 'label', $object->label, $object, 0, 'string', '', 0, 1); $morehtmlref .= $form->editfieldval("Label", 'label', $object->label, $object, 0, 'string', '', null, null, '', 1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->loadLangs(array("projects")); $morehtmlref .= '
    '.$langs->trans('Project').' : '; if ($user->rights->loan->write) { diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 47c2ce00b63..d07f5375657 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -109,7 +109,7 @@ class MyObject extends CommonObject 'amount' => array('type'=>'price', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for amount', 'validate'=>1), 'qty' => array('type'=>'real', 'label'=>'Qty', 'enabled'=>1, 'visible'=>1, 'default'=>'0', 'position'=>45, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text for quantity', 'css'=>'maxwidth75imp', 'validate'=>1), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'picto'=>'company', 'label'=>'ThirdParty', 'visible'=> 1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'help'=>'LinkToThirparty', 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>52, 'notnull'=>-1, 'index'=>1, 'validate'=>1, 'css'=>'maxwidth500 widthcentpercentminusxx'), 'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>3, 'position'=>60, 'validate'=>1), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'validate'=>1, 'cssview'=>'wordbreak'), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'validate'=>1, 'cssview'=>'wordbreak'), diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 164af332ed8..6b6f60bf8c6 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -210,7 +210,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 2b38b59b284..7702aa6699b 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -393,7 +393,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/modulebuilder/template/myobject_contact.php b/htdocs/modulebuilder/template/myobject_contact.php index 64f5ebba976..01efbec8cdc 100644 --- a/htdocs/modulebuilder/template/myobject_contact.php +++ b/htdocs/modulebuilder/template/myobject_contact.php @@ -173,7 +173,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index aa213461e24..df201c2653b 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -190,7 +190,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index bda60f90d52..368803a78a5 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -168,7 +168,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index b99d03050ce..eb7e99501f7 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -106,7 +106,7 @@ class Mo extends CommonObject 'qty' => array('type'=>'real', 'label'=>'QtyToProduce', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'notnull'=>1, 'comment'=>"Qty to produce", 'css'=>'width75', 'default'=>1, 'isameasure'=>1), 'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>42, 'notnull'=>-1, 'searchall'=>1, 'showoncombobox'=>'2', 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1', 'label'=>'ThirdParty', 'picto'=>'company', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax150'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1, 'css'=>'minwidth200 maxwidth400', 'csslist'=>'tdoverflowmax100'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'picto'=>'project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>51, 'notnull'=>-1, 'index'=>1, 'css'=>'minwidth200 maxwidth400', 'csslist'=>'tdoverflowmax100'), 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>'$conf->stock->enabled', 'visible'=>1, 'position'=>52, 'css'=>'maxwidth400', 'csslist'=>'tdoverflowmax200'), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61, 'notnull'=>-1,), 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62, 'notnull'=>-1,), diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 3317ddcfd43..2e8b6691c0f 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -153,7 +153,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 59cd99b7310..2c333ff616e 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -135,7 +135,7 @@ if (empty($reshook)) { //Create MO with Childs if ($action == 'add' && empty($id) && !empty($TBomLineId)) { - $noback = 0; + $noback = 1; include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; $mo_parent = $object; @@ -484,7 +484,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= $langs->trans('ThirdParty').' '; $morehtmlref .= ': '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php index acb5cb3e1c4..810ea7c3200 100644 --- a/htdocs/mrp/mo_document.php +++ b/htdocs/mrp/mo_document.php @@ -131,7 +131,7 @@ if ($object->id) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index 634f1caa092..f9496224a77 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -327,7 +327,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php index 6fb173c4295..865b3bf38ce 100644 --- a/htdocs/mrp/mo_note.php +++ b/htdocs/mrp/mo_note.php @@ -107,7 +107,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 8f121f2788f..16249087403 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -520,7 +520,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 9930093e6be..ab6d7ea083a 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -149,7 +149,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/partnership/partnership_card.php b/htdocs/partnership/partnership_card.php index 34896b46541..08164421f60 100644 --- a/htdocs/partnership/partnership_card.php +++ b/htdocs/partnership/partnership_card.php @@ -406,7 +406,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php index a4a61c6e907..094380ab83b 100644 --- a/htdocs/partnership/partnership_contact.php +++ b/htdocs/partnership/partnership_contact.php @@ -133,7 +133,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index f96eb6e58ec..3e7f78e5118 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -130,7 +130,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php index 67f963b155e..3bd2b913163 100644 --- a/htdocs/partnership/partnership_note.php +++ b/htdocs/partnership/partnership_note.php @@ -103,7 +103,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 750d3bbd1e4..0a21f9939ee 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -313,7 +313,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 2e157de504a..ea338e99971 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -493,7 +493,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 2b8ee3db6a4..0e7189ae038 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -277,7 +277,7 @@ $form = new Form($db); $formproduct = new FormProduct($db); $formcompany = new FormCompany($db); $formfile = new FormFile($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -310,7 +310,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load('projects'); print '
    '; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $projectid = $object->fk_project; $langs->load('projects'); print ''; print ''; -print ''; -if (!empty($conf->projet->enabled)) { +print ''; +if (!empty($conf->project->enabled)) { print ''; print '
    ' . $langs->trans('Project') . ''; @@ -1135,7 +1135,7 @@ if ($action == 'create') { $morehtmlref .= '
    ' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load('projects'); $morehtmlref .= '
    ' . $langs->trans('Project') . ' '; if ($usercancreate) { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 4ad8555ba24..a7d03c901c9 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -49,7 +49,7 @@ if (!empty($conf->product->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -1888,7 +1888,7 @@ $form = new Form($db); $formfile = new FormFile($db); $bankaccountstatic = new Account($db); $paymentstatic = new PaiementFourn($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -2405,7 +2405,7 @@ if ($action == 'create') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); @@ -2861,7 +2861,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { @@ -3236,7 +3236,7 @@ if ($action == 'create') { } $nbrows = 9; $nbcols = 3; - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $nbrows++; } if (!empty($conf->banque->enabled)) { diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index faa852d7984..85885ae866e 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 5b7d797a02f..d2f7181856a 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -116,7 +116,7 @@ if ($object->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index 0cbf0f17512..0f932c27bae 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -82,7 +82,7 @@ if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0 $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->facture->creer) { diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 7da3a224d4f..f876462e15f 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -248,7 +248,7 @@ llxHeader('', $langs->trans("RepeatableSupplierInvoices"), $help_url); $form = new Form($db); $formother = new FormOther($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } $companystatic = new Societe($db); diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php index 59902947cef..682d92b4515 100644 --- a/htdocs/fourn/facture/note.php +++ b/htdocs/fourn/facture/note.php @@ -30,7 +30,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -110,7 +110,7 @@ if ($object->id > 0) { $morehtmlref .= ' ('.$langs->trans("OtherBills").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer) { diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index e1b0ce6f581..a8a41b3fde6 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index b1f7057f6a5..afbd480e928 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -147,7 +147,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php index 61af793b28a..0cc25901302 100644 --- a/htdocs/hrm/evaluation_contact.php +++ b/htdocs/hrm/evaluation_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/job_contact.php b/htdocs/hrm/job_contact.php index 67da8ecfd91..76f6e73d690 100644 --- a/htdocs/hrm/job_contact.php +++ b/htdocs/hrm/job_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/position_contact.php b/htdocs/hrm/position_contact.php index a7246e3a82b..d26ea1bf575 100644 --- a/htdocs/hrm/position_contact.php +++ b/htdocs/hrm/position_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/hrm/skill_contact.php b/htdocs/hrm/skill_contact.php index d8fecd74610..5f284c4e72c 100644 --- a/htdocs/hrm/skill_contact.php +++ b/htdocs/hrm/skill_contact.php @@ -139,7 +139,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php b/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php index 6b8b9178f6b..ce148874d02 100644 --- a/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php +++ b/htdocs/includes/restler/framework/Luracast/Restler/CommentParser.php @@ -19,505 +19,504 @@ use Luracast\Restler\Data\Text; */ class CommentParser { - /** - * name for the embedded data - * - * @var string - */ - public static $embeddedDataName = 'properties'; - /** - * Regular Expression pattern for finding the embedded data and extract - * the inner information. It is used with preg_match. - * - * @var string - */ - public static $embeddedDataPattern - = '/```(\w*)[\s]*(([^`]*`{0,2}[^`]+)*)```/ms'; - /** - * Pattern will have groups for the inner details of embedded data - * this index is used to locate the data portion. - * - * @var int - */ - public static $embeddedDataIndex = 2; - /** - * Delimiter used to split the array data. - * - * When the name portion is of the embedded data is blank auto detection - * will be used and if URLEncodedFormat is detected as the data format - * the character specified will be used as the delimiter to find split - * array data. - * - * @var string - */ - public static $arrayDelimiter = ','; + /** + * name for the embedded data + * + * @var string + */ + public static $embeddedDataName = 'properties'; + /** + * Regular Expression pattern for finding the embedded data and extract + * the inner information. It is used with preg_match. + * + * @var string + */ + public static $embeddedDataPattern + = '/```(\w*)[\s]*(([^`]*`{0,2}[^`]+)*)```/ms'; + /** + * Pattern will have groups for the inner details of embedded data + * this index is used to locate the data portion. + * + * @var int + */ + public static $embeddedDataIndex = 2; + /** + * Delimiter used to split the array data. + * + * When the name portion is of the embedded data is blank auto detection + * will be used and if URLEncodedFormat is detected as the data format + * the character specified will be used as the delimiter to find split + * array data. + * + * @var string + */ + public static $arrayDelimiter = ','; - /** - * @var array annotations that support array value - */ - public static $allowsArrayValue = array( - 'choice' => true, - 'select' => true, - 'properties' => true, - ); + /** + * @var array annotations that support array value + */ + public static $allowsArrayValue = array( + 'choice' => true, + 'select' => true, + 'properties' => true, + ); - /** - * character sequence used to escape \@ - */ - const escapedAtChar = '\\@'; + /** + * character sequence used to escape \@ + */ + const escapedAtChar = '\\@'; - /** - * character sequence used to escape end of comment - */ - const escapedCommendEnd = '{@*}'; + /** + * character sequence used to escape end of comment + */ + const escapedCommendEnd = '{@*}'; - /** - * Instance of Restler class injected at runtime. - * - * @var Restler - */ - public $restler; - /** - * Comment information is parsed and stored in to this array. - * - * @var array - */ - private $_data = array(); + /** + * Instance of Restler class injected at runtime. + * + * @var Restler + */ + public $restler; + /** + * Comment information is parsed and stored in to this array. + * + * @var array + */ + private $_data = array(); - /** - * Parse the comment and extract the data. - * - * @static - * - * @param $comment - * @param bool $isPhpDoc - * - * @return array associative array with the extracted values - */ - public static function parse($comment, $isPhpDoc = true) - { - $p = new self(); - if (empty($comment)) { - return $p->_data; - } + /** + * Parse the comment and extract the data. + * + * @static + * + * @param $comment + * @param bool $isPhpDoc + * + * @return array associative array with the extracted values + */ + public static function parse($comment, $isPhpDoc = true) + { + $p = new self(); + if (empty($comment)) { + return $p->_data; + } - if ($isPhpDoc) { - $comment = self::removeCommentTags($comment); - } + if ($isPhpDoc) { + $comment = self::removeCommentTags($comment); + } - $p->extractData($comment); - return $p->_data; + $p->extractData($comment); + return $p->_data; + } - } + /** + * Removes the comment tags from each line of the comment. + * + * @static + * + * @param string $comment PhpDoc style comment + * + * @return string comments with out the tags + */ + public static function removeCommentTags($comment) + { + $pattern = '/(^\/\*\*)|(^\s*\**[ \/]?)|\s(?=@)|\s\*\//m'; + return preg_replace($pattern, '', $comment); + } - /** - * Removes the comment tags from each line of the comment. - * - * @static - * - * @param string $comment PhpDoc style comment - * - * @return string comments with out the tags - */ - public static function removeCommentTags($comment) - { - $pattern = '/(^\/\*\*)|(^\s*\**[ \/]?)|\s(?=@)|\s\*\//m'; - return preg_replace($pattern, '', $comment); - } + /** + * Extracts description and long description, uses other methods to get + * parameters. + * + * @param $comment + * + * @return array + */ + private function extractData($comment) + { + //to use @ as part of comment we need to + $comment = str_replace( + array(self::escapedCommendEnd, self::escapedAtChar), + array('*/', '@'), + $comment); - /** - * Extracts description and long description, uses other methods to get - * parameters. - * - * @param $comment - * - * @return array - */ - private function extractData($comment) - { - //to use @ as part of comment we need to - $comment = str_replace( - array(self::escapedCommendEnd, self::escapedAtChar), - array('*/', '@'), - $comment); + $description = array(); + $longDescription = array(); + $params = array(); - $description = array(); - $longDescription = array(); - $params = array(); + $mode = 0; // extract short description; + $comments = preg_split("/(\r?\n)/", $comment); + // remove first blank line; + array_shift($comments); + $addNewline = false; + foreach ($comments as $line) { + $line = trim($line); + $newParam = false; + if (empty($line)) { + if ($mode == 0) { + $mode++; + } else { + $addNewline = true; + } + continue; + } elseif ($line[0] == '@') { + $mode = 2; + $newParam = true; + } + switch ($mode) { + case 0 : + $description[] = $line; + if (count($description) > 3) { + // if more than 3 lines take only first line + $longDescription = $description; + $description[] = array_shift($longDescription); + $mode = 1; + } elseif (substr($line, -1) == '.') { + $mode = 1; + } + break; + case 1 : + if ($addNewline) { + $line = ' ' . $line; + } + $longDescription[] = $line; + break; + case 2 : + $newParam + ? $params[] = $line + : $params[count($params) - 1] .= ' ' . $line; + } + $addNewline = false; + } + $description = implode(' ', $description); + $longDescription = implode(' ', $longDescription); + $description = preg_replace('/\s+/msu', ' ', $description); + $longDescription = preg_replace('/\s+/msu', ' ', $longDescription); + list($description, $d1) + = $this->parseEmbeddedData($description); + list($longDescription, $d2) + = $this->parseEmbeddedData($longDescription); + $this->_data = compact('description', 'longDescription'); + $d2 += $d1; + if (!empty($d2)) { + $this->_data[self::$embeddedDataName] = $d2; + } + foreach ($params as $key => $line) { + list(, $param, $value) = preg_split('/\@|\s/', $line, 3) + + array('', '', ''); + list($value, $embedded) = $this->parseEmbeddedData($value); + $value = array_filter(preg_split('/\s+/msu', $value), 'strlen'); + $this->parseParam($param, $value, $embedded); + } + return $this->_data; + } - $mode = 0; // extract short description; - $comments = preg_split("/(\r?\n)/", $comment); - // remove first blank line; - array_shift($comments); - $addNewline = false; - foreach ($comments as $line) { - $line = trim($line); - $newParam = false; - if (empty ($line)) { - if ($mode == 0) { - $mode++; - } else { - $addNewline = true; - } - continue; - } elseif ($line[0] == '@') { - $mode = 2; - $newParam = true; - } - switch ($mode) { - case 0 : - $description[] = $line; - if (count($description) > 3) { - // if more than 3 lines take only first line - $longDescription = $description; - $description[] = array_shift($longDescription); - $mode = 1; - } elseif (substr($line, -1) == '.') { - $mode = 1; - } - break; - case 1 : - if ($addNewline) { - $line = ' ' . $line; - } - $longDescription[] = $line; - break; - case 2 : - $newParam - ? $params[] = $line - : $params[count($params) - 1] .= ' ' . $line; - } - $addNewline = false; - } - $description = implode(' ', $description); - $longDescription = implode(' ', $longDescription); - $description = preg_replace('/\s+/msu', ' ', $description); - $longDescription = preg_replace('/\s+/msu', ' ', $longDescription); - list($description, $d1) - = $this->parseEmbeddedData($description); - list($longDescription, $d2) - = $this->parseEmbeddedData($longDescription); - $this->_data = compact('description', 'longDescription'); - $d2 += $d1; - if (!empty($d2)) { - $this->_data[self::$embeddedDataName] = $d2; - } - foreach ($params as $key => $line) { - list(, $param, $value) = preg_split('/\@|\s/', $line, 3) - + array('', '', ''); - list($value, $embedded) = $this->parseEmbeddedData($value); - $value = array_filter(preg_split('/\s+/msu', $value), 'strlen'); - $this->parseParam($param, $value, $embedded); - } - return $this->_data; - } + /** + * Parse parameters that begin with (at) + * + * @param $param + * @param array $value + * @param array $embedded + */ + private function parseParam($param, array $value, array $embedded) + { + $data = &$this->_data; + $allowMultiple = false; + switch ($param) { + case 'param' : + case 'property' : + case 'property-read' : + case 'property-write' : + $value = $this->formatParam($value); + $allowMultiple = true; + break; + case 'var' : + $value = $this->formatVar($value); + break; + case 'return' : + $value = $this->formatReturn($value); + break; + case 'class' : + $data = &$data[$param]; + list ($param, $value) = $this->formatClass($value); + break; + case 'access' : + $value = reset($value); + break; + case 'expires' : + case 'status' : + $value = intval(reset($value)); + break; + case 'throws' : + $value = $this->formatThrows($value); + $allowMultiple = true; + break; + case 'author': + $value = $this->formatAuthor($value); + $allowMultiple = true; + break; + case 'header' : + case 'link': + case 'example': + case 'todo': + $allowMultiple = true; + //don't break, continue with code for default: + default : + $value = implode(' ', $value); + } + if (!empty($embedded)) { + if (is_string($value)) { + $value = array('description' => $value); + } + $value[self::$embeddedDataName] = $embedded; + } + if (empty($data[$param])) { + if ($allowMultiple) { + $data[$param] = array( + $value + ); + } else { + $data[$param] = $value; + } + } elseif ($allowMultiple) { + $data[$param][] = $value; + } elseif ($param == 'param') { + $arr = array( + $data[$param], + $value + ); + $data[$param] = $arr; + } else { + if (!is_string($value) && isset($value[self::$embeddedDataName]) + && isset($data[$param][self::$embeddedDataName]) + ) { + $value[self::$embeddedDataName] + += $data[$param][self::$embeddedDataName]; + } + if (!is_array($data[$param])) { + $data[$param] = array('description' => (string) $data[$param]); + } + if (is_array($value)) { + $data[$param] = $value + $data[$param]; + } + } + } - /** - * Parse parameters that begin with (at) - * - * @param $param - * @param array $value - * @param array $embedded - */ - private function parseParam($param, array $value, array $embedded) - { - $data = &$this->_data; - $allowMultiple = false; - switch ($param) { - case 'param' : - case 'property' : - case 'property-read' : - case 'property-write' : - $value = $this->formatParam($value); - $allowMultiple = true; - break; - case 'var' : - $value = $this->formatVar($value); - break; - case 'return' : - $value = $this->formatReturn($value); - break; - case 'class' : - $data = &$data[$param]; - list ($param, $value) = $this->formatClass($value); - break; - case 'access' : - $value = reset($value); - break; - case 'expires' : - case 'status' : - $value = intval(reset($value)); - break; - case 'throws' : - $value = $this->formatThrows($value); - $allowMultiple = true; - break; - case 'author': - $value = $this->formatAuthor($value); - $allowMultiple = true; - break; - case 'header' : - case 'link': - case 'example': - case 'todo': - $allowMultiple = true; - //don't break, continue with code for default: - default : - $value = implode(' ', $value); - } - if (!empty($embedded)) { - if (is_string($value)) { - $value = array('description' => $value); - } - $value[self::$embeddedDataName] = $embedded; - } - if (empty ($data[$param])) { - if ($allowMultiple) { - $data[$param] = array( - $value - ); - } else { - $data[$param] = $value; - } - } elseif ($allowMultiple) { - $data[$param][] = $value; - } elseif ($param == 'param') { - $arr = array( - $data[$param], - $value - ); - $data[$param] = $arr; - } else { - if (!is_string($value) && isset($value[self::$embeddedDataName]) - && isset($data[$param][self::$embeddedDataName]) - ) { - $value[self::$embeddedDataName] - += $data[$param][self::$embeddedDataName]; - } - if (!is_array($data[$param])) { - $data[$param] = array('description' => (string)$data[$param]); - } - if (is_array($value)) { - $data[$param] = $value + $data[$param]; - } - } - } + /** + * Parses the inline php doc comments and embedded data. + * + * @param $subject + * + * @return array + * @throws Exception + */ + private function parseEmbeddedData($subject) + { + $data = array(); - /** - * Parses the inline php doc comments and embedded data. - * - * @param $subject - * - * @return array - * @throws Exception - */ - private function parseEmbeddedData($subject) - { - $data = array(); + //parse {@pattern } tags specially + while (preg_match('|(?s-m)({@pattern (/.+/[imsxuADSUXJ]*)})|', $subject, $matches)) { + $subject = str_replace($matches[0], '', $subject); + $data['pattern'] = $matches[2]; + } + while (preg_match('/{@(\w+)\s?([^}]*)}/ms', $subject, $matches)) { + $name = $matches[1]; + $value = $matches[2]; + $subject = str_replace($matches[0], '', $subject); + if ($name == 'pattern') { + throw new Exception('Inline pattern tag should follow {@pattern /REGEX_PATTERN_HERE/} format and can optionally include PCRE modifiers following the ending `/`'); + } elseif (isset(static::$allowsArrayValue[$name])) { + $value = explode(static::$arrayDelimiter, $value); + } elseif ($value == 'true' || $value == 'false') { + $value = $value == 'true'; + } elseif ($value == '') { + $value = true; + } elseif ($name == 'required') { + $value = explode(static::$arrayDelimiter, $value); + } + if (defined('Luracast\\Restler\\UI\\HtmlForm::'.$name)) { + $value = constant($value); + } + $data[$name] = $value; + } - //parse {@pattern } tags specially - while (preg_match('|(?s-m)({@pattern (/.+/[imsxuADSUXJ]*)})|', $subject, $matches)) { - $subject = str_replace($matches[0], '', $subject); - $data['pattern'] = $matches[2]; - } - while (preg_match('/{@(\w+)\s?([^}]*)}/ms', $subject, $matches)) { - $name = $matches[1]; - $value = $matches[2]; - $subject = str_replace($matches[0], '', $subject); - if ($name == 'pattern') { - throw new Exception('Inline pattern tag should follow {@pattern /REGEX_PATTERN_HERE/} format and can optionally include PCRE modifiers following the ending `/`'); - } elseif (isset(static::$allowsArrayValue[$name])) { - $value = explode(static::$arrayDelimiter, $value); - } elseif ($value == 'true' || $value == 'false') { - $value = $value == 'true'; - } elseif ($value == '') { - $value = true; - } elseif ($name == 'required') { - $value = explode(static::$arrayDelimiter, $value); - } - if (defined('Luracast\\Restler\\UI\\HtmlForm::'.$name)) { - $value = constant($value); - } - $data[$name] = $value; - } + while (preg_match(self::$embeddedDataPattern, $subject, $matches)) { + $subject = str_replace($matches[0], '', $subject); + $str = $matches[self::$embeddedDataIndex]; + if (isset($this->restler) + && self::$embeddedDataIndex > 1 + && !empty($name) + ) { + $extension = $name; + $formatMap = $this->restler->getFormatMap(); + if (isset($formatMap[$extension])) { + /** + * @var \Luracast\Restler\Format\iFormat + */ + $format = $formatMap[$extension]; + $format = new $format(); + $data = $format->decode($str); + } + } else { // auto detect + if ($str[0] == '{') { + $d = json_decode($str, true); + if (json_last_error() != JSON_ERROR_NONE) { + throw new Exception('Error parsing embedded JSON data' + . " $str"); + } + $data = $d + $data; + } else { + parse_str($str, $d); + //clean up + $d = array_filter($d); + foreach ($d as $key => $val) { + $kt = trim($key); + if ($kt != $key) { + unset($d[$key]); + $key = $kt; + $d[$key] = $val; + } + if (is_string($val)) { + if ($val == 'true' || $val == 'false') { + $d[$key] = $val == 'true' ? true : false; + } else { + $val = explode(self::$arrayDelimiter, $val); + if (count($val) > 1) { + $d[$key] = $val; + } else { + $d[$key] = + preg_replace('/\s+/msu', ' ', + $d[$key]); + } + } + } + } + $data = $d + $data; + } + } + } + return array($subject, $data); + } - while (preg_match(self::$embeddedDataPattern, $subject, $matches)) { - $subject = str_replace($matches[0], '', $subject); - $str = $matches[self::$embeddedDataIndex]; - if (isset ($this->restler) - && self::$embeddedDataIndex > 1 - && !empty ($name) - ) { - $extension = $name; - $formatMap = $this->restler->getFormatMap(); - if (isset ($formatMap[$extension])) { - /** - * @var \Luracast\Restler\Format\iFormat - */ - $format = $formatMap[$extension]; - $format = new $format(); - $data = $format->decode($str); - } - } else { // auto detect - if ($str[0] == '{') { - $d = json_decode($str, true); - if (json_last_error() != JSON_ERROR_NONE) { - throw new Exception('Error parsing embedded JSON data' - . " $str"); - } - $data = $d + $data; - } else { - parse_str($str, $d); - //clean up - $d = array_filter($d); - foreach ($d as $key => $val) { - $kt = trim($key); - if ($kt != $key) { - unset($d[$key]); - $key = $kt; - $d[$key] = $val; - } - if (is_string($val)) { - if ($val == 'true' || $val == 'false') { - $d[$key] = $val == 'true' ? true : false; - } else { - $val = explode(self::$arrayDelimiter, $val); - if (count($val) > 1) { - $d[$key] = $val; - } else { - $d[$key] = - preg_replace('/\s+/msu', ' ', - $d[$key]); - } - } - } - } - $data = $d + $data; - } - } - } - return array($subject, $data); - } + private function formatThrows(array $value) + { + $code = 500; + $exception = 'Exception'; + if (count($value) > 1) { + $v1 = $value[0]; + $v2 = $value[1]; + if (is_numeric($v1)) { + $code = $v1; + $exception = $v2; + array_shift($value); + array_shift($value); + } elseif (is_numeric($v2)) { + $code = $v2; + $exception = $v1; + array_shift($value); + array_shift($value); + } else { + $exception = $v1; + array_shift($value); + } + } elseif (count($value) && isset($value[0]) && is_numeric($value[0])) { + $code = $value[0]; + array_shift($value); + } + $message = implode(' ', $value); + if (!isset(RestException::$codes[$code])) { + $code = 500; + } elseif (empty($message)) { + $message = RestException::$codes[$code]; + } + return compact('code', 'message', 'exception'); + } - private function formatThrows(array $value) - { - $code = 500; - $exception = 'Exception'; - if (count($value) > 1) { - $v1 = $value[0]; - $v2 = $value[1]; - if (is_numeric($v1)) { - $code = $v1; - $exception = $v2; - array_shift($value); - array_shift($value); - } elseif (is_numeric($v2)) { - $code = $v2; - $exception = $v1; - array_shift($value); - array_shift($value); - } else { - $exception = $v1; - array_shift($value); - } - } elseif (count($value) && is_numeric($value[0])) { - $code = $value[0]; - array_shift($value); - } - $message = implode(' ', $value); - if (!isset(RestException::$codes[$code])) { - $code = 500; - } elseif (empty($message)) { - $message = RestException::$codes[$code]; - } - return compact('code', 'message', 'exception'); - } + private function formatClass(array $value) + { + $param = array_shift($value); - private function formatClass(array $value) - { - $param = array_shift($value); + if (empty($param)) { + $param = 'Unknown'; + } + $value = implode(' ', $value); + return array( + ltrim($param, '\\'), + array('description' => $value) + ); + } - if (empty($param)) { - $param = 'Unknown'; - } - $value = implode(' ', $value); - return array( - ltrim($param, '\\'), - array('description' => $value) - ); - } + private function formatAuthor(array $value) + { + $r = array(); + $email = end($value); + if ($email[0] == '<') { + $email = substr($email, 1, -1); + array_pop($value); + $r['email'] = $email; + } + $r['name'] = implode(' ', $value); + return $r; + } - private function formatAuthor(array $value) - { - $r = array(); - $email = end($value); - if ($email[0] == '<') { - $email = substr($email, 1, -1); - array_pop($value); - $r['email'] = $email; - } - $r['name'] = implode(' ', $value); - return $r; - } + private function formatReturn(array $value) + { + $data = explode('|', array_shift($value)); + $r = array( + 'type' => count($data) == 1 ? $data[0] : $data + ); + $r['description'] = implode(' ', $value); + return $r; + } - private function formatReturn(array $value) - { - $data = explode('|', array_shift($value)); - $r = array( - 'type' => count($data) == 1 ? $data[0] : $data - ); - $r['description'] = implode(' ', $value); - return $r; - } + private function formatParam(array $value) + { + $r = array(); + $data = array_shift($value); + if (empty($data)) { + $r['type'] = 'mixed'; + } elseif ($data[0] == '$') { + $r['name'] = substr($data, 1); + $r['type'] = 'mixed'; + } else { + $data = explode('|', $data); + $r['type'] = count($data) == 1 ? $data[0] : $data; - private function formatParam(array $value) - { - $r = array(); - $data = array_shift($value); - if (empty($data)) { - $r['type'] = 'mixed'; - } elseif ($data[0] == '$') { - $r['name'] = substr($data, 1); - $r['type'] = 'mixed'; - } else { - $data = explode('|', $data); - $r['type'] = count($data) == 1 ? $data[0] : $data; + $data = array_shift($value); + if (!empty($data) && $data[0] == '$') { + $r['name'] = substr($data, 1); + } + } + if (isset($r['type']) && is_string($r['type']) && Text::endsWith($r['type'], '[]')) { + $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); + $r['type'] = 'array'; + } + if ($value) { + $r['description'] = implode(' ', $value); + } + return $r; + } - $data = array_shift($value); - if (!empty($data) && $data[0] == '$') { - $r['name'] = substr($data, 1); - } - } - if (isset($r['type']) && is_string($r['type']) && Text::endsWith($r['type'], '[]')) { - $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); - $r['type'] = 'array'; - } - if ($value) { - $r['description'] = implode(' ', $value); - } - return $r; - } - - private function formatVar(array $value) - { - $r = array(); - $data = array_shift($value); - if (empty($data)) { - $r['type'] = 'mixed'; - } elseif ($data[0] == '$') { - $r['name'] = substr($data, 1); - $r['type'] = 'mixed'; - } else { - $data = explode('|', $data); - $r['type'] = count($data) == 1 ? $data[0] : $data; - } - if (isset($r['type']) && Text::endsWith($r['type'], '[]')) { - $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); - $r['type'] = 'array'; - } - if ($value) { - $r['description'] = implode(' ', $value); - } - return $r; - } + private function formatVar(array $value) + { + $r = array(); + $data = array_shift($value); + if (empty($data)) { + $r['type'] = 'mixed'; + } elseif ($data[0] == '$') { + $r['name'] = substr($data, 1); + $r['type'] = 'mixed'; + } else { + $data = explode('|', $data); + $r['type'] = count($data) == 1 ? $data[0] : $data; + } + if (isset($r['type']) && Text::endsWith($r['type'], '[]')) { + $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); + $r['type'] = 'array'; + } + if ($value) { + $r['description'] = implode(' ', $value); + } + return $r; + } } diff --git a/htdocs/index.php b/htdocs/index.php index 08b818bac63..6ada359cee6 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -145,7 +145,6 @@ $boxstatFromHook = ''; $langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts')); // Dolibarr Working Board with weather - if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { $showweather = (empty($conf->global->MAIN_DISABLE_METEO) || $conf->global->MAIN_DISABLE_METEO == 2) ? 1 : 0; @@ -163,14 +162,14 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) { } // Number of project opened - if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $board = new Project($db); $dashboardlines[$board->element] = $board->load_board($user); } // Number of tasks to do (late) - if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) { + if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) { include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; $board = new Task($db); $dashboardlines[$board->element] = $board->load_board($user); diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 003faa326d5..37c6b9a6e3c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -149,7 +149,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index e9c58bf31a4..baddd9e29a5 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -366,7 +366,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_contact.php b/htdocs/knowledgemanagement/knowledgerecord_contact.php index c338653b840..2b2facafc18 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_contact.php +++ b/htdocs/knowledgemanagement/knowledgerecord_contact.php @@ -132,7 +132,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php index dbffe6aa3da..ec88c33d882 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_document.php +++ b/htdocs/knowledgemanagement/knowledgerecord_document.php @@ -130,7 +130,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/knowledgemanagement/knowledgerecord_note.php b/htdocs/knowledgemanagement/knowledgerecord_note.php index 2e58480adec..0f56a6115a3 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_note.php +++ b/htdocs/knowledgemanagement/knowledgerecord_note.php @@ -104,7 +104,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 4bc539c1ff0..3ad898cda98 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -309,7 +309,7 @@ if ($action == 'create') { print '
    '.$langs->trans("Insurance").'
    '.$langs->trans('Project').''; print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); @@ -431,7 +431,7 @@ if ($action == 'create') { $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.img_picto('', 'project').' '.$langs->trans('Project').' '; if ($usercancreate) { @@ -849,7 +849,7 @@ if ($action == 'create') { print '
    '.$langs->trans('Project').''; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 5d1da2b22ab..fb8c8d55768 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -129,7 +129,7 @@ class Entrepot extends CommonObject 'description' =>array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-2, 'position'=>35, 'searchall'=>1), 'lieu' =>array('type'=>'varchar(64)', 'label'=>'LocationSummary', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'showoncombobox'=>2, 'searchall'=>1), 'fk_parent' =>array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:1:statut=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ParentWarehouse', 'enabled'=>1, 'visible'=>-2, 'position'=>41), - 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>25), + 'fk_project' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>25), 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-2, 'position'=>45, 'searchall'=>1), 'zip' =>array('type'=>'varchar(10)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-2, 'position'=>50, 'searchall'=>1), 'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-2, 'position'=>55, 'searchall'=>1), diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 735fc3bfa64..b913fd0cf38 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -119,7 +119,7 @@ class MouvementStock extends CommonObject 'fk_origin' =>array('type'=>'integer', 'label'=>'Fk origin', 'enabled'=>1, 'visible'=>-1, 'position'=>60), 'origintype' =>array('type'=>'varchar(32)', 'label'=>'Origintype', 'enabled'=>1, 'visible'=>-1, 'position'=>65), 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>70), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>75), + 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>75), 'inventorycode' =>array('type'=>'varchar(128)', 'label'=>'InventoryCode', 'enabled'=>1, 'visible'=>-1, 'position'=>80), 'batch' =>array('type'=>'varchar(30)', 'label'=>'Batch', 'enabled'=>1, 'visible'=>-1, 'position'=>85), 'eatby' =>array('type'=>'date', 'label'=>'Eatby', 'enabled'=>1, 'visible'=>-1, 'position'=>90), diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php index db6560a9970..de9f72fbcd6 100644 --- a/htdocs/product/stock/info.php +++ b/htdocs/product/stock/info.php @@ -59,7 +59,7 @@ $morehtmlref = '
    '; $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.img_picto('', 'project').' '.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 9dc82c7d09a..d7830d49615 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -425,7 +425,7 @@ $userstatic = new User($db); $form = new Form($db); $formother = new FormOther($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 775e07d6118..34a2a074ec5 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/stock.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -593,7 +593,7 @@ $movement = new MouvementStock($db); $userstatic = new User($db); $form = new Form($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -800,7 +800,7 @@ if ($object->id > 0) { $morehtmlref .= $langs->trans("LocationSummary").' : '.$object->lieu; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.img_picto('', 'project').' '.$langs->trans('Project').' '; if ($usercancreate && 1 == 2) { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index b9fc1a201e5..3054e6785bd 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productstockentrepot.class. if (!empty($conf->productbatch->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -524,7 +524,7 @@ if ($action == 'updateline' && GETPOST('save') == $langs->trans("Save")) { $form = new Form($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index 6523d66552f..ed494bb58b5 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -148,7 +148,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index 2a61d44eb9e..b88df4e1da1 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -596,7 +596,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= $langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '').'
    '; } // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.=$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php index d2cb095932b..691d2ea2f9d 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php @@ -143,7 +143,7 @@ if ($object->id > 0) { $morehtmlref .= '
    ' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1, 'customer'); } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->stocktransfer->stocktransfer->write) { diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_document.php b/htdocs/product/stock/stocktransfer/stocktransfer_document.php index ab4b45b6864..e4675378d20 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_document.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_document.php @@ -136,7 +136,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_note.php b/htdocs/product/stock/stocktransfer/stocktransfer_note.php index 41842d07ee5..1932b685e24 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_note.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_note.php @@ -109,7 +109,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 6afea0abe54..481b6c0fde3 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -156,8 +156,8 @@ if (!empty($conf->productbatch->enabled) && // Purchase price and project print '
    '.$langs->trans("UnitPurchaseValue").''.$langs->trans('Project').''; print img_picto('', 'project'); diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 4f30054155a..c191b3baeaa 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -431,7 +431,7 @@ $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 .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; -$nav .= ' '; +$nav .= ' '; $picto = 'clock'; diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 156080eefb3..79ee8c6172e 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -347,7 +347,7 @@ $nav = '".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%Y").", ".$langs->trans(date('F', mktime(0, 0, 0, $month, 10)))." \n"; $nav .= ''.img_next($langs->trans("Next"))."\n"; $nav .= ' '.$form->selectDate(-1, '', 0, 0, 2, "addtime", 1, 1).' '; -$nav .= ' '; +$nav .= ' '; $picto = 'clock'; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 813dccf8a73..0cfe126d69b 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -390,7 +390,7 @@ if (empty($reshook)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $langs->load("other"); - $upload_dir = $conf->projet->dir_output; + $upload_dir = $conf->project->dir_output; $file = $upload_dir.'/'.GETPOST('file'); $ret = dol_delete_file($file, 0, 0, 0, $object); if ($ret) { @@ -1394,7 +1394,7 @@ if ($action == 'create' && $user->rights->projet->creer) { * Generated documents */ $filename = dol_sanitizeFileName($object->ref); - $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->ref); + $filedir = $conf->project->dir_output."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = ($user->rights->projet->lire && $userAccess > 0); $delallowed = ($user->rights->projet->creer && $userWrite > 0); @@ -1418,7 +1418,7 @@ if ($action == 'create' && $user->rights->projet->creer) { // Presend form $modelmail = 'project'; $defaulttopic = 'SendProjectRef'; - $diroutput = $conf->projet->dir_output; + $diroutput = $conf->project->dir_output; $autocopy = 'MAIN_MAIL_AUTOCOPY_PROJECT_TO'; // used to know the automatic BCC to add $trackid = 'proj'.$object->id; diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 28c8cb656d1..0c56ecf0677 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -546,9 +546,9 @@ class Project extends CommonObject if (!$error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref)) { // We remove directory - if ($conf->projet->dir_output) { - $olddir = $conf->projet->dir_output."/".dol_sanitizeFileName($this->oldcopy->ref); - $newdir = $conf->projet->dir_output."/".dol_sanitizeFileName($this->ref); + if ($conf->project->dir_output) { + $olddir = $conf->project->dir_output."/".dol_sanitizeFileName($this->oldcopy->ref); + $newdir = $conf->project->dir_output."/".dol_sanitizeFileName($this->ref); if (file_exists($olddir)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $res = @rename($olddir, $newdir); @@ -909,8 +909,8 @@ class Project extends CommonObject if (empty($error)) { // We remove directory $projectref = dol_sanitizeFileName($this->ref); - if ($conf->projet->dir_output) { - $dir = $conf->projet->dir_output."/".$projectref; + if ($conf->project->dir_output) { + $dir = $conf->project->dir_output."/".$projectref; if (file_exists($dir)) { $res = @dol_delete_dir_recursive($dir); if (!$res) { @@ -1643,8 +1643,8 @@ class Project extends CommonObject if ($clone_project_file) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $clone_project_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($defaultref); - $ori_project_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($orign_project_ref); + $clone_project_dir = $conf->project->dir_output."/".dol_sanitizeFileName($defaultref); + $ori_project_dir = $conf->project->dir_output."/".dol_sanitizeFileName($orign_project_ref); if (dol_mkdir($clone_project_dir) >= 0) { $filearray = dol_dir_list($ori_project_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', '', SORT_ASC, 1); @@ -2058,7 +2058,7 @@ class Project extends CommonObject $project_static = new Project($this->db); $response = new WorkboardResponse(); - $response->warning_delay = $conf->projet->warning_delay / 60 / 60 / 24; + $response->warning_delay = $conf->project->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("OpenedProjects"); $response->labelShort = $langs->trans("Opened"); if ($user->rights->projet->all->lire) { @@ -2162,7 +2162,7 @@ class Project extends CommonObject $now = dol_now(); - return ($this->date_end) < ($now - $conf->projet->warning_delay); + return ($this->date_end) < ($now - $conf->project->warning_delay); } diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 79152c6cfb9..c5fefc2e0b1 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -473,12 +473,12 @@ class Task extends CommonObjectLine if (!$error && (is_object($this->oldcopy) && $this->oldcopy->ref !== $this->ref)) { // We remove directory - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { $project = new Project($this->db); $project->fetch($this->fk_project); - $olddir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->oldcopy->ref); - $newdir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->ref); + $olddir = $conf->project->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->oldcopy->ref); + $newdir = $conf->project->dir_output.'/'.dol_sanitizeFileName($project->ref).'/'.dol_sanitizeFileName($this->ref); if (file_exists($olddir)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $res = dol_move_dir($olddir, $newdir); @@ -600,11 +600,11 @@ class Task extends CommonObjectLine return -1 * $error; } else { //Delete associated link file - if ($conf->projet->dir_output) { + if ($conf->project->dir_output) { $projectstatic = new Project($this->db); $projectstatic->fetch($this->fk_project); - $dir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($this->id); + $dir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($this->id); dol_syslog(get_class($this)."::delete dir=".$dir, LOG_DEBUG); if (file_exists($dir)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -1957,8 +1957,8 @@ class Task extends CommonObjectLine $clone_project_ref = $ori_project_ref; } - $clone_task_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($clone_project_ref)."/".dol_sanitizeFileName($clone_task_ref); - $ori_task_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($ori_project_ref)."/".dol_sanitizeFileName($fromid); + $clone_task_dir = $conf->project->dir_output."/".dol_sanitizeFileName($clone_project_ref)."/".dol_sanitizeFileName($clone_task_ref); + $ori_task_dir = $conf->project->dir_output."/".dol_sanitizeFileName($ori_project_ref)."/".dol_sanitizeFileName($fromid); $filearray = dol_dir_list($ori_task_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', '', SORT_ASC, 1); foreach ($filearray as $key => $file) { @@ -2205,7 +2205,7 @@ class Task extends CommonObjectLine $task_static = new Task($this->db); $response = new WorkboardResponse(); - $response->warning_delay = $conf->projet->task->warning_delay / 60 / 60 / 24; + $response->warning_delay = $conf->project->task->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("OpenedTasks"); if ($user->rights->projet->all->lire) { $response->url = DOL_URL_ROOT.'/projet/tasks/list.php?mainmenu=project'; @@ -2306,6 +2306,6 @@ class Task extends CommonObjectLine $datetouse = ($this->date_end > 0) ? $this->date_end : ((isset($this->datee) && $this->datee > 0) ? $this->datee : 0); - return ($datetouse > 0 && ($datetouse < ($now - $conf->projet->task->warning_delay))); + return ($datetouse > 0 && ($datetouse < ($now - $conf->project->task->warning_delay))); } } diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index 2301017edd9..588043a56dc 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -49,7 +49,7 @@ if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob } if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($object->ref); } // Get parameters @@ -109,7 +109,7 @@ llxHeader('', $title, $help_url); $form = new Form($db); if ($object->id > 0) { - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($object->ref); // To verify role of users //$userAccess = $object->restrictedProjectArea($user,'read'); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index fb4011ada8c..16b67dd4876 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -579,7 +579,7 @@ $listofreferent = array( 'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id), 'buttonnew'=>'AddTimeSpent', 'testnew'=>$user->rights->projet->creer, - 'test'=>($conf->projet->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))), + 'test'=>($conf->project->enabled && $user->rights->projet->lire && empty($conf->global->PROJECT_HIDE_TASKS))), 'stock_mouvement'=>array( 'name'=>"MouvementStockAssociated", 'title'=>"ListMouvementStockProject", diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 31f74118261..eaf9c5022a3 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -67,7 +67,7 @@ if (!$user->rights->projet->lire) { accessforbidden(); } -$diroutputmassaction = $conf->projet->dir_output.'/temp/massgeneration/'.$user->id; +$diroutputmassaction = $conf->project->dir_output.'/temp/massgeneration/'.$user->id; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", "aZ09comma"); @@ -297,7 +297,7 @@ if (empty($reshook)) { $permissiontoread = $user->rights->projet->lire; $permissiontodelete = $user->rights->projet->supprimer; $permissiontoadd = $user->rights->projet->creer; - $uploaddir = $conf->projet->dir_output; + $uploaddir = $conf->project->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; // Close records diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 410b637f3e6..f2e514afe56 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -137,7 +137,7 @@ $socid = 0; //if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement. $result = restrictedArea($user, 'projet', $id, 'projet&project'); -$diroutputmassaction = $conf->projet->dir_output.'/tasks/temp/massgeneration/'.$user->id; +$diroutputmassaction = $conf->project->dir_output.'/tasks/temp/massgeneration/'.$user->id; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('projecttaskscard', 'globalcard')); @@ -234,7 +234,7 @@ if (empty($reshook)) { $objectlabel = 'Tasks'; $permissiontoread = $user->rights->projet->lire; $permissiontodelete = $user->rights->projet->supprimer; - $uploaddir = $conf->projet->dir_output.'/tasks'; + $uploaddir = $conf->project->dir_output.'/tasks'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index bd696e90434..ad0a2c0b628 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) { $object->project = clone $projectstatic; - $upload_dir = $conf->projet->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); + $upload_dir = $conf->project->dir_output.'/'.dol_sanitizeFileName($projectstatic->ref).'/'.dol_sanitizeFileName($object->ref); } include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 6d9e44c3799..bfda3ad31be 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -113,7 +113,7 @@ if (!$user->rights->projet->lire) { accessforbidden(); } -$diroutputmassaction = $conf->projet->dir_output.'/tasks/temp/massgeneration/'.$user->id; +$diroutputmassaction = $conf->project->dir_output.'/tasks/temp/massgeneration/'.$user->id; $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -237,7 +237,7 @@ if (empty($reshook)) { // Mass actions $objectclass = 'Task'; $objectlabel = 'Tasks'; - $uploaddir = $conf->projet->dir_output.'/tasks'; + $uploaddir = $conf->project->dir_output.'/tasks'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 5b0f097d22f..3df3cf8928e 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -177,7 +177,7 @@ if ($action == 'remove_file' && $user->rights->projet->creer) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $langs->load("other"); - $upload_dir = $conf->projet->dir_output; + $upload_dir = $conf->project->dir_output; $file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file')); $ret = dol_delete_file($file); @@ -647,7 +647,7 @@ if ($id > 0 || !empty($ref)) { * Generated documents */ $filename = dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); - $filedir = $conf->projet->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); + $filedir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $genallowed = ($user->rights->projet->lire); $delallowed = ($user->rights->projet->creer); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index f47eb2a49d3..d0db633658a 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -919,15 +919,19 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $massactionbutton = ''; $arrayofmassactions = array(); - if ($projectstatic->usage_bill_time) { - $arrayofmassactions = array( - 'generateinvoice'=>$langs->trans("GenerateBill"), - //'builddoc'=>$langs->trans("PDFMerge"), - ); - } - if ( ! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) { - $langs->load("interventions"); - $arrayofmassactions['generateinter'] = $langs->trans("GenerateInter"); + + if ($projectstatic->id > 0) { + // If we are on a given project. + if ($projectstatic->usage_bill_time) { + $arrayofmassactions = array( + 'generateinvoice'=>$langs->trans("GenerateBill"), + //'builddoc'=>$langs->trans("PDFMerge"), + ); + } + if ( ! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) { + $langs->load("interventions"); + $arrayofmassactions['generateinter'] = $langs->trans("GenerateInter"); + } } //if ($user->rights->projet->creer) $arrayofmassactions['predelete']=''.$langs->trans("Delete"); if (in_array($massaction, array('presend', 'predelete', 'generateinvoice', 'generateinter'))) { @@ -1251,7 +1255,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; if ($projectstatic->thirdparty->id > 0) { - print ''; + print '
    '; print ''; print ''; } if (!empty($allprojectforuser)) { - print ''; + print ''; } // Task if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task @@ -1869,26 +1875,24 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Action column print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $projectid = GETPOST('projectid', 'int') ?GETPOST('projectid', 'int') : 0; if (empty($projectid) && !empty($objectsrc->fk_project)) { $projectid = $objectsrc->fk_project; @@ -1237,30 +1239,26 @@ if ($action == 'create') { print "\n"; - $extralabelslines = $extrafields->attributes[$line->table_element]; - //Display lines extrafields - if (is_array($extralabelslines) && count($extralabelslines) > 0) { + // Display lines for extrafields of the Reception line + // $line is a 'CommandeFournisseurLigne', $dispatchLines contains values of Reception lines so properties of CommandeFournisseurDispatch + if (!empty($extrafields)) { + //var_dump($line); $colspan = 5; if ($conf->productbatch->enabled) { $colspan += 3; } + $recLine = new CommandeFournisseurDispatch($db); $srcLine = new CommandeFournisseurLigne($db); - $line = new CommandeFournisseurDispatch($db); - - $extrafields->fetch_name_optionals_label($srcLine->table_element); - $extrafields->fetch_name_optionals_label($line->table_element); - $srcLine->id = $line->id; $srcLine->fetch_optionals(); // fetch extrafields also available in orderline - $line->fetch_optionals(); - if (empty($line->array_options) && !empty($dispatchLines[$indiceAsked]['array_options'])) { - $line->array_options = $dispatchLines[$indiceAsked]['array_options']; + if (empty($recLine->array_options) && !empty($dispatchLines[$indiceAsked]['array_options'])) { + $recLine->array_options = $dispatchLines[$indiceAsked]['array_options']; } - $line->array_options = array_merge($line->array_options, $srcLine->array_options); + $recLine->array_options = array_merge($recLine->array_options, $srcLine->array_options); - print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked); + print $recLine->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), $indiceAsked, '', 1); } $indiceAsked++; @@ -1383,7 +1381,7 @@ if ($action == 'create') { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on reception diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index a7cec515e29..4e04bdd2926 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -147,7 +147,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on reception diff --git a/htdocs/reception/document.php b/htdocs/reception/document.php index f592dba452a..c349a25fd8b 100644 --- a/htdocs/reception/document.php +++ b/htdocs/reception/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -120,7 +120,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on shipment diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php index 725c23ae738..46e10002d76 100644 --- a/htdocs/reception/note.php +++ b/htdocs/reception/note.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; dol_include_once('/fourn/class/fournisseur.commande.class.php'); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -124,7 +124,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if (0) { // Do not change on reception diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 42279fe3a97..89351997596 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -104,7 +104,7 @@ class RecruitmentJobPosition extends CommonObject 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object", 'css'=>'nowraponall'), 'label' => array('type'=>'varchar(255)', 'label'=>'JobLabel', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth500', 'csslist'=>'tdoverflowmax300', 'showoncombobox'=>'2', 'autofocusoncreate'=>1), 'qty' => array('type'=>'integer', 'label'=>'NbOfEmployeesExpected', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'default'=>'1', 'isameasure'=>'1', 'css'=>'maxwidth75imp'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'picto'=>'project'), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'picto'=>'project'), 'fk_user_recruiter' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ResponsibleOfRecruitement', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>1, 'foreignkey'=>'user.rowid', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'user'), 'email_recruiter' => array('type'=>'varchar(255)', 'label'=>'EmailRecruiter', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>-1, 'help'=>'ToUseAGenericEmail', 'picto'=>'email'), 'fk_user_supervisor' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'FutureManager', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'user.rowid', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'user'), diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 54ac648d1d0..bfe70deb075 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -150,7 +150,7 @@ if ($object->id > 0) { $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - /*if (! empty($conf->projet->enabled)) + /*if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 93b43c99cc6..0da5badd7bc 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -448,7 +448,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentcandidature_document.php b/htdocs/recruitment/recruitmentcandidature_document.php index 22e011daf42..38715f412f2 100644 --- a/htdocs/recruitment/recruitmentcandidature_document.php +++ b/htdocs/recruitment/recruitmentcandidature_document.php @@ -131,7 +131,7 @@ if ($object->id) { $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - /*if (! empty($conf->projet->enabled)) + /*if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 9a0a21484b1..feb2b47dcba 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -444,7 +444,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { @@ -461,7 +461,7 @@ if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, -1, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (!empty($object->fk_project)) { diff --git a/htdocs/recruitment/recruitmentcandidature_note.php b/htdocs/recruitment/recruitmentcandidature_note.php index d35edaa3b91..c6fedf6fcea 100644 --- a/htdocs/recruitment/recruitmentcandidature_note.php +++ b/htdocs/recruitment/recruitmentcandidature_note.php @@ -104,7 +104,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - /*if (! empty($conf->projet->enabled)) + /*if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project') . ' '; diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index 1391ddb132d..07cecb0070e 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -150,7 +150,7 @@ if ($object->id > 0) { $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php index c6e462161ed..16e19066be3 100644 --- a/htdocs/recruitment/recruitmentjobposition_applications.php +++ b/htdocs/recruitment/recruitmentjobposition_applications.php @@ -271,7 +271,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index 65b6f0e8885..b2172aca80d 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -343,7 +343,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_document.php b/htdocs/recruitment/recruitmentjobposition_document.php index e3e79a5482e..43f90ca1fdd 100644 --- a/htdocs/recruitment/recruitmentjobposition_document.php +++ b/htdocs/recruitment/recruitmentjobposition_document.php @@ -131,7 +131,7 @@ if ($object->id) { $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php index 883f5612b97..c5d8cc29533 100644 --- a/htdocs/recruitment/recruitmentjobposition_note.php +++ b/htdocs/recruitment/recruitmentjobposition_note.php @@ -109,7 +109,7 @@ if ($id > 0 || !empty($ref)) { $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); */ // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= $langs->trans('Project').' '; if ($permissiontoadd) { diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 6926983915b..09c7befc664 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -29,7 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -349,7 +349,7 @@ if (!$ret) { // Thirdparty //$morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); //$morehtmlref.='
    '.$langs->trans('Project') . ' '; $morehtmlref .= $langs->trans('Project').': '; @@ -517,7 +517,7 @@ if (!$ret) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$fichinter->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->commande->creer) { diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 00591b5a32f..7d57575dacd 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -35,14 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } // Load translation files required by the page $langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm", "trips")); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); } @@ -441,7 +441,7 @@ if ($action == "update_extras" && !empty($user->rights->salaries->read)) { $form = new Form($db); $formfile = new FormFile($db); -if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); +if (!empty($conf->project->enabled)) $formproject = new FormProjets($db); $title = $langs->trans('Salary')." - ".$langs->trans('Card'); $help_url = ""; @@ -559,7 +559,7 @@ if ($action == 'create') { print ''; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); print '"; // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $formproject = new FormProjets($db); @@ -1555,7 +1555,7 @@ if ($action == 'create') { $morehtmlref .= ' ('.$langs->trans("OtherProposals").')'; } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($usercancreate) { diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index f1756f17814..bc5e555fa99 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -134,7 +134,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= '
    '.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($permissiontoedit) { diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php index fa73ec22fa8..af2353c4d8f 100644 --- a/htdocs/supplier_proposal/document.php +++ b/htdocs/supplier_proposal/document.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } // Load translation files required by the page @@ -121,7 +121,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->supplier_proposal->creer) { diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php index 0b796937d2e..7bb6d4f7682 100644 --- a/htdocs/supplier_proposal/info.php +++ b/htdocs/supplier_proposal/info.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } @@ -76,7 +76,7 @@ $morehtmlref = '
    '; // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->supplier_proposal->creer) { diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index a0e404dbd89..96f8a2b2cca 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php index 5a19a94b402..4ef46594e0e 100644 --- a/htdocs/supplier_proposal/note.php +++ b/htdocs/supplier_proposal/note.php @@ -29,7 +29,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } // Load translation files required by the page @@ -105,7 +105,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->supplier_proposal->creer) { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index fdc2e9db2d7..3c05847a79c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -394,7 +394,7 @@ textarea:focus { /* v6 box-shadow: 0 0 4px #8091BF; */ border: 1px solid #aaa !important; } -input:focus, textarea:focus, button:focus, select:focus { +input:focus, textarea:focus, button:focus:not(.button_search_x):not(.button_search):not(.button_removefilter), select:focus { border-bottom: 1px solid #666; } @@ -4967,7 +4967,7 @@ span[phptag] { color: #000 !important; text-shadow: none; } -.bordertransp { +.bordertransp:not(.nobordertransp) { background-color: transparent; background-image: none; border: 1px solid #aaa; diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 76e136c1fd7..72c19c217b3 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -184,7 +184,7 @@ if (!empty($conf->societe->enabled)) { } // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project'); if ($user->rights->ticket->write) { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index a527aca93bf..e7fc3abba34 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; @@ -696,7 +696,7 @@ if (empty($reshook)) { $userstat = new User($db); $form = new Form($db); $formticket = new FormTicket($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -949,7 +949,7 @@ if ($action == 'create' || $action == 'presend') { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->ticket->write) { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 6bc194fed21..67fb1772ac4 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -267,7 +267,7 @@ class Ticket extends CommonObject 'severity_code' => array('type'=>'varchar(32)', 'label'=>'Severity', 'visible'=>1, 'enabled'=>1, 'position'=>22, 'notnull'=>-1, 'help'=>"", 'css'=>'maxwidth100'), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>'$conf->societe->enabled', 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>"LinkToThirparty", 'css'=>'tdoverflowmax150 maxwidth150onsmartphone'), 'notify_tiers_at_create' => array('type'=>'integer', 'label'=>'NotifyThirdparty', 'visible'=>-1, 'enabled'=>0, 'position'=>51, 'notnull'=>1, 'index'=>1), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>'$conf->projet->enabled', 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"), + 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php', 'label'=>'Project', 'visible'=>-1, 'enabled'=>'$conf->project->enabled', 'position'=>52, 'notnull'=>-1, 'index'=>1, 'help'=>"LinkToProject"), //'timing' => array('type'=>'varchar(20)', 'label'=>'Timing', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'help'=>""), // what is this ? 'datec' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>1, 'enabled'=>1, 'position'=>500, 'notnull'=>1), 'date_read' => array('type'=>'datetime', 'label'=>'TicketReadOn', 'visible'=>-1, 'enabled'=>1, 'position'=>501, 'notnull'=>1), diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index ee76045ffec..5b1b73799f2 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -221,7 +221,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->ticket->write) { diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php index d0c2d0a4a60..bf2b1c51fc4 100644 --- a/htdocs/ticket/document.php +++ b/htdocs/ticket/document.php @@ -156,7 +156,7 @@ if ($object->id) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->ticket->write) { diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index a3bf03467ce..4b887691f01 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -182,7 +182,7 @@ if (!empty($conf->societe->enabled)) { } // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project'); if ($user->rights->ticket->write) { diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index dd27bc36be8..7916f4650d2 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -186,7 +186,7 @@ $tmparray = array('index.php'=>'Dashboard'); if (!empty($conf->societe->enabled)) { $tmparray['societe/index.php?mainmenu=companies&leftmenu='] = 'ThirdPartiesArea'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $tmparray['projet/index.php?mainmenu=project&leftmenu='] = 'ProjectsArea'; } if (!empty($conf->holiday->enabled) || !empty($conf->expensereport->enabled)) { diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 9e1d791a626..b6ffd948bd6 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -915,7 +915,7 @@ if (!empty($id) || !empty($ref)) { print 'id.'">'.img_delete().''; print ''; print '
    '; print $langs->trans('InterToUse'); @@ -1347,7 +1351,9 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if ($search_valuebilled == '0') { $sql .= ' AND (t.invoice_id = 0 OR t.invoice_id IS NULL)'; } + $sql .= dolSqlDateFilter('t.task_datehour', $search_day, $search_month, $search_year); + // Add where from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook @@ -1567,7 +1573,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; - if (($action == 'editline' || $action == 'splitline') && $_GET['lineid'] == $task_time->rowid) { - print ''; + if (($action == 'editline' || $action == 'splitline') && GETPOST('lineid', 'int') == $task_time->rowid) { + print ''; print ''; - print '
    '; + print ' '; print ''; - } elseif ($user->rights->projet->time || $user->rights->projet->all->creer) { // Read project and enter time consumed on assigned tasks - if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->rights->projet->all->creer) { - if ($conf->MAIN_FEATURES_LEVEL >= 2) { + } elseif ($user->hasRight('projet', 'time') || $user->hasRight('projet', 'all', 'creer')) { // Read project and enter time consumed on assigned tasks + if ($task_time->fk_user == $user->id || in_array($task_time->fk_user, $childids) || $user->hasRight('projet', 'all', 'creer')) { + if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 2) { print ' '; print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; - print img_split(); + print img_split('', 'class="pictofixedwidth"'); print ''; } - print ' '; print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; - print img_edit(); + print img_edit('default', 0, 'class="pictofixedwidth paddingleft"'); print ''; - print ' '; print 'rowid.$param.((empty($id) || $tab == 'timespent') ? '&tab=timespent' : '').'">'; print img_delete('default', 'class="pictodelete paddingleft"'); print ''; diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 0add64bb700..e5dfeb59a8e 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -83,7 +83,7 @@ if ($resultproject < 0) { } // Security check -if (empty($conf->projet->enabled)) { +if (empty($conf->project->enabled)) { accessforbidden('', 0, 0, 1); } diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 4838c88c5a1..5b0c35c10f3 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -81,7 +81,7 @@ $object = new Project($db); $user->loadDefaultValues(); // Security check -if (empty($conf->projet->enabled)) { +if (empty($conf->project->enabled)) { accessforbidden('', 0, 0, 1); } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 241a8427e8f..9c0d3b01136 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -57,7 +57,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU if (!empty($conf->productbatch->enabled)) { require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; } -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -101,11 +101,13 @@ $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($ $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); $object = new Reception($db); +$objectorder = new CommandeFournisseur($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element_line); +$extrafields->fetch_name_optionals_label($objectorder->table_element_line); // Load object. Make an object->fetch include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once @@ -710,7 +712,7 @@ llxHeader('', $langs->trans('Reception'), 'Reception'); $form = new Form($db); $formfile = new FormFile($db); $formproduct = new FormProduct($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -795,7 +797,7 @@ if ($action == 'create') { print '
    '.$langs->trans("Project").''; @@ -794,7 +794,7 @@ if ($id) { } // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->salaries->write) { if ($action != 'classify') { diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php index 045b77ca0a4..971291580bf 100644 --- a/htdocs/salaries/document.php +++ b/htdocs/salaries/document.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -132,7 +132,7 @@ if ($action == 'setlabel' && $user->rights->salaries->write) { */ $form = new Form($db); -if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); +if (!empty($conf->project->enabled)) $formproject = new FormProjets($db); $title = $langs->trans('Salary')." - ".$langs->trans('Documents'); $help_url = ""; @@ -176,7 +176,7 @@ if ($object->id) { $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1); // Project - if (!empty($conf->projet->enabled)) { + if (!empty($conf->project->enabled)) { $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->salaries->write) { if ($action != 'classify') { @@ -191,7 +191,7 @@ if ($object->id) { $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, -1, $object->fk_project, 'none', 0, 0, 0, 1); } } else { if (!empty($object->fk_project)) { diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php index a43d9010d8d..a2f05b791a6 100644 --- a/htdocs/salaries/info.php +++ b/htdocs/salaries/info.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -100,7 +100,7 @@ if ($action == 'setlabel' && $user->rights->salaries->write) { * View */ -if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); +if (!empty($conf->project->enabled)) $formproject = new FormProjets($db); $title = $langs->trans('Salary')." - ".$langs->trans('Info'); $help_url = ""; @@ -139,7 +139,7 @@ if ($action != 'editlabel') { $morehtmlref .= '
    '.$langs->trans('Employee').' : '.$userstatic->getNomUrl(-1); // Project -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $morehtmlref .= '
    '.$langs->trans('Project').' '; if ($user->rights->salaries->write) { if ($action != 'classify') { diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5f11b6e3c02..366b510737b 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } @@ -1131,7 +1131,7 @@ $formother = new FormOther($db); $formfile = new FormFile($db); $formmargin = new FormMargin($db); $companystatic = new Societe($db); -if (!empty($conf->projet->enabled)) { +if (!empty($conf->project->enabled)) { $formproject = new FormProjets($db); } @@ -1312,7 +1312,7 @@ if ($action == 'create') { print "
    '; - if ($productCombinations || $massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + if (!empty($productCombinations) || $massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined $selected = 0; if (in_array($prodstatic->id, $arrayofselected)) { $selected = 1; diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index f70a990ee95..14af2e88b3f 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -108,7 +108,7 @@ $webservices = array( 'supplier_invoice' => '!empty($conf->fournisseur->enabled)', 'actioncomm' => '!empty($conf->agenda->enabled)', 'category' => '!empty($conf->categorie->enabled)', - 'project' => '!empty($conf->projet->enabled)', + 'project' => '!empty($conf->project->enabled)', 'other' => '' ); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 118627f19ea..249398c322e 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -222,7 +222,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 78140eddd40..ff30d062f38 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -147,7 +147,7 @@ if ($object->id > 0) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index 37f24a38437..9e859dcc2d0 100644 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -340,7 +340,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) { + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref .= '
    '.$langs->trans('Project') . ' '; if ($permissiontoadd) { diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index f52ef1fe796..50331b4b231 100644 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -128,7 +128,7 @@ if ($object->id) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php index 3685b7daf4e..dc230dd38ff 100644 --- a/htdocs/workstation/workstation_note.php +++ b/htdocs/workstation/workstation_note.php @@ -101,7 +101,7 @@ if ($id > 0 || !empty($ref)) { // Thirdparty $morehtmlref.='
    '.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : ''); // Project - if (! empty($conf->projet->enabled)) + if (! empty($conf->project->enabled)) { $langs->load("projects"); $morehtmlref.='
    '.$langs->trans('Project') . ' '; diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 25ea4b4d415..820db6746ee 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -81,6 +81,8 @@ $userlogin = $argv[2]; $version = DOL_VERSION; $error = 0; +$hookmanager->initHooks(array('cli')); + /* * Main diff --git a/test/phpunit/BuildDocTest.php b/test/phpunit/BuildDocTest.php index 18a737ec50b..81b05486c72 100644 --- a/test/phpunit/BuildDocTest.php +++ b/test/phpunit/BuildDocTest.php @@ -121,7 +121,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase if (! $conf->propal->enabled) { print __METHOD__." propal module not enabled\n"; die(1); } - if (! $conf->projet->enabled) { + if (! $conf->project->enabled) { print __METHOD__." project module not enabled\n"; die(1); } if (! $conf->expedition->enabled) { @@ -377,7 +377,7 @@ class BuildDocTest extends PHPUnit\Framework\TestCase $user=$this->savuser; $langs=$this->savlangs; $db=$this->savdb; - $conf->projet->dir_output.='/temp'; + $conf->project->dir_output.='/temp'; $localobject=new Project($this->savdb); $localobject->initAsSpecimen();