diff --git a/htdocs/assets/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php similarity index 97% rename from htdocs/assets/admin/assets_extrafields.php rename to htdocs/asset/admin/assets_extrafields.php index 426da1c239f..52c1f042836 100644 --- a/htdocs/assets/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -17,8 +17,8 @@ */ /** - * \file htdocs/assets/admin/assets_extrafields.php - * \ingroup assets + * \file htdocs/asset/admin/asset_extrafields.php + * \ingroup asset * \brief Page to setup extra fields of assets */ diff --git a/htdocs/assets/admin/assets_type_extrafields.php b/htdocs/asset/admin/assets_type_extrafields.php similarity index 97% rename from htdocs/assets/admin/assets_type_extrafields.php rename to htdocs/asset/admin/assets_type_extrafields.php index 62878c9d8b5..261c7de99b7 100644 --- a/htdocs/assets/admin/assets_type_extrafields.php +++ b/htdocs/asset/admin/assets_type_extrafields.php @@ -18,8 +18,8 @@ /** /** - * \file htdocs/assets/admin/assets_type_extrafields.php - * \ingroup assets + * \file htdocs/asset/admin/assets_type_extrafields.php + * \ingroup asset * \brief Page to setup extra fields type of assets */ require '../../main.inc.php'; diff --git a/htdocs/assets/admin/setup.php b/htdocs/asset/admin/setup.php similarity index 100% rename from htdocs/assets/admin/setup.php rename to htdocs/asset/admin/setup.php diff --git a/htdocs/assets/card.php b/htdocs/asset/card.php similarity index 85% rename from htdocs/assets/card.php rename to htdocs/asset/card.php index 4424ca0cf93..a76bf3d069e 100644 --- a/htdocs/assets/card.php +++ b/htdocs/asset/card.php @@ -18,18 +18,18 @@ /** * \file card.php - * \ingroup assets - * \brief Page to create/edit/view assets + * \ingroup asset + * \brief Page to create/edit/view asset */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'); // Load traductions files requiredby by page -$langs->loadLangs(array("assets")); +$langs->loadLangs(array("asset")); // Get parameters $id = GETPOST('id', 'int'); @@ -39,12 +39,12 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object=new Assets($db); +$object=new Asset($db); $extrafields = new ExtraFields($db); -$diroutputmassaction=$conf->assets->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('assetscard')); // Note that conf->hooks_modules contains array +$diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('assetcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('assets'); +$extralabels = $extrafields->fetch_name_optionals_label('asset'); $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); // Initialize array of search criterias @@ -60,7 +60,7 @@ if (empty($action) && empty($id) && empty($ref)) $action='view'; // Security check - Protection if external user //if ($user->societe_id > 0) access_forbidden(); //if ($user->societe_id > 0) $socid = $user->societe_id; -//$result = restrictedArea($user, 'assets', $id); +//$result = restrictedArea($user, 'asset', $id); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); @@ -84,9 +84,9 @@ if (empty($reshook)) { $error=0; - $permissiontoadd = $user->rights->assets->create; - $permissiontodelete = $user->rights->assets->delete; - $backurlforlist = dol_buildpath('/assets/list.php',1); + $permissiontoadd = $user->rights->asset->create; + $permissiontodelete = $user->rights->asset->delete; + $backurlforlist = dol_buildpath('/asset/list.php',1); // Actions cancel, add, update or delete include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -97,7 +97,7 @@ if (empty($reshook)) // Actions to send emails $trigger_name='MYOBJECT_SENTBYMAIL'; $autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; - $trackid='assets'.$object->id; + $trackid='asset'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -241,13 +241,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; /* // Ref bis - $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->assets->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->assets->creer, 'string', '', null, null, '', 1); + $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->asset->creer, 'string', '', 0, 1); + $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->asset->creer, 'string', '', null, null, '', 1); // Thirdparty $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); */ @@ -289,7 +289,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Send print '' . $langs->trans('SendMail') . ''."\n"; - if ($user->rights->assets->write) + if ($user->rights->asset->write) { print ''.$langs->trans("Modify").''."\n"; } @@ -298,7 +298,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans('Modify').''."\n"; } - if ($user->rights->assets->delete) + if ($user->rights->asset->delete) { print ''.$langs->trans('Delete').''."\n"; } @@ -324,15 +324,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Documents /*$objref = dol_sanitizeFileName($object->ref); $relativepath = $comref . '/' . $comref . '.pdf'; - $filedir = $conf->assets->dir_output . '/' . $objref; + $filedir = $conf->asset->dir_output . '/' . $objref; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; - $genallowed = $user->rights->assets->read; // If you can read, you can build the PDF to read content - $delallowed = $user->rights->assets->create; // If you can create/edit, you can remove a file on card - print $formfile->showdocuments('assets', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + $genallowed = $user->rights->asset->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->asset->create; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('asset', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); */ // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('assets')); + $linktoelem = $form->showLinkToObjectBlock($object, null, array('asset')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); @@ -340,14 +340,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $MAXEVENT = 10; - $morehtmlright = ''; + $morehtmlright = ''; $morehtmlright.= $langs->trans("SeeAll"); $morehtmlright.= ''; // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'assets', $socid, 1, '', $MAXEVENT, '', $morehtmlright); + $somethingshown = $formactions->showactions($object, 'asset', $socid, 1, '', $MAXEVENT, '', $morehtmlright); print '
'; } diff --git a/htdocs/assets/class/asset.class.php b/htdocs/asset/class/asset.class.php similarity index 95% rename from htdocs/assets/class/asset.class.php rename to htdocs/asset/class/asset.class.php index efacac10822..86da8ae5379 100644 --- a/htdocs/assets/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -17,9 +17,9 @@ */ /** - * \file assets/class/assets.class.php - * \ingroup assets - * \brief This file is a CRUD class file for assets (Create/Read/Update/Delete) + * \file asset/class/asset.class.php + * \ingroup asset + * \brief This file is a CRUD class file for asset (Create/Read/Update/Delete) */ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; @@ -27,30 +27,30 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php'; //require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; /** - * Class for Assets + * Class for Asset */ -class Assets extends CommonObject +class Asset extends CommonObject { /** * @var string ID to identify managed object */ - public $element = 'assets'; + public $element = 'asset'; /** * @var string Name of table without prefix where object is stored */ - public $table_element = 'assets'; + public $table_element = 'asset'; /** - * @var int Does assets support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe + * @var int Does module support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe */ public $ismultientitymanaged = 0; /** - * @var int Does assets support extrafields ? 0=No, 1=Yes + * @var int Does asset support extrafields ? 0=No, 1=Yes */ public $isextrafieldmanaged = 1; /** - * @var string String with name of icon for assets. Must be the part after the 'object_' into object_assets.png + * @var string String with name of icon for asset. Must be the part after the 'object_' into object_asset.png */ - public $picto = 'assets'; + public $picto = 'asset'; /** @@ -111,21 +111,21 @@ class Assets extends CommonObject /** * @var int Name of subtable line */ - //public $table_element_line = 'assetsdet'; + //public $table_element_line = 'assetdet'; /** * @var int Field with ID of parent key if this field has a parent */ - //public $fk_element = 'fk_assets'; + //public $fk_element = 'fk_asset'; /** * @var int Name of subtable class that manage subtable lines */ - //public $class_element_line = 'Assetsline'; + //public $class_element_line = 'Assetline'; /** * @var array Array of child tables (child tables to delete before deleting a record) */ - //protected $childtables=array('assetsdet'); + //protected $childtables=array('assetdet'); /** - * @var AssetsLine[] Array of subtable lines + * @var AssetLine[] Array of subtable lines */ //public $lines = array(); diff --git a/htdocs/assets/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php similarity index 97% rename from htdocs/assets/class/asset_type.class.php rename to htdocs/asset/class/asset_type.class.php index d4d12916e9a..9fbcca64d8b 100644 --- a/htdocs/assets/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -16,8 +16,8 @@ */ /** - * \file htdocs/assets/class/asset_type.class.php - * \ingroup assets + * \file htdocs/asset/class/asset_type.class.php + * \ingroup asset * \brief File of class to manage asset types */ @@ -375,7 +375,7 @@ class AssetType extends CommonObject $result=''; $label=$langs->trans("ShowTypeCard",$this->label); - $linkstart = ''; + $linkstart = ''; $linkend=''; $result .= $linkstart; diff --git a/htdocs/assets/document.php b/htdocs/asset/document.php similarity index 83% rename from htdocs/assets/document.php rename to htdocs/asset/document.php index 490fb8f36a4..fbd2fe6cdb8 100644 --- a/htdocs/assets/document.php +++ b/htdocs/asset/document.php @@ -18,13 +18,13 @@ /** * \file document.php - * \ingroup assets + * \ingroup asset * \brief Tab for documents linked to Assets */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; @@ -42,7 +42,7 @@ $ref = GETPOST('ref', 'alpha'); // Security check - Protection if external user //if ($user->societe_id > 0) access_forbidden(); //if ($user->societe_id > 0) $socid = $user->societe_id; -//$result = restrictedArea($user, 'assets', $id); +//$result = restrictedArea($user, 'asset', $id); // Get parameters $sortfield = GETPOST("sortfield",'alpha'); @@ -56,12 +56,12 @@ if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="name"; // Initialize technical objects -$object=new Assets($db); +$object=new Asset($db); $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->assets->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('assetsdocument')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('assetdocument')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('assets'); +$extralabels = $extrafields->fetch_name_optionals_label('asset'); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals @@ -110,7 +110,7 @@ if ($object->id) // Object card // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); @@ -131,15 +131,15 @@ if ($object->id) dol_fiche_end(); - $modulepart = 'assets'; - //$permission = $user->rights->assets->create; + $modulepart = 'asset'; + //$permission = $user->rights->asset->create; $permission = 1; - //$permtoedit = $user->rights->assets->create; + //$permtoedit = $user->rights->asset->create; $permtoedit = 1; $param = '&id=' . $object->id; - //$relativepathwithnofile='assets/' . dol_sanitizeFileName($object->id).'/'; - $relativepathwithnofile='assets/' . dol_sanitizeFileName($object->ref).'/'; + //$relativepathwithnofile='asset/' . dol_sanitizeFileName($object->id).'/'; + $relativepathwithnofile='asset/' . dol_sanitizeFileName($object->ref).'/'; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; } diff --git a/htdocs/assets/info.php b/htdocs/asset/info.php similarity index 88% rename from htdocs/assets/info.php rename to htdocs/asset/info.php index 9017a9e6845..c953a09c83b 100644 --- a/htdocs/assets/info.php +++ b/htdocs/asset/info.php @@ -17,16 +17,16 @@ /** * \file info.php - * \ingroup assets + * \ingroup asset * \brief Page to show an asset information */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; -$langs->loadLangs(array("assets")); +$langs->loadLangs(array("asset")); $id = GETPOST('id','int'); $ref=GETPOST('ref','alpha'); @@ -34,9 +34,9 @@ $action=GETPOST('action','alpha'); // Security check if ($user->societe_id) $socid=$user->societe_id; -$result = restrictedArea($user, 'assets', $id, ''); +$result = restrictedArea($user, 'asset', $id, ''); -$object = new Assets($db); +$object = new Asset($db); $object->fetch($id); /* diff --git a/htdocs/assets/list.php b/htdocs/asset/list.php similarity index 94% rename from htdocs/assets/list.php rename to htdocs/asset/list.php index 2b68a1b6782..d9860dc32a3 100644 --- a/htdocs/assets/list.php +++ b/htdocs/asset/list.php @@ -19,8 +19,8 @@ /** * \file list.php - * \ingroup assets - * \brief List page for assets + * \ingroup asset + * \brief List page for asset */ // Load Dolibarr environment @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once(DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'); require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; // Load traductions files requiredby by page $langs->loadLangs(array("assets")); @@ -56,12 +56,12 @@ $pageprev = $page - 1; $pagenext = $page + 1; // Initialize technical objects -$object=new Assets($db); +$object=new Asset($db); $extrafields = new ExtraFields($db); -$diroutputmassaction=$conf->assets->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('assetslist')); // Note that conf->hooks_modules contains array +$diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('assetlist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('assets'); +$extralabels = $extrafields->fetch_name_optionals_label('asset'); $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); // Default sort order (if not yet defined by previous GETPOST) @@ -75,7 +75,7 @@ if ($user->societe_id > 0) //$socid = $user->societe_id; accessforbidden(); } -//$result = restrictedArea($user, 'assets', $id,''); +//$result = restrictedArea($user, 'asset', $id,''); // Initialize array of search criterias $search_all=trim(GETPOST("search_all",'alpha')); @@ -147,11 +147,11 @@ if (empty($reshook)) } // Mass actions - $objectclass='Assets'; - $objectlabel='Assets'; - $permtoread = $user->rights->assets->read; - $permtodelete = $user->rights->assets->delete; - $uploaddir = $conf->assets->dir_output; + $objectclass='Asset'; + $objectlabel='Asset'; + $permtoread = $user->rights->asset->read; + $permtodelete = $user->rights->asset->delete; + $uploaddir = $conf->asset->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } @@ -167,7 +167,7 @@ $form=new Form($db); $now=dol_now(); -//$help_url="EN:Module_Assets|FR:Module_Assets_FR|ES:Módulo_Assets"; +//$help_url="EN:Module_Asset|FR:Module_Asset_FR|ES:Módulo_Asset"; $help_url=''; $title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Assets")); @@ -291,7 +291,7 @@ $arrayofmassactions = array( //'presend'=>$langs->trans("SendByMail"), //'builddoc'=>$langs->trans("PDFMerge"), ); -if ($user->rights->assets->delete) $arrayofmassactions['predelete']=$langs->trans("Delete"); +if ($user->rights->asset->delete) $arrayofmassactions['predelete']=$langs->trans("Delete"); if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); @@ -309,8 +309,8 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort // Add code for pre mass action (confirmation or email presend form) $topicmail="SendAssetsRef"; -$modelmail="assets"; -$objecttmp=new Assets($db); +$modelmail="asset"; +$objecttmp=new Asset($db); $trackid='xxxx'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; @@ -515,10 +515,10 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb $urlsource.=str_replace('&','&',$param); $filedir=$diroutputmassaction; - $genallowed=$user->rights->assets->read; - $delallowed=$user->rights->assets->create; + $genallowed=$user->rights->asset->read; + $delallowed=$user->rights->asset->create; - print $formfile->showdocuments('massfilesarea_assets','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); + print $formfile->showdocuments('massfilesarea_asset','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,''); } else { diff --git a/htdocs/assets/note.php b/htdocs/asset/note.php similarity index 82% rename from htdocs/assets/note.php rename to htdocs/asset/note.php index b0db48e2abe..9ed9053dc5c 100644 --- a/htdocs/assets/note.php +++ b/htdocs/asset/note.php @@ -18,16 +18,16 @@ /** * \file note.php - * \ingroup assets - * \brief Card with notes on Assets + * \ingroup asset + * \brief Card with notes on Asset */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/assets.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; // Load traductions files requiredby by page -$langs->loadLangs(array("assets","companies")); +$langs->loadLangs(array("asset","companies")); // Get parameters $id = GETPOST('id', 'int'); @@ -37,24 +37,24 @@ $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects -$object=new Assets($db); +$object=new Asset($db); $extrafields = new ExtraFields($db); -$diroutputmassaction=$conf->assets->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('assetsnote')); // Note that conf->hooks_modules contains array +$diroutputmassaction=$conf->asset->dir_output . '/temp/massgeneration/'.$user->id; +$hookmanager->initHooks(array('assetnote')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels -$extralabels = $extrafields->fetch_name_optionals_label('assets'); +$extralabels = $extrafields->fetch_name_optionals_label('asset'); // Security check - Protection if external user //if ($user->societe_id > 0) access_forbidden(); //if ($user->societe_id > 0) $socid = $user->societe_id; -//$result = restrictedArea($user, 'assets', $id); +//$result = restrictedArea($user, 'asset', $id); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals -if ($id > 0 || ! empty($ref)) $upload_dir = $conf->assets->multidir_output[$object->entity] . "/" . $object->id; +if ($id > 0 || ! empty($ref)) $upload_dir = $conf->asset->multidir_output[$object->entity] . "/" . $object->id; $permissionnote=1; -//$permissionnote=$user->rights->assets->creer; // Used by the include of actions_setnotes.inc.php +//$permissionnote=$user->rights->asset->creer; // Used by the include of actions_setnotes.inc.php /* @@ -84,7 +84,7 @@ if ($id > 0 || ! empty($ref)) // Object card // ------------------------------------------------------------ - $linkback = '' . $langs->trans("BackToList") . ''; + $linkback = '' . $langs->trans("BackToList") . ''; $morehtmlref='
'; /* @@ -98,7 +98,7 @@ if ($id > 0 || ! empty($ref)) { $langs->load("projects"); $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->assets->creer) + if ($user->rights->asset->creer) { if ($action != 'classify') //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; diff --git a/htdocs/assets/type.php b/htdocs/asset/type.php similarity index 96% rename from htdocs/assets/type.php rename to htdocs/asset/type.php index c1a6d849c01..d26175d168f 100644 --- a/htdocs/assets/type.php +++ b/htdocs/asset/type.php @@ -16,15 +16,15 @@ */ /** - * \file htdocs/assets/type.php - * \ingroup assets + * \file htdocs/asset/type.php + * \ingroup asset * \brief Asset's type setup */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/assets.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/asset.class.php'; -require_once DOL_DOCUMENT_ROOT.'/assets/class/asset_type.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/asset.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; +require_once DOL_DOCUMENT_ROOT.'/asset/class/asset_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("assets"); @@ -51,7 +51,7 @@ $label=GETPOST("label","alpha"); $comment=GETPOST("comment"); // Security check -$result=restrictedArea($user,'assets',$rowid,'asset_type'); +$result=restrictedArea($user,'asset',$rowid,'asset_type'); $object = new AssetType($db); @@ -86,7 +86,7 @@ if ($cancel) { } } -if ($action == 'add' && $user->rights->assets->write) +if ($action == 'add' && $user->rights->asset->write) { $object->label = trim($label); $object->accountancy_code_asset = trim($accountancy_code_asset); @@ -135,7 +135,7 @@ if ($action == 'add' && $user->rights->assets->write) } } -if ($action == 'update' && $user->rights->assets->write) +if ($action == 'update' && $user->rights->asset->write) { $object->fetch($rowid); @@ -166,7 +166,7 @@ if ($action == 'update' && $user->rights->assets->write) exit; } -if ($action == 'confirm_delete' && $user->rights->assets->write) +if ($action == 'confirm_delete' && $user->rights->asset->write) { $object->fetch($rowid); $res=$object->delete(); @@ -255,7 +255,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') print ''.dol_escape_htmltag($objp->label).''; print ''.yn($objp->subscription).''; print ''.yn($objp->vote).''; - if ($user->rights->adherent->configurer) + if ($user->rights->asset->configurer) print 'rowid.'">'.img_edit().''; else print ' '; @@ -281,7 +281,7 @@ if (! $rowid && $action != 'create' && $action != 'edit') /* ************************************************************************** */ if ($action == 'create') { - $object = new AdherentType($db); + $object = new AssetType($db); print load_fiche_titre($langs->trans("NewMemberType")); @@ -344,7 +344,7 @@ if ($rowid > 0) { if ($action != 'edit') { - $object = new AdherentType($db); + $object = new AssetType($db); $object->fetch($rowid); $object->fetch_optionals(); @@ -360,7 +360,7 @@ if ($rowid > 0) dol_fiche_head($head, 'card', $langs->trans("MemberType"), -1, 'group'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; dol_banner_tab($object, 'rowid', $linkback); @@ -398,7 +398,7 @@ if ($rowid > 0) print '
'; // Edit - if ($user->rights->adherent->configurer) + if ($user->rights->asset->configurer) { print ''; } @@ -407,7 +407,7 @@ if ($rowid > 0) print ''; // Delete - if ($user->rights->adherent->configurer) + if ($user->rights->asset->configurer) { print ''; } @@ -575,7 +575,7 @@ if ($rowid > 0) $datefin=$db->jdate($objp->datefin); - $adh=new Adherent($db); + $adh=new Asset($db); $adh->lastname=$objp->lastname; $adh->firstname=$objp->firstname; @@ -643,12 +643,12 @@ if ($rowid > 0) // Actions print ''; - if ($user->rights->adherent->creer) + if ($user->rights->asset->creer) { print ''.img_edit().''; } print ' '; - if ($user->rights->adherent->supprimer) + if ($user->rights->asset->supprimer) { print ''.img_picto($langs->trans("Resiliate"),'disable.png').''; } @@ -682,7 +682,7 @@ if ($rowid > 0) if ($action == 'edit') { - $object = new AdherentType($db); + $object = new AssetType($db); $object->fetch($rowid); $object->fetch_optionals(); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 78aa5a0d9cb..84710999183 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -487,25 +487,25 @@ if ($resql) if (! empty($arrayfields['p.ref']['checked'])) { print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['p.ref_client']['checked'])) { print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['pr.ref']['checked'])) { print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.nom']['checked'])) { print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.town']['checked'])) print ''; @@ -529,15 +529,16 @@ if ($resql) { print ''; print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT)); + print ajax_combobox('search_type_thirdparty'); print ''; } // Date if (! empty($arrayfields['p.date']['checked'])) { - print ''; + print ''; //print $langs->trans('Month').': '; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; //print ' '.$langs->trans('Year').': '; $formother->select_year($search_year,'search_year',1, 20, 5); print ''; @@ -551,28 +552,28 @@ if ($resql) { // Amount print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['p.total_vat']['checked'])) { // Amount print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['p.total_ttc']['checked'])) { // Amount print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['u.login']['checked'])) { // Author print ''; - print ''; + print ''; print ''; } // Extra fields diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 5e3f9bade62..872d6f02bfa 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -612,17 +612,17 @@ if ($resql) // Date order if (! empty($arrayfields['c.date_commande']['checked'])) { - print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($search_orderyear?$search_orderyear:-1,'search_orderyear',1, 20, 5); print ''; } if (! empty($arrayfields['c.date_delivery']['checked'])) { - print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($search_deliveryyear?$search_deliveryyear:-1,'search_deliveryyear',1, 20, 5); print ''; } diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index f001d84a27d..017593316a7 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -235,21 +235,21 @@ if ($resql) // Lines for filters fields print ''; print ''; - print ''; + print ''; print ''; print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($year?$year:-1,'year',1, 20, 5); print ''; print ''; - print ''; + print ''; print ''; print ''; $form->select_types_paiements($search_paymenttype,'search_paymenttype','',2,1,1); print ''; print ''; - print ''; + print ''; print ''; if (! empty($conf->banque->enabled)) { @@ -258,7 +258,7 @@ if ($resql) print ''; } print ''; - print ''; + print ''; print ''; print ''; $searchpicto=$form->showFilterAndCheckAddButtons(0); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 9a881daccc9..48356972e69 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -174,7 +174,7 @@ if ($result) print ''; print ''; print ''; - print ''; + print ''; $syear = $year; $formother->select_year($syear?$syear:-1,'year',1, 20, 5); print ''; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index b3ee34731cc..61d62896cf1 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -519,11 +519,11 @@ if (! empty($arrayfields['c.date_contrat']['checked'])) // Date contract print ''; //print $langs->trans('Month').': '; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; //print ' '.$langs->trans('Year').': '; $syear = $year; - print $formother->selectyear($syear,'year',1, 20, 5, 0, 0, '', 'widthauto'); + print $formother->selectyear($syear,'year',1, 20, 5); print ''; } // Extra fields diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 3f07066bf2e..fcc2ddf049c 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -867,7 +867,7 @@ class FormOther * @param string $morecss More CSS * @return string */ - function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='') + function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle widthauto') { print $this->selectyear($selected,$htmlname,$useempty,$min_year,$max_year,$offset,$invert,$option,$morecss); } @@ -886,7 +886,7 @@ class FormOther * @param string $morecss More css * @return string */ - function selectyear($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='') + function selectyear($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle widthauto') { $out=''; diff --git a/htdocs/core/lib/assets.lib.php b/htdocs/core/lib/asset.lib.php similarity index 83% rename from htdocs/core/lib/assets.lib.php rename to htdocs/core/lib/asset.lib.php index cc9ea922854..460d368f2c4 100644 --- a/htdocs/core/lib/assets.lib.php +++ b/htdocs/core/lib/asset.lib.php @@ -17,7 +17,7 @@ /** * \file core/lib/assets.lib.php - * \ingroup assets + * \ingroup asset * \brief Library files with common functions for Assets */ @@ -35,7 +35,7 @@ function AssetsAdminPrepareHead() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT . '/assets/admin/setup.php'; + $head[$h][0] = DOL_URL_ROOT . '/asset/admin/setup.php'; $head[$h][1] = $langs->trans("Settings"); $head[$h][2] = 'settings'; $h++; @@ -43,19 +43,19 @@ function AssetsAdminPrepareHead() // Show more tabs from modules // Entries must be declared in modules descriptor with line //$this->tabs = array( - // 'entity:+tabname:Title:@assets:/assets/mypage.php?id=__ID__' + // 'entity:+tabname:Title:@assets:/asset/mypage.php?id=__ID__' //); // to add new tab //$this->tabs = array( - // 'entity:-tabname:Title:@assets:/assets/mypage.php?id=__ID__' + // 'entity:-tabname:Title:@assets:/asset/mypage.php?id=__ID__' //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets_admin'); - $head[$h][0] = DOL_URL_ROOT . '/assets/admin/assets_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT . '/asset/admin/assets_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); $head[$h][2] = 'attributes'; $h++; - $head[$h][0] = DOL_URL_ROOT . '/assets/admin/assets_type_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT . '/asset/admin/assets_type_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsAssetsType"); $head[$h][2] = 'attributes_type'; $h++; @@ -74,7 +74,7 @@ function AssetsPrepareHead() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT . '/assets/card.php'; + $head[$h][0] = DOL_URL_ROOT . '/asset/card.php'; $head[$h][1] = $langs->trans("Card"); $head[$h][2] = 'card'; $h++; @@ -94,7 +94,7 @@ function AssetsPrepareHead() $upload_dir = $conf->assets->dir_output . '/' . get_exdir($filename,2,0,1,$object,'assets'). '/'. dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); - $head[$h][0] = DOL_URL_ROOT.'/assets/document.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id; $head[$h][1] = $langs->trans('Documents'); if (($nbFiles+$nbLinks) > 0) $head[$h][1].= ' '.($nbFiles+$nbLinks).''; $head[$h][2] = 'documents'; @@ -103,18 +103,18 @@ function AssetsPrepareHead() $nbNote = 0; if(!empty($object->note_private)) $nbNote++; if(!empty($object->note_public)) $nbNote++; - $head[$h][0] = DOL_URL_ROOT.'/assets/note.php?id='.$object->id; + $head[$h][0] = DOL_URL_ROOT.'/asset/note.php?id='.$object->id; $head[$h][1] = $langs->trans("Notes"); if ($nbNote > 0) $head[$h][1].= ' '.$nbNote.''; $head[$h][2] = 'note'; $h++; - $head[$h][0] = DOL_URL_ROOT . '/assets/info.php?id=' . $object->id; + $head[$h][0] = DOL_URL_ROOT . '/asset/info.php?id=' . $object->id; $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info'; $h++; - complete_head_from_modules($conf, $langs, $object, $head, $h, 'assets', 'remove'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'asset', 'remove'); return $head; } diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 71901d2fcef..5463e737282 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -188,10 +188,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode $menuqualified=0; if (! empty($conf->comptabilite->enabled)) $menuqualified++; if (! empty($conf->accounting->enabled)) $menuqualified++; - if (! empty($conf->assets->enabled)) $menuqualified++; + if (! empty($conf->asset->enabled)) $menuqualified++; $tmpentry=array( 'enabled'=>$menuqualified, - 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->assets->read)), + 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->mouvements->lire) || ! empty($user->rights->asset->read)), 'module'=>'comptabilite|accounting'); $showmode=isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) @@ -1138,15 +1138,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu } // Assets - if (! empty($conf->assets->enabled)) + if (! empty($conf->asset->enabled)) { $langs->load("assets"); - $newmenu->add("/assets/list.php?leftmenu=assets&mainmenu=accountancy",$langs->trans("MenuAssets"), 0, $user->rights->assets->read, '', $mainmenu, 'assets'); - $newmenu->add("/assets/card.php?leftmenu=assets&action=create",$langs->trans("MenuNewAsset"), 1, $user->rights->assets->write); - $newmenu->add("/assets/type.php?leftmenu=assets",$langs->trans("MenuTypeAssets"), 1, $user->rights->assets->read, '', $mainmenu, 'assets_type'); - $newmenu->add("/assets/type.php?leftmenu=assets_type&action=create",$langs->trans("MenuNewTypeAssets"), 1, $user->rights->assets->write); - $newmenu->add("/assets/type.php?leftmenu=assets_type",$langs->trans("MenuListTypeAssets"), 1, $user->rights->assets->read); - $newmenu->add("/assets/list.php?leftmenu=assets",$langs->trans("MenuListAssets"), 1, $user->rights->assets->read); + $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy",$langs->trans("MenuAssets"), 0, $user->rights->asset->read, '', $mainmenu, 'asset'); + $newmenu->add("/asset/card.php?leftmenu=asset&action=create",$langs->trans("MenuNewAsset"), 1, $user->rights->asset->write); + $newmenu->add("/asset/type.php?leftmenu=asset",$langs->trans("MenuTypeAssets"), 1, $user->rights->asset->read, '', $mainmenu, 'asset_type'); + $newmenu->add("/asset/type.php?leftmenu=asset_type&action=create",$langs->trans("MenuNewTypeAssets"), 1, $user->rights->asset->write); + $newmenu->add("/asset/type.php?leftmenu=asset_type",$langs->trans("MenuListTypeAssets"), 1, $user->rights->asset->read); + $newmenu->add("/asset/list.php?leftmenu=asset",$langs->trans("MenuListAssets"), 1, $user->rights->asset->read); } } diff --git a/htdocs/core/modules/modAssets.class.php b/htdocs/core/modules/modAsset.class.php similarity index 88% rename from htdocs/core/modules/modAssets.class.php rename to htdocs/core/modules/modAsset.class.php index 84aed4669a2..6b7985a0e23 100644 --- a/htdocs/core/modules/modAssets.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -17,11 +17,11 @@ */ /** - * \defgroup assets Module Assets - * \brief Assets module descriptor. + * \defgroup asset Module Assets + * \brief Asset module descriptor. * - * \file htdocs/core/modules/modAssets.class.php - * \ingroup assets + * \file htdocs/core/modules/modAsset.class.php + * \ingroup asset * \brief Description and activation file for module Assets */ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; @@ -33,7 +33,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; /** * Description and activation class for module FixedAssets */ -class modAssets extends DolibarrModules +class modAsset extends DolibarrModules { // @codingStandardsIgnoreEnd /** @@ -51,7 +51,7 @@ class modAssets extends DolibarrModules // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). $this->numero = 51000; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve id number for your module // Key text used to identify module (for permissions, menus, etc...) - $this->rights_class = 'assets'; + $this->rights_class = 'asset'; // Family can be 'crm','financial','hr','projects','products','ecm','technic','interface','other' // It is used to group modules by family in module setup page @@ -78,17 +78,17 @@ class modAssets extends DolibarrModules $this->picto='generic'; // Defined all module parts (triggers, login, substitutions, menus, css, etc...) - // for default path (eg: /assets/core/xxxxx) (0=disable, 1=enable) - // for specific path of parts (eg: /assets/core/modules/barcode) - // for specific css file (eg: /assets/css/assets.css.php) + // for default path (eg: /asset/core/xxxxx) (0=disable, 1=enable) + // for specific path of parts (eg: /asset/core/modules/barcode) + // for specific css file (eg: /asset/css/assets.css.php) $this->module_parts = array(); // Data directories to create when module is enabled. - // Example: this->dirs = array("/assets/temp","/assets/subdir"); + // Example: this->dirs = array("/asset/temp","/asset/subdir"); $this->dirs = array(); // Config pages. Put here list of php page, stored into assets/admin directory, to use to setup module. - $this->config_page_url = array("setup.php@assets"); + $this->config_page_url = array("setup.php@asset"); // Dependencies $this->hidden = false; // A condition to hide module @@ -109,14 +109,14 @@ class modAssets extends DolibarrModules // 1=>array('ASSETS_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1) // ); $this->const = array( - 1=>array('ASSETS_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1) + 1=>array('ASSET_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1) ); - if (! isset($conf->assets) || ! isset($conf->assets->enabled)) + if (! isset($conf->asset) || ! isset($conf->asset->enabled)) { - $conf->assets=new stdClass(); - $conf->assets->enabled=0; + $conf->asset=new stdClass(); + $conf->asset->enabled=0; } @@ -170,16 +170,16 @@ class modAssets extends DolibarrModules // Boxes/Widgets // Add here list of php file(s) stored in assets/core/boxes that contains class to show a widget. $this->boxes = array( - //0=>array('file'=>'assetswidget1.php@assets','note'=>'Widget provided by Assets','enabledbydefaulton'=>'Home'), - //1=>array('file'=>'assetswidget2.php@assets','note'=>'Widget provided by Assets'), - //2=>array('file'=>'assetswidget3.php@assets','note'=>'Widget provided by Assets') + //0=>array('file'=>'assetswidget1.php@asset','note'=>'Widget provided by Assets','enabledbydefaulton'=>'Home'), + //1=>array('file'=>'assetswidget2.php@asset','note'=>'Widget provided by Assets'), + //2=>array('file'=>'assetswidget3.php@asset','note'=>'Widget provided by Assets') ); // Cronjobs (List of cron jobs entries to add when module is enabled) // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week $this->cronjobs = array( - 0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/assets/class/assets.class.php', 'objectname'=>'Assets', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true) + 0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/asset/class/asset.class.php', 'objectname'=>'Asset', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true) ); // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true), // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true) @@ -193,22 +193,22 @@ class modAssets extends DolibarrModules $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) $this->rights[$r][1] = 'Read assets'; // Permission label $this->rights[$r][3] = 1; // Permission by default for new user (0/1) - $this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->assets->level1->level2) - $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->assets->level1->level2) + $this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2) + $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2) $r++; $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) $this->rights[$r][1] = 'Create/Update assets'; // Permission label $this->rights[$r][3] = 1; // Permission by default for new user (0/1) - $this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->assets->level1->level2) - $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->assets->level1->level2) + $this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2) + $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2) $r++; $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) $this->rights[$r][1] = 'Delete assets'; // Permission label $this->rights[$r][3] = 1; // Permission by default for new user (0/1) - $this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->assets->level1->level2) - $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->assets->level1->level2) + $this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2) + $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->asset->level1->level2) // Main menu entries diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index c72c31b3a99..1ea820e09ad 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -24,10 +24,9 @@ /** * \file htdocs/fourn/commande/list.php * \ingroup fournisseur - * \brief List of suppliers orders + * \brief List of vendor orders */ - require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -40,13 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -$langs->load("orders"); -$langs->load("sendings"); -$langs->load('deliveries'); -$langs->load('companies'); -$langs->load('compta'); -$langs->load('bills'); -$langs->load('projects'); +$langs->loadLangs(array("orders","sendings",'deliveries','companies','compta','bills','projects','suppliers')); $action=GETPOST('action','aZ09'); $massaction=GETPOST('massaction','alpha'); @@ -825,19 +818,19 @@ if ($resql) // Date order if (! empty($arrayfields['cf.date_commande']['checked'])) { - print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($search_orderyear?$search_orderyear:-1,'search_orderyear',1, 20, 5); print ''; } // Date delivery if (! empty($arrayfields['cf.date_delivery']['checked'])) { - print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; - $formother->select_year($search_deliveryyear?$search_deliveryyear:-1,'search_deliveryyear',1, 20, 5); + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($search_deliveryyear?$search_deliveryyear:-1, 'search_deliveryyear', 1, 20, 5); print ''; } if (! empty($arrayfields['cf.total_ht']['checked'])) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 95bbfe48e19..90240cf8688 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -643,18 +643,18 @@ if ($resql) // Date invoice if (! empty($arrayfields['f.datef']['checked'])) { - print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($year?$year:-1,'year',1, 20, 5); print ''; } // Date due if (! empty($arrayfields['f.date_lim_reglement']['checked'])) { - print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($year_lim?$year_lim:-1,'year_lim',1, 20, 5); print '
'.$langs->trans("Late"); print ''; diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index a47b76e4af8..74593cb8675 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -851,8 +851,8 @@ if (empty($action)) print ''; print ''; print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; - print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; $formother->select_year($year?$year:-1,'year',1, 20, 5); print ''; print ''; diff --git a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql index 954469df861..c2d7d3dd321 100644 --- a/htdocs/install/mysql/migration/7.0.0-8.0.0.sql +++ b/htdocs/install/mysql/migration/7.0.0-8.0.0.sql @@ -437,3 +437,5 @@ ALTER TABLE llx_accounting_account ADD INDEX idx_accounting_account_account_pare ALTER TABLE llx_extrafields MODIFY COLUMN list VARCHAR(128); +UPDATE llx_rights_def set module = 'asset' where module = 'assets'; + diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 3a93cd836c6..46bf3c93a2c 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -917,7 +917,7 @@ SearchIntoTasks=Tasks SearchIntoCustomerInvoices=Customer invoices SearchIntoSupplierInvoices=Vendor invoices SearchIntoCustomerOrders=Customer orders -SearchIntoSupplierOrders=Vendor orders +SearchIntoSupplierOrders=Purchase orders SearchIntoCustomerProposals=Customer proposals SearchIntoSupplierProposals=Vendor proposals SearchIntoInterventions=Interventions diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 9942a081e57..06191d9f7b7 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -117,7 +117,7 @@ FirstApprovalAlreadyDone=First approval already done SecondApprovalAlreadyDone=Second approval already done SupplierOrderReceivedInDolibarr=Purchase Order %s received %s SupplierOrderSubmitedInDolibarr=Purchase Order %s submited -SupplierOrderClassifiedBilled=Vendor order %s set billed +SupplierOrderClassifiedBilled=Purchase Order %s set billed OtherOrders=Other orders ##### Types de contacts ##### TypeContact_commande_internal_SALESREPFOLL=Representative following-up customer order @@ -125,7 +125,7 @@ TypeContact_commande_internal_SHIPPING=Representative following-up shipping TypeContact_commande_external_BILLING=Customer invoice contact TypeContact_commande_external_SHIPPING=Customer shipping contact TypeContact_commande_external_CUSTOMER=Customer contact following-up order -TypeContact_order_supplier_internal_SALESREPFOLL=Representative following-up vendor order +TypeContact_order_supplier_internal_SALESREPFOLL=Representative following-up purchase order TypeContact_order_supplier_internal_SHIPPING=Representative following-up shipping TypeContact_order_supplier_external_BILLING=Vendor invoice contact TypeContact_order_supplier_external_SHIPPING=Vendor shipping contact diff --git a/htdocs/langs/en_US/workflow.lang b/htdocs/langs/en_US/workflow.lang index c8724c5f5b2..ed19a531c07 100644 --- a/htdocs/langs/en_US/workflow.lang +++ b/htdocs/langs/en_US/workflow.lang @@ -14,7 +14,7 @@ descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER=Classify linked source custome descWORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER=Classify linked source customer order(s) to billed when customer invoice is set to paid (and if amount of the invoice is same than total amount of linked orders) descWORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING=Classify linked source customer order to shipped when a shipment is validated (and if quantity shipped by all shipments is the same as in the order to update) # Autoclassify supplier order -descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vendor proposal(s) to billed when supplier invoice is validated (and if amount of the invoice is same than total amount of linked proposals) -descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source vendor order(s) to billed when supplier invoice is validated (and if amount of the invoice is same than total amount of linked orders) +descWORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL=Classify linked source vendor proposal(s) to billed when vendor invoice is validated (and if amount of the invoice is same than total amount of linked proposals) +descWORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER=Classify linked source purchase order(s) to billed when vendor invoice is validated (and if amount of the invoice is same than total amount of linked orders) AutomaticCreation=Automatic creation AutomaticClassification=Automatic classification \ No newline at end of file diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 6cc5b54f050..aa5c7e70ab3 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -477,13 +477,13 @@ if ($resql) if (! empty($arrayfields['sp.ref']['checked'])) { print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.nom']['checked'])) { print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['s.town']['checked'])) print ''; @@ -514,7 +514,7 @@ if ($resql) { print ''; //print $langs->trans('Month').': '; - print ''; + print ''; //print ' '.$langs->trans('Year').': '; $syearvalid = $yearvalid; $formother->select_year($syearvalid,'yearvalid',1, 20, 5); @@ -525,7 +525,7 @@ if ($resql) { print ''; //print $langs->trans('Month').': '; - print ''; + print ''; //print ' '.$langs->trans('Year').': '; $syear = $year; $formother->select_year($syear,'year',1, 20, 5); @@ -536,28 +536,28 @@ if ($resql) { // Amount print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['sp.total_vat']['checked'])) { // Amount print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['sp.total_ttc']['checked'])) { // Amount print ''; - print ''; + print ''; print ''; } if (! empty($arrayfields['u.login']['checked'])) { // Author print ''; - print ''; + print ''; print ''; } // Extra fields diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 578ec142ad5..6683e966a97 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1011,7 +1011,7 @@ select.selectarrowonleft option { select { padding-top: 4px; - padding-bottom: 5px; + padding-bottom: 4px; } input, input[type=text], input[type=password], select, textarea { min-width: 20px;