diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 07f124741fe..66c293f2cb0 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -356,6 +356,22 @@ class Documents extends DolibarrApi $upload_dir = $conf->facture->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'invoice'); } + else if ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') + { + require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; + + if (!DolibarrApiAccess::$user->rights->agenda->myactions->read && !DolibarrApiAccess::$user->rights->agenda->allactions->read) { + throw new RestException(401); + } + + $object = new ActionComm($this->db); + $result=$object->fetch($id, $ref); + if ( ! $result ) { + throw new RestException(404, 'Event not found'); + } + + $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); + } else { throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.'); diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 698eca5fd21..f9c7fe6467c 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -573,13 +573,13 @@ class Notify $mesg = $langs->transnoentitiesnoconv("EMailTextOrderValidated",$link); break; case 'PROPAL_VALIDATE': - $link='/comm/propal/card.php?id='.$object->id; + $link='' . $newref . ''; $dir_output = $conf->propal->multidir_output[$object->entity]; $object_type = 'propal'; $mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$link); break; case 'PROPAL_CLOSE_SIGNED': - $link='/comm/propal/card.php?id='.$object->id; + $link='' . $newref . ''; $dir_output = $conf->propal->multidir_output[$object->entity]; $object_type = 'propal'; $mesg = $langs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$link); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 2999833e81e..2b7bc860746 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1484,10 +1484,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; - require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; - require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; - require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; - require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions=new FormActions($db); @@ -1496,12 +1493,6 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= $userstatic=new User($db); $contactstatic = new Contact($db); - // TODO mutualize/uniformize - $propalstatic=new Propal($db); - $orderstatic=new Commande($db); - $supplierorderstatic=new CommandeFournisseur($db); - $facturestatic=new Facture($db); - $out.='
'; if ($objcon && get_class($objcon) == 'Contact' && $filterobj && get_class($filterobj) == 'Societe') { @@ -1662,45 +1653,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon='', $noprint= //$out.=''.dol_trunc($histo[$key]['note'], 40).''; // Objet lie - // TODO mutualize/uniformize $out.=''; - //var_dump($histo[$key]['elementtype']); - if (isset($histo[$key]['elementtype'])) + if (isset($histo[$key]['elementtype']) && !empty($histo[$key]['fk_element'])) { - if ($histo[$key]['elementtype'] == 'propal' && ! empty($conf->propal->enabled)) - { - //$propalstatic->ref=$langs->trans("ProposalShort"); - //$propalstatic->id=$histo[$key]['fk_element']; - if ($propalstatic->fetch($histo[$key]['fk_element'])>0) { - $propalstatic->type=$histo[$key]['ftype']; - $out.=$propalstatic->getNomUrl(1); - } else { - //$out.= ''.$langs->trans("ProposalDeleted").''; - } - } - elseif (($histo[$key]['elementtype'] == 'order' || $histo[$key]['elementtype'] == 'commande') && ! empty($conf->commande->enabled)) - { - //$orderstatic->ref=$langs->trans("Order"); - //$orderstatic->id=$histo[$key]['fk_element']; - if ($orderstatic->fetch($histo[$key]['fk_element'])>0) { - $orderstatic->type=$histo[$key]['ftype']; - $out.=$orderstatic->getNomUrl(1); - } else { - //$out.= ''.$langs->trans("OrderDeleted").''; - } - } - elseif (($histo[$key]['elementtype'] == 'invoice' || $histo[$key]['elementtype'] == 'facture') && ! empty($conf->facture->enabled)) - { - //$facturestatic->ref=$langs->trans("Invoice"); - //$facturestatic->id=$histo[$key]['fk_element']; - if ($facturestatic->fetch($histo[$key]['fk_element'])>0) { - $facturestatic->type=$histo[$key]['ftype']; - $out.=$facturestatic->getNomUrl(1,'compta'); - } else { - //$out.= ''.$langs->trans("InvoiceDeleted").''; - } - } - else $out.=' '; + $out.=dolGetElementUrl($histo[$key]['fk_element'],$histo[$key]['elementtype'],1); } else $out.=' '; $out.=''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4a65754e975..b8ede132215 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7576,7 +7576,7 @@ function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield=' { $dictvalues[$tablename] = array(); $sql = 'SELECT * FROM '.$tablename.' WHERE 1'; - if ($checkentity) $sql.= ' entity IN (0,'.getEntity('').')'; + if ($checkentity) $sql.= ' AND entity IN (0,'.getEntity('').')'; $resql = $db->query($sql); if ($resql) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 0ba249e03ef..219719b3232 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1871,7 +1871,11 @@ function dolGetElementUrl($objectid,$objecttype,$withpicto=0,$option='') { $object = new $classname($db); $res=$object->fetch($objectid); - if ($res > 0) $ret=$object->getNomUrl($withpicto,$option); + if ($res > 0) { + $ret=$object->getNomUrl($withpicto,$option); + } elseif($res==0) { + $ret=$langs->trans('Deleted'); + } unset($object); } else dol_syslog("Class with classname ".$classname." is unknown even after the include", LOG_ERR); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 562f9eed374..d222e54703a 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -337,7 +337,7 @@ class DolibarrModules // Can not be abstract, because we need to insta /** * @var array() Minimum version of PHP required by module. - * e.g.: PHP ≥ 5.3 = array(5, 3) + * e.g.: PHP ≥ 5.4 = array(5, 4) */ public $phpmin; @@ -464,7 +464,7 @@ class DolibarrModules // Can not be abstract, because we need to insta } /** - * Disable function. Deletes the module constant and boxes from the database. + * Disable function. Deletes the module constants and boxes from the database. * * @param string[] $array_sql SQL requests to be executed when module is disabled * @param string $options Options when disabling module: @@ -553,7 +553,7 @@ class DolibarrModules // Can not be abstract, because we need to insta } else { - // If module name translation using it's unique id does not exists, we try to use its name to find translation + // If module name translation using it's unique id does not exist, we try to use its name to find translation if (is_array($this->langfiles)) { foreach($this->langfiles as $val) @@ -613,9 +613,9 @@ class DolibarrModules // Can not be abstract, because we need to insta /** * Gives the long description of a module. First check README-la_LA.md then README.md - * If not markdown files found, it return translated value of the key ->descriptionlong. + * If no markdown files found, it returns translated value of the key ->descriptionlong. * - * @return string Long description of a module from README.md of from property. + * @return string Long description of a module from README.md of from property. */ function getDescLong() { diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 9d9c0268e2d..5b40ea235a6 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -66,8 +66,11 @@ class modSociete extends DolibarrModules $this->dirs = array("/societe/temp"); // Dependencies - $this->depends = array(); - $this->requiredby = array("modExpedition","modFacture","modFournisseur","modFicheinter","modPropale","modContrat","modCommande"); + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array("modExpedition","modFacture","modFournisseur","modFicheinter","modPropale","modContrat","modCommande"); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->langfiles = array("companies",'bills'); // Constants diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index ff767dd3658..9622e087699 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -65,8 +65,11 @@ class modStock extends DolibarrModules $this->config_page_url = array("stock.php"); // Dependencies - $this->depends = array("modProduct"); - $this->requiredby = array("modProductBatch"); + $this->hidden = false; // A condition to hide module + $this->depends = array("modProduct"); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array("modProductBatch"); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->langfiles = array("stocks"); // Constants diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index e5b481f4daa..1f6f1e92f05 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -65,10 +65,11 @@ class modStripe extends DolibarrModules // Data directories to create when module is enabled. $this->dirs = array(); - // Config pages. Put here list of php page names stored in admmin directory used to setup module. + // Config pages. Put here list of php page names stored in admin directory used to setup module. $this->config_page_url = array("stripe.php@stripe"); // Dependencies + $this->hidden = false; // A condition to hide 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->phpmin = array(5,4); // Minimum version of PHP required by module diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index fa7553fd6df..bb3cda6a837 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -57,13 +57,19 @@ class modSupplierProposal extends DolibarrModules $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); $this->picto='supplier_proposal'; - + + // Data directories to create when module is enabled. $this->dirs = array(); + + // Config pages. Put here list of php page names stored in admin directory used to setup module. + $this->config_page_url = array("supplier_proposal.php"); - // Dependancies - $this->depends = array('modFournisseur'); - $this->requiredby = array(); - $this->config_page_url = array("supplier_proposal.php"); + // Dependencies + $this->hidden = false; // A condition to hide module + $this->depends = array('modFournisseur'); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->langfiles = array("supplier_proposal"); // Constants diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index fca192f5ec0..0274eeb2e63 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -67,8 +67,11 @@ class modSyslog extends DolibarrModules $this->config_page_url = array("syslog.php"); // Dependencies - $this->depends = array(); - $this->requiredby = array(); + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module // Constants $this->const = array(); diff --git a/htdocs/core/modules/modTax.class.php b/htdocs/core/modules/modTax.class.php index f3fa7d4e9db..91ed84366de 100644 --- a/htdocs/core/modules/modTax.class.php +++ b/htdocs/core/modules/modTax.class.php @@ -67,9 +67,11 @@ class modTax extends DolibarrModules $this->config_page_url = array("taxes.php"); // Dependencies - $this->depends = array(); - $this->requiredby = array(); - $this->conflictwith = array(); + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->langfiles = array("compta","bills"); // Constants @@ -117,13 +119,10 @@ class modTax extends DolibarrModules // Menus - //------- - $this->menu = 1; // This module add menu entries. They are coded into menu manager. // Exports - //-------- $r=0; $r++; diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index 01c10a631ca..bc871d9c0e0 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -95,12 +95,11 @@ class modTicket extends DolibarrModules $this->config_page_url = array("ticket.php"); // Dependencies - // List of modules id that must be enabled if this module is enabled - $this->depends = array(); - // List of modules id to disable if this one is disabled - $this->requiredby = array(); - // Minimum version of PHP required by module - $this->phpmin = array(5, 3); + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->langfiles = array("ticket"); // Constants // List of particular constants to add when module is enabled @@ -115,7 +114,7 @@ class modTicket extends DolibarrModules 'project:+ticket:Tickets:@ticket:$user->rights->ticket->read:/ticket/list.php?projectid=__ID__', ); - // Dictionnaries + // Dictionaries if (! isset($conf->ticket->enabled)) { $conf->ticket=new stdClass(); $conf->ticket->enabled=0; diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 1c4a08411ad..19e146a6e8c 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -63,9 +63,12 @@ class modUser extends DolibarrModules // Config pages $this->config_page_url = array("user.php"); - // Dependancies - $this->depends = array(); - $this->requiredby = array(); + // Dependencies + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->langfiles = array("main","users","companies","members",'salaries'); $this->always_enabled = true; // Can't be disabled @@ -205,13 +208,10 @@ class modUser extends DolibarrModules // Menus - //------- - $this->menu = 1; // This module add menu entries. They are coded into menu manager. // Exports - //-------- $r=0; $r++; @@ -244,7 +244,6 @@ class modUser extends DolibarrModules $this->export_sql_end[$r] .=' WHERE u.entity IN ('.getEntity('user').')'; // Imports - //-------- $r=0; // Import list of users attributes diff --git a/htdocs/core/modules/modVariants.class.php b/htdocs/core/modules/modVariants.class.php index c56f5c0e49a..19c50d8843e 100644 --- a/htdocs/core/modules/modVariants.class.php +++ b/htdocs/core/modules/modVariants.class.php @@ -79,12 +79,10 @@ class modVariants extends DolibarrModules // Dependencies $this->hidden = false; // A condition to hide module - $this->depends = array( - 'modProduct' - ); // 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->phpmin = array(5,0); // Minimum version of PHP required by module + $this->depends = array('modProduct'); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module $this->langfiles = array("products"); diff --git a/htdocs/core/modules/modWebServices.class.php b/htdocs/core/modules/modWebServices.class.php index 8963f81813f..a3e9510563f 100644 --- a/htdocs/core/modules/modWebServices.class.php +++ b/htdocs/core/modules/modWebServices.class.php @@ -55,30 +55,26 @@ class modWebServices extends DolibarrModules $this->dirs = array(); // Config pages - //------------- $this->config_page_url = array("index.php@webservices"); - // Dependancies - //------------- - $this->depends = array(); - $this->requiredby = array(); - //$this->phpmax = array(7,1); // Maximum version of PHP required by module + // Dependencies + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants - //----------- $this->const = array(); // New pages on tabs - // ----------------- $this->tabs = array(); // Boxes - //------ $this->boxes = array(); // Permissions - //------------ $this->rights = array(); $this->rights_class = 'webservices'; $r=0; diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php index 9b6535143b3..35c4da5b037 100644 --- a/htdocs/core/modules/modWebServicesClient.class.php +++ b/htdocs/core/modules/modWebServicesClient.class.php @@ -55,29 +55,26 @@ class modWebServicesClient extends DolibarrModules $this->dirs = array(); // Config pages - //------------- //$this->config_page_url = array(); - // Dependancies - //------------- - $this->depends = array(); - $this->requiredby = array(); + // Dependencies + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->langfiles = array("other"); // Constants - //----------- $this->const = array(); // New pages on tabs - // ----------------- $this->tabs = array(); // Boxes - //------ $this->boxes = array(); // Permissions - //------------ $this->rights = array(); $this->rights_class = 'syncsupplierwebservices'; $r=0; diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index fb6e91283db..f684985917a 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -61,27 +61,23 @@ class modWebsite extends DolibarrModules $this->dirs = array("/website/temp"); // Config pages - //------------- $this->config_page_url = array('website.php'); - // Dependancies - //------------- + // Dependencies $this->hidden = ! empty($conf->global->MODULE_WEBSITE_DISABLED); // A condition to disable module $this->depends = array('modFckeditor'); // 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->phpmin = array(5,4); // Minimum version of PHP required by module $this->langfiles = array("website"); // Constants - //----------- $this->const = array(); // New pages on tabs - // ----------------- //$this->tabs[] = array(); // To add a new tab identified by code tabname1 // Boxes - //------ $this->boxes = array(); // Permissions diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index e721513073a..882e8aebf53 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -68,9 +68,11 @@ class modWorkflow extends DolibarrModules $this->config_page_url = array('workflow.php'); // Dependencies - $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->phpmin = array(5,2); // Minimum version of PHP required by module + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->phpmin = array(5,4); // Minimum version of PHP required by module $this->need_dolibarr_version = array(2,8); // Minimum version of Dolibarr required by module $this->langfiles = array("@workflow"); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 6e72e757fb6..803323edbf1 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -40,24 +40,83 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; */ class pdf_azur extends ModelePDFPropales { - var $db; - var $name; - var $description; - var $update_main_doc_field; // Save the name of generated file as the main doc when generating a doc with this template - var $type; - - var $phpmin = array(4,3,0); // Minimum version of PHP required by module - var $version = 'dolibarr'; - - var $page_largeur; - var $page_hauteur; - var $format; - var $marge_gauche; - var $marge_droite; - var $marge_haute; - var $marge_basse; - - var $emetteur; // Objet societe qui emet + /** + * @var DoliDb Database handler + */ + public $db; + + /** + * @var string model name + */ + public $name; + + /** + * @var string model description (short text) + */ + public $description; + + /** + * @var string Save the name of generated file as the main doc when generating a doc with this template + */ + public $update_main_doc_field; + + /** + * @var string document type + */ + public $type; + + /** + * @var array() Minimum version of PHP required by module. + * e.g.: PHP ≥ 5.4 = array(5, 4) + */ + public $phpmin = array(5, 4); + + /** + * Dolibarr version of the loaded document + * @public string + */ + public $version = 'dolibarr'; + + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + + /** + * Issuer + * @var Objet societe qui emet + */ + public $emetteur; /** diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 37e0cf64f15..d14a9bdcdc8 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -36,23 +36,79 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; */ class pdf_canelle extends ModelePDFSuppliersInvoices { - var $db; - var $name; - var $description; - var $type; - - var $phpmin = array(4,3,0); // Minimum version of PHP required by module - var $version = 'dolibarr'; - - var $page_largeur; - var $page_hauteur; - var $format; - var $marge_gauche; - var $marge_droite; - var $marge_haute; - var $marge_basse; - - var $emetteur; // Objet societe qui emet + /** + * @var DoliDb Database handler + */ + public $db; + + /** + * @var string model name + */ + public $name; + + /** + * @var string model description (short text) + */ + public $description; + +/** + * @var string document type + */ + public $type; + + /** + * @var array() Minimum version of PHP required by module. + * e.g.: PHP ≥ 5.4 = array(5, 4) + */ + public $phpmin = array(5, 4); + + /** + * Dolibarr version of the loaded document + * @public string + */ + public $version = 'dolibarr'; + + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + + /** + * Issuer + * @var Objet societe qui emet + */ + public $emetteur; + /** diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 8b84f428bde..68a2a8706b5 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -40,23 +40,78 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; */ class pdf_muscadet extends ModelePDFSuppliersOrders { - var $db; - var $name; - var $description; - var $type; + /** + * @var DoliDb Database handler + */ + public $db; + + /** + * @var string model name + */ + public $name; + + /** + * @var string model description (short text) + */ + public $description; + +/** + * @var string document type + */ + public $type; - var $phpmin = array(4,3,0); // Minimum version of PHP required by module - var $version = 'dolibarr'; - - var $page_largeur; - var $page_hauteur; - var $format; - var $marge_gauche; - var $marge_droite; - var $marge_haute; - var $marge_basse; - - var $emetteur; // Objet societe qui emet + /** + * @var array() Minimum version of PHP required by module. + * e.g.: PHP ≥ 5.4 = array(5, 4) + */ + public $phpmin = array(5, 4); + + /** + * Dolibarr version of the loaded document + * @public string + */ + public $version = 'dolibarr'; + + /** + * @var int page_largeur + */ + public $page_largeur; + + /** + * @var int page_hauteur + */ + public $page_hauteur; + + /** + * @var array format + */ + public $format; + + /** + * @var int marge_gauche + */ + public $marge_gauche; + + /** + * @var int marge_droite + */ + public $marge_droite; + + /** + * @var int marge_haute + */ + public $marge_haute; + + /** + * @var int marge_basse + */ + public $marge_basse; + + /** + * Issuer + * @var Objet societe qui emet + */ + public $emetteur; /** diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index ce83e3a3460..18c5dd4962a 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -130,8 +130,8 @@ $dolibarr_main_url_root_alt=(empty($dolibarr_main_url_root_alt)?'':trim($dolibar $dolibarr_main_document_root=trim($dolibarr_main_document_root); $dolibarr_main_document_root_alt=(empty($dolibarr_main_document_root_alt)?'':trim($dolibarr_main_document_root_alt)); -if (empty($dolibarr_main_db_port)) $dolibarr_main_db_port=0; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql' -if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysqli'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql' +if (empty($dolibarr_main_db_port)) $dolibarr_main_db_port=3306; // For compatibility with old configs, if not defined, we take 'mysql' type +if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysqli'; // For compatibility with old configs, if not defined, we take 'mysql' type // Mysql driver support has been removed in favor of mysqli if ($dolibarr_main_db_type == 'mysql') $dolibarr_main_db_type = 'mysqli';