diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index f8b89c515aa..0d6ff4d34a0 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -155,7 +155,7 @@ print '
'; print ''; print ''; -dol_fiche_head($head, 'handler', $langs->trans("Menus")); +dol_fiche_head($head, 'handler', $langs->trans("Menus"), -1); print $langs->trans("MenusDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index acfa9d2dccd..ed5f56954c0 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -234,7 +234,7 @@ $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; -dol_fiche_head($head, 'editor', $langs->trans("Menus")); +dol_fiche_head($head, 'editor', $langs->trans("Menus"), -1); print $langs->trans("MenusEditorDesc")."
\n"; print "
\n"; diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index 471edf58e79..0a3cb6b99bc 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -77,7 +77,7 @@ $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'misc'; $h++; -dol_fiche_head($head, 'misc', $langs->trans("Menus")); +dol_fiche_head($head, 'misc', $langs->trans("Menus"), -1); // Other Options diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index bfaeabf67d4..ddaf940492f 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -278,13 +278,12 @@ foreach ($modulesdir as $dir) try { - $res=include_once $dir.$file; + $res=include_once $dir.$file; // A class already exists in a different file will send a non catchable fatal error. if (class_exists($modName)) { try { $objMod = new $modName($db); $modNameLoaded[$modName]=$dir; - if (! $objMod->numero > 0 && $modName != 'modUser') { dol_syslog('The module descriptor '.$modName.' must have a numero property', LOG_ERR); diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 30e4734e843..c3e2cb6345a 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -25,7 +25,7 @@ include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; /** - * Class to describe a Cron module + * Class to describe a BlockedLog module */ class modBlockedLog extends DolibarrModules { diff --git a/htdocs/core/modules/modModuleBuilder.class.php b/htdocs/core/modules/modModuleBuilder.class.php new file mode 100644 index 00000000000..b68148377c3 --- /dev/null +++ b/htdocs/core/modules/modModuleBuilder.class.php @@ -0,0 +1,89 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \defgroup modulebuilder Module ModuleBuilder + * \brief Add a log into a block chain for some actions. + * \file htdocs/core/modules/modBlockedLog.class.php + * \ingroup blockedlog + * \brief Description and activation file for module ModuleBuilder + */ +include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; + +/** + * Class to describe a ModuleBuilder module + */ +class modModuleBuilder extends DolibarrModules +{ + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + function __construct($db) + { + global $langs,$conf; + + $this->db = $db; + $this->numero = 3300; + + // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' + // It is used to group modules in module setup page + $this->family = "technic"; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = preg_replace('/^mod/i','',get_class($this)); + $this->description = "A tool to help developers to build their own module."; + $this->version = 'development'; // 'development', 'experimental' or 'dolibarr' or version + // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Where to store the module in setup page (0=common,1=interface,2=others,3=very specific) + $this->special = 1; + // Name of image file used for this module. + $this->picto='technic'; + + // Data directories to create when module is enabled + $this->dirs = array(); + + // Config pages + //------------- + $this->config_page_url = array(); + + // Dependancies + //------------- + $this->hidden = false; // A condition to disable module + $this->depends = array(); // List of modules id that must be enabled if this module is enabled + $this->requiredby = array(); // List of modules id to disable if this one is disabled + $this->conflictwith = array(); // List of modules id this module is in conflict with + $this->langfiles = array(); + + // Constants + //----------- + + + // New pages on tabs + // ----------------- + $this->tabs = array(); + + // Boxes + //------ + $this->boxes = array(); + + // Main menu entries + //------------------ + $this->menu = array(); + } +} diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 5e2bc435e56..fc89f6eb3cf 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -321,8 +321,8 @@ if (($action=="create") || ($action=="edit")) print ''."\n"; } - - dol_fiche_head(''); + if ($action=="edit") dol_fiche_head($head, 'card', $langs->trans("CronTask"), 0, 'cron'); + else dol_fiche_head(''); print ''; @@ -558,6 +558,8 @@ else dol_fiche_head($head, 'card', $langs->trans("CronTask"), -1, 'cron'); $linkback = '' . $langs->trans("BackToList") . ''; + + // TODO Use dol_banner // box add_jobs_box print '
'; @@ -616,7 +618,7 @@ else print '
"; print '
'; print $langs->trans('Active').""; - print yn($object->status); + print $object->getLibStatut(4); print "
'; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 2f9ad12a57f..789e3bafcec 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -1199,8 +1199,63 @@ class Cronjob extends CommonObject } return 1; - } + + /** + * Return label of status of user (active, inactive) + * + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label of status + */ + function getLibStatut($mode=0) + { + return $this->LibStatut($this->status,$mode); + } + + /** + * Renvoi le libelle d'un statut donne + * + * @param int $status Id statut + * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto + * @return string Label of status + */ + function LibStatut($status,$mode=0) + { + global $langs; + $langs->load('users'); + + if ($mode == 0) + { + $prefix=''; + if ($status == 1) return $langs->trans('Enabled'); + if ($status == 0) return $langs->trans('Disabled'); + } + if ($mode == 1) + { + if ($status == 1) return $langs->trans('Enabled'); + if ($status == 0) return $langs->trans('Disabled'); + } + if ($mode == 2) + { + if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"').' '.$langs->trans('Enabled'); + if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled'); + } + if ($mode == 3) + { + if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"'); + if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"'); + } + if ($mode == 4) + { + if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"').' '.$langs->trans('Enabled'); + if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"').' '.$langs->trans('Disabled'); + } + if ($mode == 5) + { + if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4','class="pictostatus"'); + if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5','class="pictostatus"'); + } + } } diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang new file mode 100644 index 00000000000..6605a7b6a63 --- /dev/null +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -0,0 +1,3 @@ +# Dolibarr language file - Source file is en_US - loan +ModuleBuilder=Module Builder +ModuleBuilderDesc=This tools give you utilites to build your own module. Your modules will be generated into the first alternative directory: %s. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 8d1138e5758..fe1ed01a68f 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1377,8 +1377,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $menumanager->showmenu('top', array('searchform'=>$searchform, 'bookmarks'=>$bookmarks)); // This contains a \n print "\n"; - //$form=new Form($db); - // Define link to login card $appli=constant('DOL_APPLICATION_TITLE'); if (! empty($conf->global->MAIN_APPLICATION_TITLE)) @@ -1403,7 +1401,8 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $logouthtmltext.=$langs->trans("Logout").'
'; $logouttext .=''; - $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); + //$logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout_top.png', 'class="login"', 0, 0, 1); + $logouttext .=''; $logouttext .=''; } else @@ -1427,6 +1426,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $toprightmenu.=''; $toprightmenu.='