diff --git a/dev/examples/zapier/README.md b/dev/examples/zapier/README.md index 453a5224993..e452cc2aa6b 100644 --- a/dev/examples/zapier/README.md +++ b/dev/examples/zapier/README.md @@ -1,68 +1,6 @@ # HOW TO BUILD +Take a look at the dolibarr wiki page of Zapier module: -## ENABLE MODULE ZAPIER ON DOLIBARR - -This should also enable the module API (required for authentication by Zapier service and to execute action in Dolibarr by Zapier). - -Create the Dolibarr login that will be used by Zapier to call APIs. Give the login the permissions on the action you plan to automate. - - -## CREATE A ZAPIER DEVELOPPER ACCOUNT - -At first, you need to have a Zapier developper acoount, create it here [Zapier Platform](https://developer.zapier.com/) - - -## INSTALL ZAPIER COMMAND LINE TOOLS WITH LINK TO ZAPIER ONLINE ACCOUNT - -### Install Node.js - -An easy option to get set up with Node.js is to visit [https://nodejs.org/en/download/](https://nodejs.org/en/download/) and download the official installer for your OS. If you're installing with a package manager it's even easier. - -After installation, confirm that Node.js is ready to use: - `node --version` - -### Install the Zapier CLI - -Next let's install the Zapier CLI tools. The CLI will allow you to build your app, deploy it to the Zapier platform, do local testing, manage users and testers, view remote logs, collaborate with your team, and more: - - `cd dev/examples/zapier` - - `npm install -g zapier-platform-cli` to install the CLI globally - - `zapier --version` to return version of the CLI - -### Run Zapier Login - -Let's configure authentication between your dev environment and the Zapier platform. You'll use the email address and password you use to log in to the Zapier application. - - `zapier login` - -This command will set up a .zapierrc file in your home directory. - -### Install the Project - -In zapier example directory, run: - - `cd dev/examples/zapier` - - `npm install` - -### Deploying your App - -Let's deploy it! When you're ready to try your code out on the Zapier platform use the push command. Only you will be able to see the app until you invite testers. - - `zapier register` (the first time, choose name for example "Dolibarr") - - `zapier push` - -After a push, the Application, with the name you defined during the register step, is available when creating a Zap. - -You will find original tutorial here : [https://zapier.com/developer/start/introduction](https://zapier.com/developer/start/introduction) - - -### Create a Zap - -Create a ZAP that use the application you registered. -For authentication, you must enter the login / pass of account used by Zapier to call APIs. +https://wiki.dolibarr.org/index.php?title=Module_Zapier diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/member.php similarity index 100% rename from htdocs/adherents/admin/adherent.php rename to htdocs/adherents/admin/member.php diff --git a/htdocs/adherents/admin/adherent_emails.php b/htdocs/adherents/admin/member_emails.php similarity index 79% rename from htdocs/adherents/admin/adherent_emails.php rename to htdocs/adherents/admin/member_emails.php index e1867285930..cdda83b4714 100644 --- a/htdocs/adherents/admin/adherent_emails.php +++ b/htdocs/adherents/admin/member_emails.php @@ -24,7 +24,7 @@ */ /** - * \file htdocs/adherents/admin/adherent.php + * \file htdocs/adherents/admin/member_emails.php * \ingroup member * \brief Page to setup the module Foundation */ @@ -55,6 +55,7 @@ $constantes = array( 'ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_VALID */ 'ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_COTIS */ 'ADHERENT_EMAIL_TEMPLATE_CANCELATION' =>'emailtemplate:member', /* old was ADHERENT_MAIL_RESIL */ + 'ADHERENT_EMAIL_TEMPLATE_EXCLUSION' =>'emailtemplate:member', 'ADHERENT_MAIL_FROM'=>'string', 'ADHERENT_AUTOREGISTER_NOTIF_MAIL_SUBJECT'=>'string', 'ADHERENT_AUTOREGISTER_NOTIF_MAIL'=>'html', @@ -69,9 +70,24 @@ $constantes = array( // if ($action == 'updateall') { $db->begin(); - $res1 = $res2 = $res3 = $res4 = $res5 = $res6 = 0; - $res1 = dolibarr_set_const($db, 'XXXX', GETPOST('ADHERENT_LOGIN_NOT_REQUIRED', 'alpha'), 'chaine', 0, '', $conf->entity); - if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0) { + + $res = 0; + foreach ($constantes as $constname => $value) { + $constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alphanohtml') : GETPOST('constvalue')); + $consttype = (GETPOSTISSET('consttype_'.$constname) ? GETPOST('consttype_'.$constname, 'alphanohtml') : GETPOST('consttype')); + $constnote = (GETPOSTISSET('constnote_'.$constname) ? GETPOST('constnote_'.$constname, 'restricthtml') : GETPOST('constnote')); + + $typetouse = empty($oldtypetonewone[$consttype]) ? $consttype : $oldtypetonewone[$consttype]; + $constvalue = preg_replace('/:member$/', '', $constvalue); + + $res = dolibarr_set_const($db, $constname, $constvalue, $consttype, 0, $constnote, $conf->entity); + if ($res <= 0) { + $error++; + $action = 'list'; + } + } + + if ($error > 0) { setEventMessages('ErrorFailedToSaveDate', null, 'errors'); $db->rollback(); } else { @@ -126,19 +142,19 @@ $head = member_admin_prepare_head(); print dol_get_fiche_head($head, 'emails', $langs->trans("Members"), -1, 'user'); // TODO Use global form -//print '
'; -//print ''; -//print ''; +print ''; +print ''; +print ''; $helptext = '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; $helptext .= '__DOL_MAIN_URL_ROOT__, __ID__, __FIRSTNAME__, __LASTNAME__, __FULLNAME__, __LOGIN__, __PASSWORD__, '; $helptext .= '__COMPANY__, __ADDRESS__, __ZIP__, __TOWN__, __COUNTRY__, __EMAIL__, __BIRTH__, __PHOTO__, __TYPE__, '; //$helptext.='__YEAR__, __MONTH__, __DAY__'; // Not supported -form_constantes($constantes, 0, $helptext); +form_constantes($constantes, 3, $helptext); -//print '
'; -//print '
'; +print '
'; +print ''; print dol_get_fiche_end(); diff --git a/htdocs/adherents/admin/adherent_extrafields.php b/htdocs/adherents/admin/member_extrafields.php similarity index 97% rename from htdocs/adherents/admin/adherent_extrafields.php rename to htdocs/adherents/admin/member_extrafields.php index ec3b3824db7..7f5262bc7c6 100644 --- a/htdocs/adherents/admin/adherent_extrafields.php +++ b/htdocs/adherents/admin/member_extrafields.php @@ -19,7 +19,7 @@ */ /** - * \file htdocs/adherents/admin/adherent_extrafields.php + * \file htdocs/adherents/admin/member_extrafields.php * \ingroup member * \brief Page to setup extra fields of members */ diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/member_type_extrafields.php similarity index 97% rename from htdocs/adherents/admin/adherent_type_extrafields.php rename to htdocs/adherents/admin/member_type_extrafields.php index 34175da465f..91a9233e5d0 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/member_type_extrafields.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/adherents/admin/adherent_type_extrafields.php + * \file htdocs/adherents/admin/member_type_extrafields.php * \ingroup member * \brief Page to setup extra fields of members */ diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index d13b4a27c43..d4f2df25c0c 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -178,7 +178,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print ''; $listofval = array(); $listofval += $adht->liste_array(); - $forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1; + $forcetype = empty($conf->global->MEMBER_NEWFORM_FORCETYPE) ? -1 : $conf->global->MEMBER_NEWFORM_FORCETYPE; print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval) > 1 ? 1 : 0); print "\n"; @@ -232,7 +232,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) { print '
'; //print $langs->trans('FollowingLinksArePublic').'
'; print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').':
'; - if ($conf->multicompany->enabled) { + if (!empty($conf->multicompany->enabled)) { $entity_qr = '?entity='.$conf->entity; } else { $entity_qr = ''; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index b34e39872ac..57e510719bb 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -655,7 +655,7 @@ if (empty($reshook)) { $action = ''; } - if ($user->rights->adherent->supprimer && $action == 'confirm_resign') { + if ($user->rights->adherent->supprimer && $action == 'confirm_resiliate') { $error = 0; if ($confirm == 'yes') { @@ -726,6 +726,77 @@ if (empty($reshook)) { } } + if ($user->rights->adherent->supprimer && $action == 'confirm_exclude') { + $error = 0; + + if ($confirm == 'yes') { + $adht = new AdherentType($db); + $adht->fetch($object->typeid); + + $result = $object->exclude($user); + + if ($result >= 0 && !count($object->errors)) { + if ($object->email && GETPOST("send_mail")) { + $subject = ''; + $msg = ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION; + + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + if (empty($labeltouse) || (int) $labeltouse === -1) { + //fallback on the old configuration. + setEventMessages('WarningMandatorySetupNotComplete', null, 'errors'); + $error++; + } else { + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnExclude()), $substitutionarray, $outputlangs); + + $moreinheader = 'X-Dolibarr-Info: send_an_email by adherents/card.php'."\r\n"; + + $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader); + if ($result < 0) { + $error++; + setEventMessages($object->error, $object->errors, 'errors'); + } + } + } + } else { + $error++; + + if ($object->error) { + setEventMessages($object->error, $object->errors, 'errors'); + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + $action = ''; + } + } + if (!empty($backtopage) && !$error) { + header("Location: ".$backtopage); + exit; + } + } + // SPIP Management if ($user->rights->adherent->supprimer && $action == 'confirm_del_spip' && $confirm == 'yes') { if (!count($object->errors)) { @@ -1434,8 +1505,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ValidateMember"), $langs->trans("ConfirmValidateMember"), "confirm_valid", $formquestion, 'yes', 1, 220); } - // Confirm terminate - if ($action == 'resign') { + // Confirm resiliate + if ($action == 'resiliate') { $langs->load("mails"); $adht = new AdherentType($db); @@ -1491,7 +1562,67 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if ($backtopage) { $formquestion[] = array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); } - print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ResiliateMember"), $langs->trans("ConfirmResiliateMember"), "confirm_resign", $formquestion, 'no', 1, 240); + print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ResiliateMember"), $langs->trans("ConfirmResiliateMember"), "confirm_resiliate", $formquestion, 'no', 1, 240); + } + + // Confirm exclude + if ($action == 'exclude') { + $langs->load("mails"); + + $adht = new AdherentType($db); + $adht->fetch($object->typeid); + + $subject = ''; + $msg = ''; + + // Send subscription email + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + // Set output language + $outputlangs = new Translate('', $conf); + $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang); + // Load traductions files required by page + $outputlangs->loadLangs(array("main", "members")); + // Get email content from template + $arraydefaultmessage = null; + $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION; + + if (!empty($labeltouse)) { + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); + } + + if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { + $subject = $arraydefaultmessage->topic; + $msg = $arraydefaultmessage->content; + } + + $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object); + complete_substitutions_array($substitutionarray, $outputlangs, $object); + $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs); + $texttosend = make_substitutions(dol_concatdesc($msg, $adht->getMailOnExclude()), $substitutionarray, $outputlangs); + + $tmp = $langs->trans("SendingAnEMailToMember"); + $tmp .= '
('.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.', '; + $tmp .= $langs->trans("MailRecipient").': '.$object->email.')'; + $helpcontent = ''; + $helpcontent .= ''.$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.'
'."\n"; + $helpcontent .= ''.$langs->trans("MailRecipient").': '.$object->email.'
'."\n"; + $helpcontent .= ''.$langs->trans("Subject").':
'."\n"; + $helpcontent .= $subjecttosend."\n"; + $helpcontent .= "
"; + $helpcontent .= ''.$langs->trans("Content").':
'; + $helpcontent .= dol_htmlentitiesbr($texttosend)."\n"; + $label = $form->textwithpicto($tmp, $helpcontent, 1, 'help'); + + // Create an array + $formquestion = array(); + if ($object->email) { + $formquestion[] = array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? 'true' : 'false')); + } + if ($backtopage) { + $formquestion[] = array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"])); + } + print $form->formconfirm("card.php?rowid=".$id, $langs->trans("ExcludeMember"), $langs->trans("ConfirmExcludeMember"), "confirm_exclude", $formquestion, 'no', 1, 240); } // Confirm remove member @@ -1584,12 +1715,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } elseif (!$adht->subscription) { print $langs->trans("SubscriptionNotRecorded"); if ($object->statut > 0) { - print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated + print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated } } else { print $langs->trans("SubscriptionNotReceived"); if ($object->statut > 0) { - print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated + print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft, not excluded and not resiliated } } } @@ -1740,7 +1871,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Reactivate - if ($object->statut == 0) { + if ($object->statut == 0 || $object->statut == -2) { if ($user->rights->adherent->creer) { print '
'.$langs->trans("Reenable")."
\n"; } else { @@ -1748,15 +1879,24 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } } - // Terminate + // Resiliate if ($object->statut >= 1) { if ($user->rights->adherent->supprimer) { - print '
'.$langs->trans("Resiliate")."
\n"; + print '
'.$langs->trans("Resiliate")."
\n"; } else { print '
'.$langs->trans("Resiliate")."
"; } } + // Exclude + if ($object->statut >= 1) { + if ($user->rights->adherent->supprimer) { + print '
'.$langs->trans("Exclude")."
\n"; + } else { + print '
'.$langs->trans("Exclude")."
"; + } + } + // Create third party if (!empty($conf->societe->enabled) && !$object->socid) { if ($user->rights->societe->creer) { diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 6429f86311a..bb56eaf4947 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -206,7 +206,7 @@ class Adherent extends CommonObject public $public; - // -1:brouillon, 0:resilie, >=1:valide,paye + // -2:exclu, -1:brouillon, 0:resilie, >=1:valide,paye // def in common object //public $status; @@ -326,7 +326,7 @@ class Adherent extends CommonObject 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 190), 'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => -1, 'position' => 195), 'statut' => array('type' => 'smallint(6)', 'label' => 'Statut', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 500, - 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', -1 => 'MemberStatusResiliatedShort')), + 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', -1 => 'MemberStatusResiliatedShort', -2 => 'MemberStatusExcludedShort')), 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 800), 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 805) ); @@ -1917,6 +1917,55 @@ class Adherent extends CommonObject } } + /** + * Functiun to exlude (set adherent.status to -2) a member + * TODO + * A private note should be added to know why the member has been excluded + * For historical purpose it add an "extra-subscription" type excluded + * + * @param User $user User making change + * @return int <0 if KO, >0 if OK + */ + public function exclude($user) + { + global $langs, $conf; + + $error = 0; + + // Check parameters + if ($this->statut == 0) { + dol_syslog(get_class($this)."::resiliate statut of member does not allow this", LOG_WARNING); + return 0; + } + + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; + $sql .= " statut = -2"; + $sql .= ", fk_user_valid=".$user->id; + $sql .= " WHERE rowid = ".$this->id; + + $result = $this->db->query($sql); + if ($result) { + $this->statut = 0; + + // Call trigger + $result = $this->call_trigger('MEMBER_EXCLUDE', $user); + if ($result < 0) { + $error++; + $this->db->rollback(); + return -1; + } + // End call triggers + + $this->db->commit(); + return 1; + } else { + $this->error = $this->db->error(); + $this->db->rollback(); + return -1; + } + } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** @@ -2173,7 +2222,7 @@ class Adherent extends CommonObject } /** - * Retourne le libelle du statut d'un adherent (brouillon, valide, resilie) + * Retourne le libelle du statut d'un adherent (brouillon, valide, resilie, exclu) * * @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 @@ -2229,6 +2278,10 @@ class Adherent extends CommonObject $statusType = 'status6'; $labelStatus = $langs->trans("MemberStatusResiliated"); $labelStatusShort = $langs->trans("MemberStatusResiliatedShort"); + } elseif ($status == -2) { + $statusType = 'status8'; + $labelStatus = $langs->trans("MemberStatusExcluded"); + $labelStatusShort = $langs->trans("MemberStatusExcludedShort"); } return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode); diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 5932bf58e6d..c4402a157bd 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -103,6 +103,9 @@ class AdherentType extends CommonObject /** @var string Email sent after resiliation */ public $mail_resiliate = ''; + /** @var string Email sent after exclude */ + public $mail_exclude = ''; + /** @var array Array of members */ public $members = array(); @@ -820,4 +823,19 @@ class AdherentType extends CommonObject return ''; } + + /** + * getMailOnExclude + * + * @return string Return mail model content of type or empty + */ + public function getMailOnExclude() + { + // NOTE mail_exclude not defined so never used + if (!empty($this->mail_exclude) && trim(dol_htmlentitiesbr_decode($this->mail_exclude))) { // Property not yet defined + return $this->mail_exclude; + } + + return ''; + } } diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 277d2798bb7..68d161d0cf1 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -329,7 +329,7 @@ class Members extends DolibarrApi continue; } // Process the status separately because it must be updated using - // the validate() and resiliate() methods of the class Adherent. + // the validate(), resiliate() and exclude() methods of the class Adherent. if ($field == 'statut') { if ($value == '0') { $result = $member->resiliate(DolibarrApiAccess::$user); @@ -341,6 +341,11 @@ class Members extends DolibarrApi if ($result < 0) { throw new RestException(500, 'Error when validating member: '.$member->error); } + } elseif ($value == '-2') { + $result = $member->exclude(DolibarrApiAccess::$user); + if ($result < 0) { + throw new RestException(500, 'Error when excluding member: '.$member->error); + } } } else { $member->$field = $value; diff --git a/htdocs/adherents/class/api_memberstypes.class.php b/htdocs/adherents/class/api_memberstypes.class.php index fbf9150be68..5ab9ad8eead 100644 --- a/htdocs/adherents/class/api_memberstypes.class.php +++ b/htdocs/adherents/class/api_memberstypes.class.php @@ -194,7 +194,7 @@ class MembersTypes extends DolibarrApi continue; } // Process the status separately because it must be updated using - // the validate() and resiliate() methods of the class AdherentType. + // the validate(), resiliate() and exclude() methods of the class AdherentType. $membertype->$field = $value; } diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 7734c8c2619..517649c4b61 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -82,6 +82,7 @@ print load_fiche_titre($langs->trans("MembersArea"), $resultboxes['selectboxlist $MembersValidated = array(); $MembersToValidate = array(); $MembersUpToDate = array(); +$MembersExcluded = array(); $MembersResiliated = array(); $AdherentType = array(); @@ -116,6 +117,9 @@ if ($result) { if ($objp->statut == 1) { $MembersValidated[$objp->rowid] = $objp->somme; } + if ($objp->statut == -2) { + $MembersExcluded[$objp->rowid] = $objp->somme; + } if ($objp->statut == 0) { $MembersResiliated[$objp->rowid] = $objp->somme; } @@ -195,9 +199,10 @@ if ($conf->use_javascript_ajax) { $SumToValidate = 0; $SumValidated = 0; - $SumUpToDate = 0; $SumResiliated = 0; + $SumExcluded = 0; + $total = 0; $dataval = array(); $i = 0; @@ -205,17 +210,21 @@ if ($conf->use_javascript_ajax) { $dataval['draft'][] = array($i, isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0); $dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0); $dataval['uptodate'][] = array($i, isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0); + $dataval['excluded'][] = array($i, isset($MembersExcluded[$key]) ? $MembersExcluded[$key] : 0); $dataval['resiliated'][] = array($i, isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0); + $SumToValidate += isset($MembersToValidate[$key]) ? $MembersToValidate[$key] : 0; $SumValidated += isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0) : 0; $SumUpToDate += isset($MembersUpToDate[$key]) ? $MembersUpToDate[$key] : 0; + $SumExcluded += isset($MembersExcluded[$key]) ? $MembersExcluded [$key] : 0; $SumResiliated += isset($MembersResiliated[$key]) ? $MembersResiliated[$key] : 0; $i++; } - $total = $SumToValidate + $SumValidated + $SumUpToDate + $SumResiliated; + $total = $SumToValidate + $SumValidated + $SumUpToDate + $SumExcluded + $SumResiliated; $dataseries = array(); $dataseries[] = array($langs->transnoentitiesnoconv("OutOfDate"), round($SumValidated)); $dataseries[] = array($langs->transnoentitiesnoconv("UpToDate"), round($SumUpToDate)); + $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusExcluded"), round($SumExcluded)); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusResiliated"), round($SumResiliated)); $dataseries[] = array($langs->transnoentitiesnoconv("MembersStatusToValid"), round($SumToValidate)); @@ -224,7 +233,7 @@ if ($conf->use_javascript_ajax) { include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); - $dolgraph->SetDataColor(array($badgeStatus1, $badgeStatus4, $badgeStatus6, '-'.$badgeStatus0)); + $dolgraph->SetDataColor(array($badgeStatus1, $badgeStatus4, $badgeStatus8, $badgeStatus6, '-'.$badgeStatus0)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); @@ -234,7 +243,7 @@ if ($conf->use_javascript_ajax) { $boxgraph .= ''; $boxgraph .= ''.$langs->trans("Total").''; - $boxgraph .= $SumToValidate + $SumValidated + $SumUpToDate + $SumResiliated; + $boxgraph .= $SumToValidate + $SumValidated + $SumUpToDate + $SumExcluded + $SumResiliated; $boxgraph .= ''; $boxgraph .= ''; $boxgraph .= ''; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index cebd634fa56..a52d551d83e 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -76,7 +76,7 @@ if ($statut != '') { $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -if ($search_status < -1) { +if ($search_status < -2) { $search_status = ''; } @@ -452,6 +452,9 @@ if (GETPOSTISSET("search_status")) { if ($search_status == '0') { $titre = $langs->trans("MembersListResiliated"); } + if ($search_status == '-2') { + $titre = $langs->trans("MembersListExcluded"); + } } elseif ($action == 'search') { $titre = $langs->trans("MembersListQualified"); } @@ -750,9 +753,10 @@ if (!empty($arrayfields['d.statut']['checked'])) { $liststatus = array( '-1'=>$langs->trans("Draft"), '1'=>$langs->trans("Validated"), - '0'=>$langs->trans("Resiliated") + '0'=>$langs->trans("Resiliated"), + '-2'=>$langs->trans("Excluded") ); - print $form->selectarray('search_status', $liststatus, $search_status, -2); + print $form->selectarray('search_status', $liststatus, $search_status, -3); print ''; } // Action column diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index f9dd77debac..8e1b9093e77 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -645,7 +645,7 @@ if ($rowid > 0) { * Action bar */ - // Button to create a new subscription if member no draft neither resiliated + // Button to create a new subscription if member no draft (-1) neither resiliated (0) neither excluded (-2) if ($user->rights->adherent->cotisation->creer) { if ($action != 'addsubscription' && $action != 'create_thirdparty') { print '
'; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 25ee4a8e39f..25c44baa7db 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -566,6 +566,8 @@ if ($rowid > 0) { $titre = $langs->trans("MembersListNotUpToDate"); } elseif ($status == '0') { $titre = $langs->trans("MembersListResiliated"); + } elseif ($status == '-2') { + $titre = $langs->trans("MembersListExcluded"); } } elseif ($action == 'search') { $titre = $langs->trans("MembersListQualified"); diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 1192034e052..e1cf115626f 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -92,7 +92,7 @@ if ($action == 'settemplates') { if ($action == 'setvalue' && $user->admin) { $db->begin(); - $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", GETPOST("email_from", "restricthtml"), 'chaine', 0, '', $conf->entity); + $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_FROM", GETPOST("email_from", "alphawithlgt"), 'chaine', 0, '', $conf->entity); if ($result < 0) { $error++; } @@ -270,7 +270,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { } $helptext = ''; - form_constantes($constantes, 2, $helptext); + form_constantes($constantes, 3, $helptext); } else { print ''; print ''; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 067c021fe75..83a6a8f3b3a 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -445,12 +445,24 @@ if ($id > 0) { // Employee if ($action != 'editfk_user') { - $morehtmlref .= '
' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1); - - if (!empty($object->fk_user)) { + if ($object->getSommePaiement() > 0 && !empty($object->fk_user)) { $userstatic = new User($db); - $userstatic->fetch($object->fk_user); - $morehtmlref .= $userstatic->getNomUrl(1); + $result = $userstatic->fetch($object->fk_user); + if ($result > 0) { + $morehtmlref .= '
' .$langs->trans('Employee').' : '.$userstatic->getNomUrl(1); + } + } else { + $morehtmlref .= '
' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $user->rights->salaries->write, 'string', '', 0, 1); + if (!empty($object->fk_user)) { + $userstatic = new User($db); + $result = $userstatic->fetch($object->fk_user); + if ($result > 0) { + $morehtmlref .= $userstatic->getNomUrl(1); + } else { + dol_print_error($db); + exit(); + } + } } } else { $morehtmlref .= '
'.$langs->trans('Employee').' : '; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 71e511397b6..35f8767aabb 100755 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -405,7 +405,7 @@ if ($action == 'create') { print ''; print "
\n"; - dol_fiche_head(); + print dol_get_fiche_head(); print '
'; @@ -512,7 +512,7 @@ if ($id) { print ''; } - dol_fiche_head($head, 'card', $langs->trans("VATPayment"), -1, 'payment'); + print dol_get_fiche_head($head, 'card', $langs->trans("VATPayment"), -1, 'payment'); $morehtmlref = '
'; // Label of social contribution diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 0eab527bc6b..56873fe5470 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -851,6 +851,10 @@ class Conf if (isset($this->projet) && !isset($this->project)) { $this->project = $this->projet; } + // member is new use, adherent is old use still initialised + if (isset($this->adherent) && !isset($this->member)) { + $this->member = $this->adherent; + } // Object $mc if (!defined('NOREQUIREMC') && !empty($this->multicompany->enabled)) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b18ed68eaa2..d75ec44798f 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2577,7 +2577,7 @@ class Form } } if ($showempty) { - $out .= ''; + $out .= ''; } $i = 0; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index faf7ecaf3d8..8f8f8e665f7 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -417,7 +417,7 @@ class FormMail extends Form $listofmimes = array(); $keytoavoidconflict = empty($this->trackid) ? '' : '-'.$this->trackid; // this->trackid must be defined - if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) { + if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelselected') && GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) { if (!empty($arraydefaultmessage->joinfiles) && is_array($this->param['fileinit'])) { foreach ($this->param['fileinit'] as $file) { $this->add_attached_files($file, basename($file), dol_mimetype($file)); diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 7edaada2f1c..445686340e8 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -124,7 +124,7 @@ class FormTicket /** * Show the form to input ticket * - * @param int $withdolfichehead With dol_fiche_head + * @param int $withdolfichehead With dol_get_fiche_head() and dol_get_fiche_end() * @param string $mode Mode ('create' or 'edit') * @return void */ diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index f442038c51d..d069bb0da23 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -346,7 +346,7 @@ class Interfaces } // We set info of modules - $triggers[$j]['picto'] = $objMod->picto ?img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "'); + $triggers[$j]['picto'] = (!empty($objMod->picto)) ? img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "'); $triggers[$j]['file'] = $files[$key]; $triggers[$j]['fullpath'] = $fullpath[$key]; $triggers[$j]['relpath'] = $relpath[$key]; @@ -377,7 +377,14 @@ class Interfaces } } } else { - print 'Error: Trigger '.$modName.' does not extends DolibarrTriggers
'; + $triggers[$j]['picto'] = (!empty($objMod->picto)) ? img_object('', $objMod->picto, 'class="valignmiddle pictomodule "') : img_object('', 'generic', 'class="valignmiddle pictomodule "'); + $triggers[$j]['file'] = $files[$key]; + $triggers[$j]['fullpath'] = $fullpath[$key]; + $triggers[$j]['relpath'] = $relpath[$key]; + $triggers[$j]['status'] = img_picto('Error: Trigger '.$modName.' does not extends DolibarrTriggers', 'warning'); + + //print 'Error: Trigger '.$modName.' does not extends DolibarrTriggers
'; + $text = 'Error: Trigger '.$modName.' does not extends DolibarrTriggers'; } } catch (Exception $e) { print $e->getMessage(); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 6715ded36fa..72de6036e8f 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1488,7 +1488,7 @@ function complete_elementList_with_modules(&$elementList) * * @param array $tableau Array of constants array('key'=>array('type'=>type, 'label'=>label) * where type can be 'string', 'text', 'textarea', 'html', 'yesno', 'emailtemplate:xxx', ... - * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all (form is output by caller, recommended) + * @param int $strictw3c 0=Include form into table (deprecated), 1=Form is outside table to respect W3C (deprecated), 2=No form nor button at all, 3=No form nor button at all and each field has a unique name (form is output by caller, recommended) * @param string $helptext Help * @return void */ @@ -1510,7 +1510,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') print '
'; print ''; - print ''; + print ''; print ''; } else { print ''; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5151a0a39dc..ab9a476c923 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -6322,7 +6322,7 @@ function dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles = 1, */ function dol_string_onlythesehtmlattributes($stringtoclean, $allowed_attributes = array("alt", "class", "contenteditable", "data-html", "href", "id", "name", "src", "style", "target", "title")) { - if (class_exists('DOMDocument')) { + if (class_exists('DOMDocument') && !empty($stringtoclean)) { $dom = new DOMDocument(); $dom->loadHTML($stringtoclean, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL); if (is_object($dom)) { diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index 93378d77390..484f34c265c 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -177,12 +177,12 @@ function member_admin_prepare_head() $h = 0; $head = array(); - $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent.php'; + $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/member.php'; $head[$h][1] = $langs->trans("Miscellaneous"); $head[$h][2] = 'general'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_emails.php'; + $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/member_emails.php'; $head[$h][1] = $langs->trans("EMails"); $head[$h][2] = 'emails'; $h++; @@ -193,12 +193,12 @@ function member_admin_prepare_head() // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'member_admin'); - $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/member_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsMember"); $head[$h][2] = 'attributes'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/adherent_type_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/member_type_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsMemberType"); $head[$h][2] = 'attributes_type'; $h++; diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index f048f070366..15710d71dfa 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -28,7 +28,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; /** - * Description and activation class for module accounting expert + * Class to describe and enable double entry accounting module */ class modAccounting extends DolibarrModules { diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 57ec76e319d..16ecbee8526 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -27,7 +27,7 @@ * \brief Module to manage members of a foundation * \file htdocs/core/modules/modAdherent.class.php * \ingroup member - * \brief File descriptor or module Member + * \brief Description and activation file for the module member */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; @@ -66,7 +66,7 @@ class modAdherent extends DolibarrModules ); // Config pages - $this->config_page_url = array("adherent.php@adherents"); + $this->config_page_url = array("member.php@adherents"); // Dependencies $this->hidden = false; // A condition to hide module diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 7dd7a801f9d..691828cd9d2 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -28,7 +28,7 @@ * \brief Module to manage agenda and events * \file htdocs/core/modules/modAgenda.class.php * \ingroup agenda - * \brief File of class to describe and enable/disable module Agenda + * \brief Description and activation file for the module agenda */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index aea29d25357..0c6ebeb6f37 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -23,7 +23,7 @@ * \brief Descriptor file for Api modulee * \file htdocs/core/modules/modApi.class.php * \ingroup api - * \brief Description and activation file for module Api + * \brief Description and activation file for the module Api */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php index 5dcb9f6637c..12b58bfcc38 100644 --- a/htdocs/core/modules/modAsset.class.php +++ b/htdocs/core/modules/modAsset.class.php @@ -22,7 +22,7 @@ * * \file htdocs/core/modules/modAsset.class.php * \ingroup asset - * \brief Description and activation file for module Assets + * \brief Description and activation file for the module assets */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 66634f4ad55..3a702007ef3 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -24,7 +24,7 @@ * \brief Module pour gerer la tenue d'un compte bancaire et rapprochements * \file htdocs/core/modules/modBanque.class.php * \ingroup banque - * \brief Fichier de description et activation du module Banque + * \brief Description and activation file for the module bank */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modBarcode.class.php b/htdocs/core/modules/modBarcode.class.php index a3e2796aed6..fab12a0ae59 100644 --- a/htdocs/core/modules/modBarcode.class.php +++ b/htdocs/core/modules/modBarcode.class.php @@ -22,8 +22,8 @@ * \defgroup barcode Module barcode * \brief Module pour gerer les codes barres * \file htdocs/core/modules/modBarcode.class.php - * \ingroup barcode,produit - * \brief Fichier de description et activation du module Barcode + * \ingroup barcode, product + * \brief Description and activation file for the module barcode */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 3f9a6473a82..16f95a5e926 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -20,7 +20,7 @@ * \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 BlockedLog + * \brief Description and activation file for the module BlockedLog */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modBom.class.php b/htdocs/core/modules/modBom.class.php index b040e4cec99..67a480dcc08 100644 --- a/htdocs/core/modules/modBom.class.php +++ b/htdocs/core/modules/modBom.class.php @@ -23,7 +23,7 @@ * * \file htdocs/core/modules/modBom.class.php * \ingroup bom - * \brief Description and activation file for module Bom + * \brief Description and activation file for the module Bom */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; @@ -286,6 +286,7 @@ class modBom extends DolibarrModules $langs->load("mrp"); $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'BomAndBomLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_permission[$r] = array(array("bom", "read")); $this->export_icon[$r] = 'bom'; $keyforclass = 'BOM'; $keyforclassfile = '/bom/class/bom.class.php'; diff --git a/htdocs/core/modules/modBookmark.class.php b/htdocs/core/modules/modBookmark.class.php index e6ac76f0178..7b8d623bc6d 100644 --- a/htdocs/core/modules/modBookmark.class.php +++ b/htdocs/core/modules/modBookmark.class.php @@ -21,7 +21,7 @@ * \brief Module to manage Bookmarks * \file htdocs/core/modules/modBookmark.class.php * \ingroup bookmark - * \brief Fichier de description et activation du module Bookmarks + * \brief Description and activation file for the module Bookmarks */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php index ca9ffa87d53..8e9ca1131b9 100644 --- a/htdocs/core/modules/modCashDesk.class.php +++ b/htdocs/core/modules/modCashDesk.class.php @@ -20,7 +20,7 @@ * \brief Module to manage points of sale * \file htdocs/core/modules/modCashDesk.class.php * \ingroup pos - * \brief File to enable/disable module Point Of Sales + * \brief Description and activation file for the module Point Of Sales */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index d1f58dd7451..990fdb44bfe 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -23,7 +23,7 @@ * \brief Module to manage categories * \file htdocs/core/modules/modCategorie.class.php * \ingroup category - * \brief Fichier de description et activation du module Categorie + * \brief Description and activation file for the module Category */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; diff --git a/htdocs/core/modules/modClickToDial.class.php b/htdocs/core/modules/modClickToDial.class.php index 80a78aba2e9..f28659bbd5d 100644 --- a/htdocs/core/modules/modClickToDial.class.php +++ b/htdocs/core/modules/modClickToDial.class.php @@ -21,7 +21,7 @@ * \brief Module pour gerer l'appel automatique * \file htdocs/core/modules/modClickToDial.class.php * \ingroup clicktodial - * \brief Fichier de description et activation du module de click to Dial + * \brief Description and activation file for the module Click to Dial */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modCollab.class.php b/htdocs/core/modules/modCollab.class.php index be82722f331..695efd6c3b1 100644 --- a/htdocs/core/modules/modCollab.class.php +++ b/htdocs/core/modules/modCollab.class.php @@ -20,7 +20,7 @@ * \brief Collab module descriptor. * \file htdocs/core/modules/modCollab.class.php * \ingroup collab - * \brief Description and activation file for module Collab + * \brief Description and activation file for the module Collab */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 6fa8b730c24..29f4dc60515 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -27,7 +27,7 @@ * \brief Module pour gerer le suivi des commandes * \file htdocs/core/modules/modCommande.class.php * \ingroup commande - * \brief Fichier de description et activation du module Commande + * \brief Description and activation file for the module command */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modComptabilite.class.php b/htdocs/core/modules/modComptabilite.class.php index 7ee9fe3c70f..09f6cd85496 100644 --- a/htdocs/core/modules/modComptabilite.class.php +++ b/htdocs/core/modules/modComptabilite.class.php @@ -23,7 +23,7 @@ * \brief Module pour inclure des fonctions de comptabilite (gestion de comptes comptables et rapports) * \file htdocs/core/modules/modComptabilite.class.php * \ingroup comptabilite - * \brief Fichier de description et activation du module Comptabilite + * \brief Description and activation file for the module simple accountancy */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index 1b927346f1e..f91e54039f4 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -22,7 +22,7 @@ * \brief Module pour gerer la tenue de contrat de services * \file htdocs/core/modules/modContrat.class.php * \ingroup contrat - * \brief Fichier de description et activation du module Contrat + * \brief Description and activation file for the module contract */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index 95a3dd2c15d..60d713d5fc4 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -21,7 +21,7 @@ * \brief cron module descriptor. * \file htdocs/core/modules/modCron.class.php * \ingroup cron - * \brief Description and activation file for module Jobs + * \brief Description and activation file for the module Jobs */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modDataPolicy.class.php b/htdocs/core/modules/modDataPolicy.class.php index 8c7cb2c4275..0e2027494e7 100644 --- a/htdocs/core/modules/modDataPolicy.class.php +++ b/htdocs/core/modules/modDataPolicy.class.php @@ -23,7 +23,7 @@ * * \file htdocs/core/modules/modDataPolicy.class.php * \ingroup datapolicy - * \brief Description and activation file for module DATAPOLICY + * \brief Description and activation file for the module datapolicy */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php index d581ce539c2..09f7d814553 100644 --- a/htdocs/core/modules/modDav.class.php +++ b/htdocs/core/modules/modDav.class.php @@ -21,7 +21,7 @@ * * \file htdocs/core/modules/modDav.class.php * \ingroup dav - * \brief Description and activation file for module dav + * \brief Description and activation file for the module dav */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modDebugBar.class.php b/htdocs/core/modules/modDebugBar.class.php index 4d38e848bbe..1b591f02da1 100644 --- a/htdocs/core/modules/modDebugBar.class.php +++ b/htdocs/core/modules/modDebugBar.class.php @@ -21,7 +21,7 @@ * * \file htdocs/core/modules/modDebugBar.class.php * \ingroup debugbar - * \brief Description and activation file for module debugbar + * \brief Description and activation file for the module debugbar */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modDeplacement.class.php b/htdocs/core/modules/modDeplacement.class.php index 860a9c8ab7e..0f92e8a7e6c 100644 --- a/htdocs/core/modules/modDeplacement.class.php +++ b/htdocs/core/modules/modDeplacement.class.php @@ -21,7 +21,7 @@ * \brief Module pour gerer les deplacements et notes de frais * \file htdocs/core/modules/modDeplacement.class.php * \ingroup deplacement - * \brief Fichier de description et activation du module Deplacement et notes de frais + * \brief Description and activation file for the module trips (deprecated) */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modDocumentGeneration.class.php b/htdocs/core/modules/modDocumentGeneration.class.php index 2c2c2ed1888..466523e7f81 100644 --- a/htdocs/core/modules/modDocumentGeneration.class.php +++ b/htdocs/core/modules/modDocumentGeneration.class.php @@ -22,7 +22,7 @@ * \brief Module pour gerer des generations de documents * \file htdocs/core/modules/modDocumentGeneration.class.php * \ingroup document - * \brief Fichier de description et activation du module Generation document + * \brief Description and activation file for the module Generation document */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index 64d9c045ad1..7d8a8fc9455 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -23,7 +23,7 @@ * \brief Module to manage the follow-up of the donations * \file htdocs/core/modules/modDon.class.php * \ingroup donations - * \brief Description and activation file for module Donation + * \brief Description and activation file for the module Donation */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modDynamicPrices.class.php b/htdocs/core/modules/modDynamicPrices.class.php index fc4863e1280..23a0f892014 100644 --- a/htdocs/core/modules/modDynamicPrices.class.php +++ b/htdocs/core/modules/modDynamicPrices.class.php @@ -20,7 +20,7 @@ * \brief Module to manage dynamic prices in products * \file htdocs/core/modules/modDynamicPrices.class.php * \ingroup produit - * \brief File to describe module to manage dynamic prices in products + * \brief Description and activation file for the module to manage dynamic prices in products */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index 222e50c76e0..8b846089a03 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -20,7 +20,7 @@ * \brief Module for ECM (Electronic Content Management) * \file htdocs/core/modules/modECM.class.php * \ingroup ecm - * \brief Description and activation file for module ECM + * \brief Description and activation file for the module ECM */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index bb76d2f0c1e..53223ecd705 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -21,7 +21,7 @@ * * \file htdocs/core/modules/modEmailCollector.class.php * \ingroup emailcollector - * \brief Description and activation file for module emailcollector + * \brief Description and activation file for the module emailcollector */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modEventOrganization.class.php b/htdocs/core/modules/modEventOrganization.class.php index 4f25993d9a1..386da21d798 100644 --- a/htdocs/core/modules/modEventOrganization.class.php +++ b/htdocs/core/modules/modEventOrganization.class.php @@ -21,7 +21,7 @@ * * \file htdocs/eventorganization/core/modules/modEventOrganization.class.php * \ingroup eventorganization - * \brief Description and activation file for module EventOrganization + * \brief Description and activation file for the EventOrganization */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index b4bac22fd1a..ba8568ba13e 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -24,7 +24,7 @@ * \brief Module pour gerer les expeditions de produits * \file htdocs/core/modules/modExpedition.class.php * \ingroup expedition - * \brief Fichier de description et activation du module Expedition + * \brief Description and activation file for the module Expedition */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index dca32b4fad7..f727247a831 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -21,7 +21,7 @@ * \brief Module to manage expense report. Replace old module Deplacement. * \file htdocs/core/modules/modExpenseReport.class.php * \ingroup expensereport - * \brief Description and activation file for module ExpenseReport + * \brief Description and activation file for the module ExpenseReport */ include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php"; diff --git a/htdocs/core/modules/modExport.class.php b/htdocs/core/modules/modExport.class.php index 037283b1715..6a47b7b74fd 100644 --- a/htdocs/core/modules/modExport.class.php +++ b/htdocs/core/modules/modExport.class.php @@ -21,7 +21,7 @@ * \brief Module generique pour realiser des exports de donnees en base * \file htdocs/core/modules/modExport.class.php * \ingroup export - * \brief Fichier de description et activation du module export + * \brief Description and activation file for the module export */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modExternalRss.class.php b/htdocs/core/modules/modExternalRss.class.php index 241207998aa..6ca023a65a8 100644 --- a/htdocs/core/modules/modExternalRss.class.php +++ b/htdocs/core/modules/modExternalRss.class.php @@ -21,7 +21,7 @@ * \brief Module pour inclure des informations externes RSS * \file htdocs/core/modules/modExternalRss.class.php * \ingroup externalrss - * \brief Fichier de description et activation du module externalrss + * \brief Description and activation file for the module externalrss */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modExternalSite.class.php b/htdocs/core/modules/modExternalSite.class.php index 42c60067aa8..a996a55ddaa 100644 --- a/htdocs/core/modules/modExternalSite.class.php +++ b/htdocs/core/modules/modExternalSite.class.php @@ -22,7 +22,7 @@ * \brief Module to include an external web site/tools into Dolibarr menu and into a frame page. * \file htdocs/core/modules/modExternalSite.class.php * \ingroup externalsite - * \brief Description and activation file for module ExternalSite + * \brief Description and activation file for the module ExternalSite */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modFTP.class.php b/htdocs/core/modules/modFTP.class.php index 52944961379..3e2ccd7d049 100644 --- a/htdocs/core/modules/modFTP.class.php +++ b/htdocs/core/modules/modFTP.class.php @@ -21,7 +21,7 @@ * \brief Module for FTP client module * \file htdocs/core/modules/modFTP.class.php * \ingroup ftp - * \brief Description and activation file for module FTP + * \brief Description and activation file for the module FTP */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index eed92413c8a..efa3aeea536 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -20,11 +20,11 @@ */ /** - * \defgroup facture Module invoices - * \brief Module pour gerer les factures clients et/ou fournisseurs + * \defgroup facture Module customer invoices + * \brief Module to manage customer invoices * \file htdocs/core/modules/modFacture.class.php * \ingroup facture - * \brief Fichier de la classe de description et activation du module Facture + * \brief Description and activation file for the module customer invoices */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modFckeditor.class.php b/htdocs/core/modules/modFckeditor.class.php index f93e08c1872..7742051989e 100644 --- a/htdocs/core/modules/modFckeditor.class.php +++ b/htdocs/core/modules/modFckeditor.class.php @@ -22,7 +22,7 @@ * \brief Module pour mettre en page les zones de saisie de texte * \file htdocs/core/modules/modFckeditor.class.php * \ingroup fckeditor - * \brief Fichier de description et activation du module Fckeditor + * \brief Description and activation file for the module Fckeditor */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modFicheinter.class.php b/htdocs/core/modules/modFicheinter.class.php index 9364b75d9f7..af99e6f646f 100644 --- a/htdocs/core/modules/modFicheinter.class.php +++ b/htdocs/core/modules/modFicheinter.class.php @@ -25,7 +25,7 @@ * \brief Module to manage intervention cards * \file htdocs/core/modules/modFicheinter.class.php * \ingroup ficheinter - * \brief Fichier de description et activation du module Ficheinter + * \brief Description and activation file for the module Ficheinter */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 040bcfbd5bd..46d6dd7bead 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -24,7 +24,7 @@ * \defgroup fournisseur Module suppliers * \file htdocs/core/modules/modFournisseur.class.php * \ingroup fournisseur - * \brief Description and activation file for module Supplier + * \brief Description and activation file for the module Supplier */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modGeoIPMaxmind.class.php b/htdocs/core/modules/modGeoIPMaxmind.class.php index 06438eefab8..41c3d8517d8 100644 --- a/htdocs/core/modules/modGeoIPMaxmind.class.php +++ b/htdocs/core/modules/modGeoIPMaxmind.class.php @@ -20,7 +20,7 @@ * \brief Module to make geoip conversions * \file htdocs/core/modules/modGeoIPMaxmind.class.php * \ingroup geoip - * \brief File of geoipmaxmind module descriptor + * \brief Description and activation file for the module geoipmaxmind */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index a7d8899b0c2..74ad1566e82 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -21,7 +21,7 @@ * \brief Module to use Gravatar to show photo of users * \file htdocs/core/modules/modGravatar.class.php * \ingroup gravatar - * \brief Description and activation file for module Gravatar + * \brief Description and activation file for the module Gravatar */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index edaa872a369..25f04726fd6 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -18,7 +18,7 @@ /** * \file htdocs/core/modules/modHRM.class.php * \ingroup HRM - * \brief Description and activation file for module HRM + * \brief Description and activation file for the module HRM */ include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php"; diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 3fa92d8a7c5..8f40e698dcb 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -26,7 +26,7 @@ * \brief Module de gestion des congés * \file htdocs/core/modules/modHoliday.class.php * \ingroup holiday - * \brief Description and activation file for module holiday + * \brief Description and activation file for the module holiday */ include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php"; diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php index d2a636e2ca6..b70806af82a 100644 --- a/htdocs/core/modules/modImport.class.php +++ b/htdocs/core/modules/modImport.class.php @@ -21,7 +21,7 @@ * \brief Module to make generic import of data into dolibarr database * \file htdocs/core/modules/modImport.class.php * \ingroup import - * \brief Fichier de description et activation du module Import + * \brief Description and activation file for the module Import */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modIncoterm.class.php b/htdocs/core/modules/modIncoterm.class.php index c73eab77c7d..a7a260dba6e 100644 --- a/htdocs/core/modules/modIncoterm.class.php +++ b/htdocs/core/modules/modIncoterm.class.php @@ -22,7 +22,7 @@ * * \file htdocs/core/modules/modIncoterm.class.php * \ingroup incoterm - * \brief Description and activation file for module MyModule + * \brief Description and activation file for the module MyModule */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modIntracommreport.class.php b/htdocs/core/modules/modIntracommreport.class.php index 36a4ced8380..077f51ab519 100644 --- a/htdocs/core/modules/modIntracommreport.class.php +++ b/htdocs/core/modules/modIntracommreport.class.php @@ -21,7 +21,7 @@ /** * \file htdocs/core/modules/modIntracommreport.class.php * \ingroup Intracomm report - * \brief Module to activate intracomm report module + * \brief Description and activation file for the module intracomm report */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modLabel.class.php b/htdocs/core/modules/modLabel.class.php index 58e735666ab..8c8756c60c7 100644 --- a/htdocs/core/modules/modLabel.class.php +++ b/htdocs/core/modules/modLabel.class.php @@ -21,7 +21,7 @@ * \brief Module pour gerer les formats d'impression des etiquettes * \file htdocs/core/modules/modLabel.class.php * \ingroup other - * \brief Fichier de description et activation du module Label + * \brief Description and activation file for the module Labels */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modLdap.class.php b/htdocs/core/modules/modLdap.class.php index 8e3463ff4d4..0774f71a583 100644 --- a/htdocs/core/modules/modLdap.class.php +++ b/htdocs/core/modules/modLdap.class.php @@ -22,7 +22,7 @@ * \brief Module to manage LDAP interfaces with contacts or users * \file htdocs/core/modules/modLdap.class.php * \ingroup ldap - * \brief File to describe and activate Ldap module + * \brief Description and activation file for the module LDAP */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php index d45987e840d..30aa547cb3a 100644 --- a/htdocs/core/modules/modLoan.class.php +++ b/htdocs/core/modules/modLoan.class.php @@ -21,7 +21,7 @@ * \brief Module to include loans management * \file htdocs/core/modules/modLoan.class.php * \ingroup loan - * \brief File to activate module loan + * \brief Description and activation file for the module loan */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php index 1db638e782f..9d590631fe4 100644 --- a/htdocs/core/modules/modMailing.class.php +++ b/htdocs/core/modules/modMailing.class.php @@ -22,7 +22,7 @@ * \brief Module to manage EMailings * \file htdocs/core/modules/modMailing.class.php * \ingroup mailing - * \brief Fichier de description et activation du module Mailing + * \brief Description and activation file for the module Mailing */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modMailmanSpip.class.php b/htdocs/core/modules/modMailmanSpip.class.php index bfd2e25493a..2a8d97484e7 100644 --- a/htdocs/core/modules/modMailmanSpip.class.php +++ b/htdocs/core/modules/modMailmanSpip.class.php @@ -21,7 +21,7 @@ * \brief Module to manage mailman and spip * \file htdocs/core/modules/modMailmanSpip.class.php * \ingroup mailmanspip - * \brief Fichier de description et activation du module de click to Dial + * \brief Description and activation file for the module mailmanspip */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 185a86a86aa..cb7b4d5e602 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -20,7 +20,7 @@ * \brief Module to manage margins * \file htdocs/core/modules/modMargin.class.php * \ingroup margin - * \brief Description and activation file for module Margin + * \brief Description and activation file for the module Margin */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modModuleBuilder.class.php b/htdocs/core/modules/modModuleBuilder.class.php index 6060186a746..99c32e48bbd 100644 --- a/htdocs/core/modules/modModuleBuilder.class.php +++ b/htdocs/core/modules/modModuleBuilder.class.php @@ -21,7 +21,7 @@ * \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 + * \brief Description and activation file for the module ModuleBuilder */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modMrp.class.php b/htdocs/core/modules/modMrp.class.php index c073476efcb..0a4a7592a20 100644 --- a/htdocs/core/modules/modMrp.class.php +++ b/htdocs/core/modules/modMrp.class.php @@ -24,7 +24,7 @@ * * \file htdocs/core/modules/modMrp.class.php * \ingroup mrp - * \brief Description and activation file for module Mrp + * \brief Description and activation file for the module Mrp */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index f281c99dc37..6b05fe068aa 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -23,7 +23,7 @@ * \brief Handle multiple currencies on company/propal/orders ... * \file htdocs/core/modules/modMultiCurrency.class.php * \ingroup multicurrency - * \brief Description and activation file for module MultiCurrency + * \brief Description and activation file for the module MultiCurrency */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modNotification.class.php b/htdocs/core/modules/modNotification.class.php index f9191ce3c8d..e124b8304f3 100644 --- a/htdocs/core/modules/modNotification.class.php +++ b/htdocs/core/modules/modNotification.class.php @@ -21,7 +21,7 @@ * \brief Module pour gerer les notifications (par mail ou autre) * \file htdocs/core/modules/modNotification.class.php * \ingroup notification - * \brief Fichier de description et activation du module Notification + * \brief Description and activation file for the module Notification */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index 1faf3455129..f66ba404c7e 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -23,7 +23,7 @@ /** * \file htdocs/core/modules/modOauth.class.php * \ingroup oauth - * \brief File of class to describe and activate module Oauth + * \brief Description and activation file for the module Oauth */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 2c01672ac42..87a4f453801 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -21,7 +21,7 @@ * \brief Module to OpenSurvey integration. * \file htdocs/core/modules/modOpenSurvey.class.php * \ingroup opensurvey - * \brief Description and activation file for module OpenSurvey + * \brief Description and activation file for the module OpenSurvey */ include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php"; diff --git a/htdocs/core/modules/modPaybox.class.php b/htdocs/core/modules/modPaybox.class.php index 1dfe76f471a..3da6ddfb695 100644 --- a/htdocs/core/modules/modPaybox.class.php +++ b/htdocs/core/modules/modPaybox.class.php @@ -21,7 +21,7 @@ * \brief Add integration with Paybox online payment system. * \file htdocs/core/modules/modPaybox.class.php * \ingroup paybox - * \brief Description and activation file for module Paybox + * \brief Description and activation file for the module Paybox */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modPaymentByBankTransfer.class.php b/htdocs/core/modules/modPaymentByBankTransfer.class.php index 5704badf854..6b51e25cdc2 100644 --- a/htdocs/core/modules/modPaymentByBankTransfer.class.php +++ b/htdocs/core/modules/modPaymentByBankTransfer.class.php @@ -23,7 +23,7 @@ * \brief Module to manage payment by bank transfer * \file htdocs/core/modules/modPaymentByBankTransfer.class.php * \ingroup paymentbybanktransfer - * \brief File to describe and activate the module PaymentByBankTransfer + * \brief Description and activation file for the module PaymentByBankTransfer */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modPaypal.class.php b/htdocs/core/modules/modPaypal.class.php index 82490dc0c4b..0ebb577e48b 100644 --- a/htdocs/core/modules/modPaypal.class.php +++ b/htdocs/core/modules/modPaypal.class.php @@ -22,7 +22,7 @@ * \brief Add integration with Paypal online payment system. * \file htdocs/core/modules/modPaypal.class.php * \ingroup paypal - * \brief Description and activation file for module Paypal + * \brief Description and activation file for the module Paypal */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modPrelevement.class.php b/htdocs/core/modules/modPrelevement.class.php index 4bee933376f..8d68b372e91 100644 --- a/htdocs/core/modules/modPrelevement.class.php +++ b/htdocs/core/modules/modPrelevement.class.php @@ -23,7 +23,7 @@ * \brief Module to manage Direct debit orders * \file htdocs/core/modules/modPrelevement.class.php * \ingroup prelevement - * \brief File to describe and enable the module Prelevement + * \brief Description and activation file for the module Prelevement */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php index 373ca131d2b..4c104b30ecf 100644 --- a/htdocs/core/modules/modPrinting.class.php +++ b/htdocs/core/modules/modPrinting.class.php @@ -23,7 +23,7 @@ /** * \file htdocs/core/modules/modPrinting.class.php * \ingroup printing - * \brief File of class to describe and activate module Direct Printing + * \brief Description and activation file for the module Direct Printing */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 2bd42d64e11..2599f2f19fb 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -28,7 +28,7 @@ * \brief Module to manage catalog of predefined products * \file htdocs/core/modules/modProduct.class.php * \ingroup produit - * \brief File to describe module to manage catalog of predefined products + * \brief Description and activation file for the module to manage catalog of predefined products */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index 3da2523ad40..166b8f6e637 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -23,7 +23,7 @@ * \brief Management module for batch number, eat-by and sell-by date for product * \file htdocs/core/modules/modProductBatch.class.php * \ingroup productbatch - * \brief Description and activation file for module productbatch + * \brief Description and activation file for the module productbatch */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index ff135a74d1d..25448f239e6 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -26,7 +26,7 @@ * \brief Module to create projects/tasks/gantt diagram. Projects can them be affected to tasks. * \file htdocs/core/modules/modProjet.class.php * \ingroup projet - * \brief Fichier de description et activation du module Projet + * \brief Description and activation file for the module project */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index a1f52bbd906..687d8ea3669 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -26,7 +26,7 @@ * \brief Module pour gerer la tenue de propositions commerciales * \file htdocs/core/modules/modPropale.class.php * \ingroup propale - * \brief Fichier de description et activation du module Propale + * \brief Description and activation file for the module customer proposal */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index fe95a89d9ce..4fe437700e4 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -23,7 +23,7 @@ /** * \file htdocs/core/modules/modReceiptPrinter.class.php * \ingroup printing - * \brief File of class to describe and activate module Receipt Printer + * \brief Description and activation file for the module Receipt Printer */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modReception.class.php b/htdocs/core/modules/modReception.class.php index 17f765d2caf..247a4faeddc 100644 --- a/htdocs/core/modules/modReception.class.php +++ b/htdocs/core/modules/modReception.class.php @@ -20,7 +20,7 @@ * \brief Module pour gerer les réceptions de produits * \file htdocs/core/modules/modReception.class.php * \ingroup reception - * \brief Fichier de description et activation du module Reception + * \brief Description and activation file for the module Reception */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modRecruitment.class.php b/htdocs/core/modules/modRecruitment.class.php index 2a3d36c46bb..f7cd37c16be 100644 --- a/htdocs/core/modules/modRecruitment.class.php +++ b/htdocs/core/modules/modRecruitment.class.php @@ -23,7 +23,7 @@ * * \file htdocs/recruitment/core/modules/modRecruitment.class.php * \ingroup recruitment - * \brief Description and activation file for module Recruitment + * \brief Description and activation file for the module Recruitment */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index ee3836cde26..6f2d3f8d409 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -23,7 +23,7 @@ * \brief Resource module descriptor. * \file core/modules/modResource.class.php * \ingroup resource - * \brief Description and activation file for module Resource + * \brief Description and activation file for the module Resource */ include_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php"; diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 131b0f2945f..759804b409e 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -27,7 +27,7 @@ * \brief Module to include salaries management * \file htdocs/core/modules/modSalaries.class.php * \ingroup salaries - * \brief File to activate module salaries + * \brief Description and activation file for the module salaries */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 6009af638fb..13ff4618483 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -25,7 +25,7 @@ * \brief Module pour gerer le suivi de services predefinis * \file htdocs/core/modules/modService.class.php * \ingroup service - * \brief Fichier de description et activation du module Service + * \brief Description and activation file for the module Service */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modSocialNetworks.class.php b/htdocs/core/modules/modSocialNetworks.class.php index 368634083ee..3949de6c691 100644 --- a/htdocs/core/modules/modSocialNetworks.class.php +++ b/htdocs/core/modules/modSocialNetworks.class.php @@ -21,7 +21,7 @@ * \brief Add a SocialNetworks button. * \file htdocs/core/modules/modSocialNetworks.class.php * \ingroup socialnetworks - * \brief Description and activation file for module SocialNetworks + * \brief Description and activation file for the module SocialNetworks */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 9151673f996..38ca03ffe3b 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -25,7 +25,7 @@ * \brief Module to manage third parties (customers, prospects) * \file htdocs/core/modules/modSociete.class.php * \ingroup societe - * \brief Fichier de description et activation du module Societe + * \brief Description and activation file for the module societe (thirdparty) */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index ffa80d9a748..3d46d606265 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -23,7 +23,7 @@ * \brief Module pour gerer la tenue de stocks produits * \file htdocs/core/modules/modStock.class.php * \ingroup stock - * \brief Fichier de description et activation du module Stock + * \brief Description and activation file for the module Stock */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modStripe.class.php b/htdocs/core/modules/modStripe.class.php index 2cf80fc9f60..2677d3e3fa3 100644 --- a/htdocs/core/modules/modStripe.class.php +++ b/htdocs/core/modules/modStripe.class.php @@ -21,7 +21,7 @@ * \brief Add integration with Stripe online payment system. * \file htdocs/core/modules/modStripe.class.php * \ingroup stripe - * \brief Description and activation file for module Stripe + * \brief Description and activation file for the module Stripe */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index d86e06629f3..4a0fc21fa44 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -26,7 +26,7 @@ * * \file htdocs/core/modules/modSupplierProposal.class.php * \ingroup supplier_proposal - * \brief File to describe and activate module SupplierProposal + * \brief Description and activation file for the module supplier proposal */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modSyslog.class.php b/htdocs/core/modules/modSyslog.class.php index d003108726e..1d85dc2115d 100644 --- a/htdocs/core/modules/modSyslog.class.php +++ b/htdocs/core/modules/modSyslog.class.php @@ -21,7 +21,7 @@ * \brief Module pour gerer les messages d'erreur dans syslog * \file htdocs/core/modules/modSyslog.class.php * \ingroup syslog - * \brief Fichier de description et activation du module de syslog + * \brief Description and activation file for the module syslog */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modTakePos.class.php b/htdocs/core/modules/modTakePos.class.php index b4fbb1f2e97..d34213f062c 100644 --- a/htdocs/core/modules/modTakePos.class.php +++ b/htdocs/core/modules/modTakePos.class.php @@ -22,7 +22,7 @@ * * \file htdocs/core/modules/modTakePos.class.php * \ingroup takepos - * \brief Description and activation file for module TakePos + * \brief Description and activation file for the module TakePos */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modTax.class.php b/htdocs/core/modules/modTax.class.php index bf064d743f8..222b1c775c1 100644 --- a/htdocs/core/modules/modTax.class.php +++ b/htdocs/core/modules/modTax.class.php @@ -25,7 +25,7 @@ * \brief Module pour inclure des fonctions de saisies des taxes (tva) et charges sociales * \file htdocs/core/modules/modTax.class.php * \ingroup tax - * \brief Fichier de description et activation du module Taxe + * \brief Description and activation file for the module taxes */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modTicket.class.php b/htdocs/core/modules/modTicket.class.php index e186f5fdc1c..a1318266334 100644 --- a/htdocs/core/modules/modTicket.class.php +++ b/htdocs/core/modules/modTicket.class.php @@ -22,7 +22,7 @@ * \brief Module for ticket and request management. * \file core/modules/modTicket.class.php * \ingroup ticket - * \brief Description and activation file for module Ticket + * \brief Description and activation file for the module Ticket */ require_once DOL_DOCUMENT_ROOT."/core/modules/DolibarrModules.class.php"; diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 4c1a6bcfded..e84998635ff 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -22,7 +22,7 @@ * \brief Module pour gerer les utilisateurs * \file htdocs/core/modules/modUser.class.php * \ingroup user - * \brief Fichier de description et activation du module Utilisateur + * \brief Description and activation file for the module users */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modVariants.class.php b/htdocs/core/modules/modVariants.class.php index 22953321fbe..a6c88afc03d 100644 --- a/htdocs/core/modules/modVariants.class.php +++ b/htdocs/core/modules/modVariants.class.php @@ -24,6 +24,7 @@ * \brief Module to manage product combinations based on product attributes * \file htdocs/core/modules/modVariants.class.php * \ingroup produit + * \brief Description and activation file for the module product variants */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modWebServices.class.php b/htdocs/core/modules/modWebServices.class.php index a6362a175cc..a88db3dee26 100644 --- a/htdocs/core/modules/modWebServices.class.php +++ b/htdocs/core/modules/modWebServices.class.php @@ -20,7 +20,7 @@ * \brief Module to enable the Dolibarr server of web services * \file htdocs/core/modules/modWebServices.class.php * \ingroup webservices - * \brief File to describe webservices module + * \brief Description and activation file for the module webservices */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modWebServicesClient.class.php b/htdocs/core/modules/modWebServicesClient.class.php index b59e6cb9e13..d44d48ef13a 100644 --- a/htdocs/core/modules/modWebServicesClient.class.php +++ b/htdocs/core/modules/modWebServicesClient.class.php @@ -20,7 +20,7 @@ * \brief Module to enable client for supplier WebServices * \file htdocs/core/modules/modWebServicesClient.class.php * \ingroup webservices - * \brief File to describe client for supplier webservices module + * \brief Description and activation file for the module supplier webservices module */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php index f16a29728be..c4abadcd870 100644 --- a/htdocs/core/modules/modWebsite.class.php +++ b/htdocs/core/modules/modWebsite.class.php @@ -20,7 +20,7 @@ * \brief website module descriptor. * \file htdocs/core/modules/modWebsite.class.php * \ingroup websites - * \brief Description and activation file for module Website + * \brief Description and activation file for the module Website */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; @@ -109,6 +109,12 @@ class modWebsite extends DolibarrModules $this->rights[$r][4] = 'delete'; $r++; + $this->rights[$r][0] = 10008; + $this->rights[$r][1] = 'Export website content'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'export'; + $r++; + // Main menu entries $r = 0; $this->menu[$r] = array('fk_menu'=>'0', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode @@ -130,6 +136,7 @@ class modWebsite extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = 'MyWebsitePages'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_permission[$r] = array(array("website", "export")); $this->export_icon[$r] = 'globe'; $keyforclass = 'WebsitePage'; $keyforclassfile = '/website/class/websitepage.class.php'; diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index 539fd7a76d2..fbf7927ed1c 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -21,7 +21,7 @@ * \brief Workflow management * \file htdocs/core/modules/modWorkflow.class.php * \ingroup workflow - * \brief File to describe and activate module Workflow + * \brief Description and activation file for the module Workflow */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modWorkstation.class.php b/htdocs/core/modules/modWorkstation.class.php index ade029b1233..02f5e059297 100755 --- a/htdocs/core/modules/modWorkstation.class.php +++ b/htdocs/core/modules/modWorkstation.class.php @@ -24,7 +24,7 @@ * * \file htdocs/workstation/core/modules/modWorkstation.class.php * \ingroup workstation - * \brief Description and activation file for module Workstation + * \brief Description and activation file for the module Workstation */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; diff --git a/htdocs/core/modules/modZapier.class.php b/htdocs/core/modules/modZapier.class.php index 697fa489443..5685a30c701 100644 --- a/htdocs/core/modules/modZapier.class.php +++ b/htdocs/core/modules/modZapier.class.php @@ -21,7 +21,7 @@ * * \file htdocs/core/modules/modZapier.class.php * \ingroup zapier - * \brief Description and activation file for module Zapier + * \brief Description and activation file for the module Zapier */ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php'; @@ -110,7 +110,7 @@ class modZapier extends DolibarrModules $this->dirs = array("/zapier/temp"); // Config pages. Put here list of php page, stored into zapier/admin directory, to use to setup module. $this->config_page_url = array( - // "setup.php@zapier" + "setup.php@zapier" ); // Dependencies // A condition to hide module @@ -269,53 +269,6 @@ class modZapier extends DolibarrModules // Main menu entries $this->menu = array(); // List of menus to add $r = 0; - - // Add here entries to declare new menus - // $this->menu[$r++]=array( - // 'fk_menu' => '', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - // 'type' => 'top', // This is a Top menu entry - // 'titre' => 'Zapier', - // 'mainmenu' => 'zapier', - // 'leftmenu' => '', - // 'url' => '/zapier/zapierindex.php', - // 'langs' => 'zapier@zapier', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - // 'position' => 1000+$r, - // 'enabled' => '$conf->zapier->enabled', // Define condition to show or hide menu entry. Use '$conf->zapier->enabled' if entry must be visible if module is enabled. - // 'perms' => '1', // Use 'perms'=>'$user->rights->zapier->level1->level2' if you want your menu with a permission rules - // 'target' => '', - // 'user' => 2, // 0=Menu for internal users, 1=external users, 2=both - // ); - - /* - $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=zapier', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry - 'titre'=>'List MyObject', - 'mainmenu'=>'zapier', - 'leftmenu'=>'zapier_myobject_list', - 'url'=>'/zapier/myobject_list.php', - 'langs'=>'zapier@zapier', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1000+$r, - 'enabled'=>'$conf->zapier->enabled', // Define condition to show or hide menu entry. Use '$conf->zapier->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'1', // Use 'perms'=>'$user->rights->zapier->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - ); - $this->menu[$r++]=array( - 'fk_menu'=>'fk_mainmenu=zapier,fk_leftmenu=zapier', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry - 'titre'=>'New MyObject', - 'mainmenu'=>'zapier', - 'leftmenu'=>'zapier_myobject_new', - 'url'=>'/zapier/myobject_page.php?action=create', - 'langs'=>'zapier@zapier', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1000+$r, - 'enabled'=>'$conf->zapier->enabled', // Define condition to show or hide menu entry. Use '$conf->zapier->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'1', // Use 'perms'=>'$user->rights->zapier->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2, // 0=Menu for internal users, 1=external users, 2=both - ); - */ } /** diff --git a/htdocs/core/tpl/admin_extrafields_add.tpl.php b/htdocs/core/tpl/admin_extrafields_add.tpl.php index b0ab3e5bb76..ddcdfdf9e4b 100644 --- a/htdocs/core/tpl/admin_extrafields_add.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_add.tpl.php @@ -145,7 +145,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con
'.$langs->trans("Description").''.$langs->trans("Description").''; $text = $langs->trans("Value"); print $form->textwithpicto($text, $helptext, 1, 'help', '', 0, 2, 'idhelptext'); @@ -1614,24 +1614,24 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') foreach (array_keys($_Avery_Labels) as $codecards) { $arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name']; } - print $form->selectarray('constvalue'.(empty($strictw3c) ? '' : '[]'), $arrayoflabels, ($obj->value ? $obj->value : 'CARD'), 1, 0, 0); + print $form->selectarray('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $arrayoflabels, ($obj->value ? $obj->value : 'CARD'), 1, 0, 0); print ''; print ''; print ''; - print ''; - print ''; + print ''; + print ''; if ($obj->type == 'textarea' || in_array($const, array('ADHERENT_CARD_TEXT', 'ADHERENT_CARD_TEXT_RIGHT', 'ADHERENT_ETIQUETTE_TEXT'))) { - print '\n"; } elseif ($obj->type == 'html') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('constvalue_'.$const.(empty($strictw3c) ? '' : '[]'), $obj->value, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%'); $doleditor->Create(); } elseif ($obj->type == 'yesno') { - print $form->selectyesno('constvalue'.(empty($strictw3c) ? '' : '[]'), $obj->value, 1); + print $form->selectyesno('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $obj->value, 1); } elseif (preg_match('/emailtemplate/', $obj->type)) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); @@ -1654,10 +1654,9 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '') } //var_dump($arraydefaultmessage); //var_dump($arrayofmessagename); - print $form->selectarray('constvalue_'.$obj->name, $arrayofmessagename, $obj->value.':'.$tmp[1], 'None', 0, 0, '', 0, 0, 0, '', '', 1); - } else // type = 'string' ou 'chaine' - { - print ''; + print $form->selectarray('constvalue'.(empty($strictw3c) ? '' : ($strictw3c == 3 ? '_'.$const : '[]')), $arrayofmessagename, $obj->value.':'.$tmp[1], 'None', 0, 0, '', 0, 0, 0, '', '', 1); + } else { // type = 'string' ou 'chaine' + print ''; } print '
- + @@ -205,7 +205,7 @@ $listofexamplesforlink = 'Societe:societe/class/societe.class.php
Contact:con -multicompany->enabled)) { ?> +multicompany->enabled)) { ?> diff --git a/htdocs/core/tpl/admin_extrafields_edit.tpl.php b/htdocs/core/tpl/admin_extrafields_edit.tpl.php index 73721d4c0c4..c055dd1d3b5 100644 --- a/htdocs/core/tpl/admin_extrafields_edit.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_edit.tpl.php @@ -181,7 +181,7 @@ if ((($type == 'select') || ($type == 'checkbox') || ($type == 'radio')) && is_a } ?> - + @@ -295,7 +295,7 @@ if (in_array($type, array_keys($typewecanchangeinto))) { -multicompany->enabled)) { ?> +multicompany->enabled)) { ?> diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 82b5db4f74b..c4a21812b01 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -65,8 +65,8 @@ print ''; print ''; print ''; print ''; -if (empty($conf->multicompany->enabled)) { - print ''; +if (!empty($conf->multicompany->enabled)) { + print ''; } print ''; print "\n"; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index f46891b6847..7e10b5b5f1f 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -126,6 +126,12 @@ $permissiondellink = $user->rights->expedition->delivery->creer; // Used by the $date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int')); +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'expedition', $object->id, ''); + /* * Actions diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index a096b2155ce..174b97b4a7e 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -41,12 +41,6 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'expedition', $id, ''); - $object = new Expedition($db); if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); @@ -69,6 +63,12 @@ if ($id > 0 || !empty($ref)) { } } +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'expedition', $object->id, ''); + /* * Actions diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 836b469cb77..faff2a8d0a0 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -45,12 +45,6 @@ $confirm = GETPOST('confirm'); $id = GETPOST('id', 'int'); $ref = GETPOST('ref'); -// Security check -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, 'expedition', $id, ''); - // Get parameters $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -71,14 +65,21 @@ if (!$sortfield) { $object = new Expedition($db); +if ($object->fetch($id, $ref)) { + $object->fetch_thirdparty(); + $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref); +} + +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'expedition', $object->id, ''); + /* * Actions */ -if ($object->fetch($id)) { - $object->fetch_thirdparty(); - $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref); -} include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index c8209910b48..db28e409309 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -39,13 +39,6 @@ $id = (GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); -// Security check -$socid = ''; -if ($user->socid) { - $socid = $user->socid; -} -$result = restrictedArea($user, $origin, $origin_id); - $object = new Expedition($db); if ($id > 0 || !empty($ref)) { $object->fetch($id, $ref); @@ -66,10 +59,18 @@ if ($id > 0 || !empty($ref)) { $objectsrc = new Propal($db); $objectsrc->fetch($object->$typeobject->id); } + + $upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref); } $permissionnote = $user->rights->expedition->creer; // Used by the include of actions_setnotes.inc.php +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'expedition', $object->id, ''); + /* * Actions diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 66efd5c4ca7..809b4803ff5 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -73,6 +73,11 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once +// Security check +if ($user->socid) { + $socid = $user->socid; +} +$result = restrictedArea($user, 'expedition', $object->id, ''); diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index 151edbdba2b..6bdc495472c 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -39,7 +39,7 @@ if ($user->socid > 0) { $socid = $user->socid; } -$nowyear = strftime("%Y", dol_now()); +$nowyear = dol_print_date(dol_now(), "%Y"); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; //$startyear=$year-2; $startyear = $year - 1; @@ -48,6 +48,12 @@ $endyear = $year; // Load translation files required by the page $langs->loadLangs(array('sendings', 'other', 'companies')); +// Security check +if ($user->socid) { + $socid = $user->socid; +} +restrictedArea($user, 'expedition'); + /* * View diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php index 74455d7dca2..254fd9aad90 100644 --- a/htdocs/expedition/stats/month.php +++ b/htdocs/expedition/stats/month.php @@ -29,6 +29,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $year = GETPOST('year', 'int'); +// Security check +if ($user->socid) { + $socid = $user->socid; +} +restrictedArea($user, 'expedition'); + /* * View diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index dc23a8ab362..b3d0cf49a32 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -154,6 +154,9 @@ $upload_dir = $conf->export->dir_temp.'/'.$user->id; //$usefilters=($conf->global->MAIN_FEATURES_LEVEL > 1); $usefilters = 1; +// Security check +$result = restrictedArea($user, 'export'); + /* * Actions @@ -449,7 +452,7 @@ if ($step == 1 || !$datatoexport) { if ($objexport->array_export_perms[$key]) { print ''.img_picto($langs->trans("NewExport"), 'next', 'class="fa-15x"').''; } else { - print $langs->trans("NotEnoughPermissions"); + print ''.$langs->trans("NotEnoughPermissions").''; } print ''; } diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index 22b1729550d..3ba5e0a3591 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -27,11 +27,12 @@ require_once DOL_DOCUMENT_ROOT.'/exports/class/export.class.php'; // Load translation files required by the page $langs->load("exports"); +$export = new Export($db); +$export->load_arrays($user); + // Security check $result = restrictedArea($user, 'export'); -$export = new Export($db); -$export->load_arrays($user); /* * View diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index d85a0b0b52e..a7a38316360 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -97,6 +97,17 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (34000, 'AD-008', 'AD700', NULL, NULL, 'Escaldes-Engordany'); +-- Australia States & Territories (id country=28) +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'NSW','',1,'','New South Wales'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'VIC','',1,'','Victoria'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'QLD','',1,'','Queensland'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'SA' ,'',1,'','South Australia'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'ACT','',1,'','Australia Capital Territory'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'TAS','',1,'','Tasmania'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'WA' ,'',1,'','Western Australia'); +insert into llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) values (2801,'NT' ,'',1,'','Northern Territory'); + + -- Austria States / Österreich Bundesländer (id country=41) INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'B','BURGENLAND','Burgenland',1); INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (4101,'K','KAERNTEN','Kärnten',1); @@ -564,15 +575,6 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('111', 5209, '', 0, '', 'Nicolás Suárez', 1); INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('112', 5209, '', 0, '', 'General Federico Román', 1); --- Provinces Australia (id country=28) -insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'NSW','',1,'','New South Wales'); -insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'VIC','',1,'','Victoria'); -insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'QLD','',1,'','Queensland'); -insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'SA' ,'',1,'','South Australia'); -insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'ACT','',1,'','Australia Capital Territory'); -insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'TAS','',1,'','Tasmania'); -insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'WA' ,'',1,'','Western Australia'); -insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'NT' ,'',1,'','Northern Territory'); -- Provinces Canada (id country=14) insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (1401,'ON','',1,'','Ontario'); @@ -1666,3 +1668,4 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-KMN', 'KMN', NULL, '金門縣'); INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, nom) VALUES (21301, 'TW-LNN', 'LNN', NULL, '連江縣'); + diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 5812248b129..31d0790b331 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -21,10 +21,12 @@ MembersListToValid=List of draft members (to be validated) MembersListValid=List of valid members MembersListUpToDate=List of valid members with up-to-date subscription MembersListNotUpToDate=List of valid members with out-of-date subscription +MembersListExcluded=List of excluded members MembersListResiliated=List of terminated members MembersListQualified=List of qualified members MenuMembersToValidate=Draft members MenuMembersValidated=Validated members +MenuMembersExcluded=Excluded members MenuMembersResiliated=Terminated members MembersWithSubscriptionToReceive=Members with subscription to receive MembersWithSubscriptionToReceiveShort=Subscription to receive @@ -47,9 +49,12 @@ MemberStatusActiveLate=Subscription expired MemberStatusActiveLateShort=Expired MemberStatusPaid=Subscription up to date MemberStatusPaidShort=Up to date +MemberStatusExcluded=Excluded member +MemberStatusExcludedShort=Excluded MemberStatusResiliated=Terminated member MemberStatusResiliatedShort=Terminated MembersStatusToValid=Draft members +MembersStatusExcluded=Excluded members MembersStatusResiliated=Terminated members MemberStatusNoSubscription=Validated (no subscription needed) MemberStatusNoSubscriptionShort=Validated @@ -82,6 +87,8 @@ Physical=Physical Moral=Moral MorAndPhy=Moral and Physical Reenable=Reenable +ExcludeMember=Exclude a member +ConfirmExcludeMember=Are you sure you want to exclude this member ? ResiliateMember=Terminate a member ConfirmResiliateMember=Are you sure you want to terminate this member? DeleteMember=Delete a member diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index aabbe1791b3..4585841911b 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -155,7 +155,7 @@ StockMustBeEnoughForInvoice=Stock level must be enough to add product/service to StockMustBeEnoughForOrder=Stock level must be enough to add product/service to order (check is done on current real stock when adding a line into order whatever the rule for automatic stock change) StockMustBeEnoughForShipment= Stock level must be enough to add product/service to shipment (check is done on current real stock when adding a line into shipment whatever the rule for automatic stock change) MovementLabel=Label of movement -TypeMovement=Type of movement +TypeMovement=Direction of movement DateMovement=Date of movement InventoryCode=Movement or inventory code IsInPackage=Contained into package diff --git a/htdocs/langs/en_US/zapier.lang b/htdocs/langs/en_US/zapier.lang index c688a0c307f..ababab4a39b 100644 --- a/htdocs/langs/en_US/zapier.lang +++ b/htdocs/langs/en_US/zapier.lang @@ -13,17 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# -# Generic -# - -# Module label 'ModuleZapierForDolibarrName' ModuleZapierForDolibarrName = Zapier for Dolibarr -# Module description 'ModuleZapierForDolibarrDesc' ModuleZapierForDolibarrDesc = Zapier for Dolibarr module - -# -# Admin page -# -ZapierForDolibarrSetup = Setup of Zapier for Dolibarr -ZapierDescription=Interface with Zapier \ No newline at end of file +ZapierForDolibarrSetup=Setup of Zapier for Dolibarr +ZapierDescription=Interface with Zapier +ZapierAbout=About the module Zapier +ZapierSetupPage=Page to setup the module Zapier \ No newline at end of file diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 8e40c1071e2..76131c70719 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -133,8 +133,8 @@ $upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object- //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); -//$result = restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft); - +//restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft); +//if (empty($conf->mymodule->enabled)) accessforbidden(); //if (empty($permissiontoread)) accessforbidden(); diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 3c04618c900..8b2d729c29c 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -1107,6 +1107,47 @@ class MouvementStock extends CommonObject // There is no specific properties. All data into insert are provided as method parameter. } + /** + * Return html string with picto for type of movement + * + * @param int $withlabel With label + * @return string String with URL + */ + public function getTypeMovement($withlabel = 0) + { + global $langs; + + $s = ''; + switch ($this->type) { + case "0": + $s = ''; + if ($withlabel) { + $s .= $langs->trans('StockIncreaseAfterCorrectTransfer'); + } + break; + case "1": + $s = ''; + if ($withlabel) { + $s .= $langs->trans('StockDecreaseAfterCorrectTransfer'); + } + break; + case "2": + $s = ''; + if ($withlabel) { + $s .= $langs->trans('StockDecrease'); + } + break; + case "3": + $s = ''; + if ($withlabel) { + $s .= $langs->trans('StockIncrease'); + } + break; + } + + return $s; + } + /** * Return a link (with optionaly the picto) * Use this->id,this->lastname, this->firstname diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 7c2e2df67e5..62cbe7f8620 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -944,22 +944,6 @@ if ($resql) { print ''; print ''; } - if (!empty($arrayfields['m.type_mouvement']['checked'])) { - // Type of movement - print ''; - } if (!empty($arrayfields['origin']['checked'])) { // Origin of movement print ''; } + if (!empty($arrayfields['m.type_mouvement']['checked'])) { + // Type of movement + print ''; + } if (!empty($arrayfields['m.value']['checked'])) { // Qty print ''; } - if (!empty($arrayfields['m.type_mouvement']['checked'])) { - // Type of movement - switch ($objp->type_mouvement) { - case "0": - print ''; - break; - case "1": - print ''; - break; - case "2": - print ''; - break; - case "3": - print ''; - break; - } - } if (!empty($arrayfields['origin']['checked'])) { // Origin of movement print ''; @@ -1205,13 +1190,25 @@ if ($resql) { } print ''; } + if (!empty($arrayfields['m.type_mouvement']['checked'])) { + // Type of movement + print ''; + } if (!empty($arrayfields['m.value']['checked'])) { // Qty print ''; } if (!empty($arrayfields['m.price']['checked'])) { diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index cbdaa62014b..5a3b0cb0a9c 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -358,12 +358,12 @@ print ''.$langs->trans('Date').' '.$form->sel print '   '; print img_picto('', 'product').' '; print $langs->trans('Product').' '; -$form->select_produits($productid, 'productid', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300'); +print $form->select_produits($productid, 'productid', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300', 0, '', null, 1); print '   '; print img_picto('', 'stock').' '; print $langs->trans('Warehouse').' '; -print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifone'), 'fk_warehouse', '', 1); +print $formproduct->selectWarehouses((GETPOSTISSET('fk_warehouse') ? $fk_warehouse : 'ifone'), 'fk_warehouse', '', 1, 0, 0, '', 0, 0, null, '', '', 1, false, 'e.ref'); print ''; $parameters = array(); diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index be1a574e3fe..d8c25bbebbb 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -642,7 +642,7 @@ if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) { print ''."\n"; } // Birthday -print ''."\n"; // Photo diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index e6c6e040a97..a19c1212761 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -153,7 +153,7 @@ if ($result) { print ''; print ''; print ''."\n"; - //print_liste_field_titre("DateToBirth", $_SERVER["PHP_SELF"],"birth",'',$param,$sortfield,$sortorder); // est-ce nécessaire ?? + //print_liste_field_titre("DateOfBirth", $_SERVER["PHP_SELF"],"birth",'',$param,$sortfield,$sortorder); // est-ce nécessaire ?? print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "email", '', $param, '', $sortfield, $sortorder, 'public_'); print_liste_field_titre("Zip", $_SERVER["PHP_SELF"], "zip", "", $param, '', $sortfield, $sortorder, 'public_'); print_liste_field_titre("Town", $_SERVER["PHP_SELF"], "town", "", $param, '', $sortfield, $sortorder, 'public_'); diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 44b6aae4503..6c171441072 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -174,7 +174,7 @@ if ($action == 'create') { print ''; print ''; - dol_fiche_head('', ''); + print dol_get_fiche_end(); print '
trans("LabelOrTranslationKey"); ?>
trans("LabelOrTranslationKey"); ?>
trans("AttributeCode"); ?> (trans("AlphaNumOnlyLowerCharsAndNoSpace"); ?>)
trans("Totalizable"); ?>>
textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?>
trans("AllEntities"); ?>>
trans("LabelOrTranslationKey"); ?>
trans("LabelOrTranslationKey"); ?>
trans("AttributeCode"); ?>
textwithpicto($langs->trans("HelpOnTooltip"), $langs->trans("HelpOnTooltipDesc")); ?>
trans("AllEntities"); ?>>
'.$langs->trans("AlwaysEditable").''.$form->textwithpicto($langs->trans("Visible"), $langs->trans("VisibleDesc")).''.$form->textwithpicto($langs->trans("DisplayOnPdf"), $langs->trans("DisplayOnPdfDesc")).''.$form->textwithpicto($langs->trans("Totalizable"), $langs->trans("TotalizableDesc")).''.$langs->trans("Entities").''.$langs->trans("Entity").' 
'; - //print ''; - print ''; - print ajax_combobox('search_type_mouvement'); - // TODO: add new function $formentrepot->selectTypeOfMovement(...) like - // print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200'); - print ''; @@ -972,6 +956,22 @@ if ($resql) { print '  '; print ''; + //print ''; + print ''; + print ajax_combobox('search_type_mouvement'); + // TODO: add new function $formentrepot->selectTypeOfMovement(...) like + // print $formproduct->selectWarehouses($search_warehouse, 'search_warehouse', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'maxwidth200'); + print ''; @@ -1044,15 +1044,15 @@ if ($resql) { if (!empty($arrayfields['m.label']['checked'])) { print_liste_field_titre($arrayfields['m.label']['label'], $_SERVER["PHP_SELF"], "m.label", "", $param, "", $sortfield, $sortorder); } - if (!empty($arrayfields['m.type_mouvement']['checked'])) { - print_liste_field_titre($arrayfields['m.type_mouvement']['label'], $_SERVER["PHP_SELF"], "m.type_mouvement", "", $param, '', $sortfield, $sortorder, 'center '); - } if (!empty($arrayfields['origin']['checked'])) { print_liste_field_titre($arrayfields['origin']['label'], $_SERVER["PHP_SELF"], "", "", $param, "", $sortfield, $sortorder); } if (!empty($arrayfields['m.fk_projet']['checked'])) { print_liste_field_titre($arrayfields['m.fk_projet']['label'], $_SERVER["PHP_SELF"], "m.fk_projet", "", $param, '', $sortfield, $sortorder); } + if (!empty($arrayfields['m.type_mouvement']['checked'])) { + print_liste_field_titre($arrayfields['m.type_mouvement']['label'], $_SERVER["PHP_SELF"], "m.type_mouvement", "", $param, '', $sortfield, $sortorder, 'center '); + } if (!empty($arrayfields['m.value']['checked'])) { print_liste_field_titre($arrayfields['m.value']['label'], $_SERVER["PHP_SELF"], "m.value", "", $param, '', $sortfield, $sortorder, 'right '); } @@ -1113,6 +1113,8 @@ if ($resql) { $warehousestatic->fk_parent = $objp->fk_parent; $warehousestatic->statut = $objp->statut; + $movement->type = $objp->type_mouvement; + $arrayofuniqueproduct[$objp->rowid] = $objp->produit; if (!empty($objp->fk_origin)) { $origin = $movement->get_origin($objp->fk_origin, $objp->origintype); @@ -1176,23 +1178,6 @@ if ($resql) { // Label of movement print ''.$objp->label.''.$langs->trans('StockIncreaseAfterCorrectTransfer').''.$langs->trans('StockDecreaseAfterCorrectTransfer').''.$langs->trans('StockDecrease').''.$langs->trans('StockIncrease').''.$origin.''; + print $movement->getTypeMovement(); + print ''; - if ($objp->qt > 0) { + if ($objp->qty > 0) { + print ''; print '+'; + print $objp->qty; + print ''; + } else { + print ''; + print $objp->qty; + print ''; } - print $objp->qty; print '
'.$langs->trans("PasswordAgain").' *
'.$langs->trans("DateToBirth").''; +print '
'.$langs->trans("DateOfBirth").''; print $form->selectDate($birthday, 'birth', 0, 0, 1, "newmember", 1, 0); print '
'.dolGetFirstLastname($langs->trans("Firstname"), $langs->trans("Lastname")).''.$langs->trans("Company").'
'; diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php index 3a8eb998fff..3d65fec02d1 100644 --- a/htdocs/salaries/payment_salary/card.php +++ b/htdocs/salaries/payment_salary/card.php @@ -97,7 +97,7 @@ $h++; */ -dol_fiche_head($head, $hselected, $langs->trans("SalaryPayment"), -1, 'payment'); +print dol_get_fiche_head($head, $hselected, $langs->trans("SalaryPayment"), -1, 'payment'); /* * Deletion confirmation of payment diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 9a9b4e7ed6c..6549a4d38cb 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -768,6 +768,19 @@ i.fa-mars::before, i.fa-venus::before, i.fa-genderless::before { opacity: 0.4; padding-: 3px; } +.stockmovemententry { + color: #080; + transform: rotate(0.25turn); + font-size: 1.2em; +} +.stockmovementexit { + color: #968822; + transform: rotate(0.3turn); + font-size: 1.2em; +} +.stockmovement { + font-size: 1.4em; +} body[class*="colorblind-"] .text-warning{ color : diff --git a/htdocs/theme/eldy/info-box.inc.php b/htdocs/theme/eldy/info-box.inc.php index ad47245eec5..3eda0c40ee7 100644 --- a/htdocs/theme/eldy/info-box.inc.php +++ b/htdocs/theme/eldy/info-box.inc.php @@ -366,14 +366,14 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { content: "\f571"; } .fa-dol-project:before { - content: "\f0e8"; + content: "\f542"; } .fa-dol-commande:before, .fa-dol-order_supplier:before { content: "\f570"; } .fa-dol-contrat:before { - content: "\f1e6"; + content: "\f0f2"; } .fa-dol-ticket:before { content: "\f3ff"; @@ -382,7 +382,7 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) { content: "\f19c"; } .fa-dol-member:before { - content: "\f0c0"; + content: "\f007"; } .fa-dol-expensereport:before { content: "\f555"; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 2209c87c22b..411ed3b41ec 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -899,6 +899,19 @@ i.fa-mars::before, i.fa-venus::before, i.fa-genderless::before { opacity: 0.4; padding-: 3px; } +.stockmovemententry { + color: #080; + transform: rotate(0.25turn); + font-size: 1.2em; +} +.stockmovementexit { + color: #968822; + transform: rotate(0.3turn); + font-size: 1.2em; +} +.stockmovement { + font-size: 1.4em; +} .text-warning{ color : diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index b27e12e3f3e..2ac519b0a26 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -604,7 +604,7 @@ class User extends CommonObject } /** - * Load default value in property ->default_values + * Load default values from database table into property ->default_values * * @return int > 0 if OK, < 0 if KO */ @@ -616,7 +616,7 @@ class User extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php'; $defaultValues = new DefaultValues($this->db); - $result = $defaultValues->fetchAll('', '', 0, 0, array('t.user_id'=>array(0, $this->id), 'entity'=>array($this->entity, $conf->entity))); // User 0 (all) + me (if defined) + $result = $defaultValues->fetchAll('', '', 0, 0, array('t.user_id'=>array(0, $this->id), 'entity'=>array((isset($this->entity) ? $this->entity : $conf->entity), $conf->entity))); // User 0 (all) + me (if defined) if (!is_array($result) && $result < 0) { setEventMessages($defaultValues->error, $defaultValues->errors, 'errors'); diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php index f5467760a89..ade64ea6a7b 100644 --- a/htdocs/variants/admin/admin.php +++ b/htdocs/variants/admin/admin.php @@ -25,7 +25,7 @@ $langs->loadLangs(array("admin", "products")); $action = GETPOST('action', 'alphanohtml'); // Security check -if (!$user->admin || (empty($conf->product->enabled) && empty($conf->service->enabled))) { +if (!$user->admin || empty($conf->variants->enabled)) { accessforbidden(); } diff --git a/htdocs/variants/ajax/getCombinations.php b/htdocs/variants/ajax/getCombinations.php index adb227c2fd6..9c670fa07cc 100644 --- a/htdocs/variants/ajax/getCombinations.php +++ b/htdocs/variants/ajax/getCombinations.php @@ -36,7 +36,24 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php'; -header('Content-Type: application/json'); +$permissiontoread = $user->rights->produit->lire || $user->rights->service->lire; + +// Security check +if (empty($conf->variants->enabled)) { + accessforbidden('Module not enabled'); +} +if ($user->socid > 0) { // Protection if external user + accessforbidden(); +} +//$result = restrictedArea($user, 'variant'); +if (!$permissiontoread) accessforbidden(); + + +/* + * View + */ + +top_httphead('application/json'); $id = GETPOST('id', 'int'); diff --git a/htdocs/variants/ajax/get_attribute_values.php b/htdocs/variants/ajax/get_attribute_values.php index e61676339ee..1d4eab49773 100644 --- a/htdocs/variants/ajax/get_attribute_values.php +++ b/htdocs/variants/ajax/get_attribute_values.php @@ -36,7 +36,24 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php'; require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php'; -header('Content-Type: application/json'); +$permissiontoread = $user->rights->produit->lire || $user->rights->service->lire; + +// Security check +if (empty($conf->variants->enabled)) { + accessforbidden('Module not enabled'); +} +if ($user->socid > 0) { // Protection if external user + accessforbidden(); +} +//$result = restrictedArea($user, 'variant'); +if (!$permissiontoread) accessforbidden(); + + +/* + * View + */ + +top_httphead('application/json'); $id = GETPOST('id', 'int'); diff --git a/htdocs/variants/ajax/orderAttribute.php b/htdocs/variants/ajax/orderAttribute.php index c787517e5c7..1d9e1b8e892 100644 --- a/htdocs/variants/ajax/orderAttribute.php +++ b/htdocs/variants/ajax/orderAttribute.php @@ -37,6 +37,18 @@ if (!defined('NOREQUIRETRAN')) { require '../../main.inc.php'; +$permissiontoread = $user->rights->produit->lire || $user->rights->service->lire; + +// Security check +if (empty($conf->variants->enabled)) { + accessforbidden('Module not enabled'); +} +if ($user->socid > 0) { // Protection if external user + accessforbidden(); +} +//$result = restrictedArea($user, 'variant'); +if (!$permissiontoread) accessforbidden(); + /* * View diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 7a15a4ede97..ed70c6325e3 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -36,6 +36,18 @@ if ($object->fetch($id) < 1) { exit(); } +$permissiontoread = $user->rights->produit->lire || $user->rights->service->lire; + +// Security check +if (empty($conf->variants->enabled)) { + accessforbidden('Module not enabled'); +} +if ($user->socid > 0) { // Protection if external user + accessforbidden(); +} +//$result = restrictedArea($user, 'variant'); +if (!$permissiontoread) accessforbidden(); + /* * Actions diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 218ee874bd6..979ec261663 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -64,6 +64,18 @@ if ($id > 0 || $ref) { $selectedvariant = $_SESSION['addvariant_'.$object->id]; +$permissiontoread = $user->rights->produit->lire || $user->rights->service->lire; + +// Security check +if (empty($conf->variants->enabled)) { + accessforbidden('Module not enabled'); +} +if ($user->socid > 0) { // Protection if external user + accessforbidden(); +} +//$result = restrictedArea($user, 'variant'); +if (!$permissiontoread) accessforbidden(); + /* * Actions diff --git a/htdocs/variants/create.php b/htdocs/variants/create.php index 8f3a1d28d9f..f87ad3ef504 100644 --- a/htdocs/variants/create.php +++ b/htdocs/variants/create.php @@ -24,6 +24,18 @@ $label = GETPOST('label', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $action = GETPOST('action', 'alpha'); +$permissiontoread = $user->rights->produit->lire || $user->rights->service->lire; + +// Security check +if (empty($conf->variants->enabled)) { + accessforbidden('Module not enabled'); +} +if ($user->socid > 0) { // Protection if external user + accessforbidden(); +} +//$result = restrictedArea($user, 'variant'); +if (!$permissiontoread) accessforbidden(); + /* * Actions diff --git a/htdocs/variants/create_val.php b/htdocs/variants/create_val.php index 22dc2a1a110..1ca647960e2 100644 --- a/htdocs/variants/create_val.php +++ b/htdocs/variants/create_val.php @@ -36,6 +36,18 @@ if ($object->fetch($id) < 1) { exit(); } +$permissiontoread = $user->rights->produit->lire || $user->rights->service->lire; + +// Security check +if (empty($conf->variants->enabled)) { + accessforbidden('Module not enabled'); +} +if ($user->socid > 0) { // Protection if external user + accessforbidden(); +} +//$result = restrictedArea($user, 'variant'); +if (!$permissiontoread) accessforbidden(); + /* * Actions diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index dde43397671..bfe4dd0aa72 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -21,6 +21,18 @@ require DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php'; $action = GETPOST('action', 'aZ09'); $object = new ProductAttribute($db); +$permissiontoread = $user->rights->produit->lire || $user->rights->service->lire; + +// Security check +if (empty($conf->variants->enabled)) { + accessforbidden('Module not enabled'); +} +if ($user->socid > 0) { // Protection if external user + accessforbidden(); +} +//$result = restrictedArea($user, 'variant'); +if (!$permissiontoread) accessforbidden(); + /* diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 034583d3440..021edc52920 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -477,7 +477,7 @@ if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $us } // Replacement of string into pages -if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha')) { +if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $usercanedit) { $replacestring = GETPOST('replacestring', 'none'); if (empty($user->rights->website->writephp)) { @@ -567,7 +567,7 @@ if ($action == 'adddir' && $permtouploadfile) */ // Add site -if ($action == 'addsite') { +if ($action == 'addsite' && $usercanedit) { $db->begin(); if (GETPOST('virtualhost', 'alpha') && !preg_match('/^http/', GETPOST('virtualhost', 'alpha'))) { @@ -625,7 +625,7 @@ if ($action == 'addsite') { } // Add page/container -if ($action == 'addcontainer') { +if ($action == 'addcontainer' && $usercanedit) { dol_mkdir($pathofwebsite); $db->begin(); @@ -1148,7 +1148,7 @@ if ($action == 'addcontainer') { } // Delete site -if ($action == 'confirm_deletesite' && $confirm == 'yes') { +if ($action == 'confirm_deletesite' && $confirm == 'yes' && $permissiontodelete) { $error = 0; $db->begin(); @@ -1276,7 +1276,7 @@ if (!GETPOSTISSET('pageid')) { } // Update css Update site properties -if ($action == 'updatecss') { +if ($action == 'updatecss' && $usercanedit) { // If we tried to reload another site/page, we stay on editcss mode. if (GETPOST('refreshsite') || GETPOST('refreshsite_x') || GETPOST('refreshsite.x') || GETPOST('refreshpage') || GETPOST('refreshpage_x') || GETPOST('refreshpage.x')) { $action = 'editcss'; @@ -1523,7 +1523,7 @@ if ($action == 'updatecss') { } // Update page -if ($action == 'setashome') { +if ($action == 'setashome' && $usercanedit) { $db->begin(); $object->fetch(0, $websitekey); $website = $object; @@ -1556,7 +1556,7 @@ if ($action == 'setashome') { } // Update page properties (meta) -if ($action == 'updatemeta') { +if ($action == 'updatemeta' && $usercanedit) { $db->begin(); $result = $object->fetch(0, $websitekey); @@ -1778,8 +1778,8 @@ if ($action == 'updatemeta') { } // Update page -if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'confirm_createfromclone' || $action == 'confirm_createpagefromclone') - || ($action == 'preview' && (GETPOST('refreshsite') || GETPOST('refreshpage') || GETPOST('preview')))) { +if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || $action == 'confirm_createfromclone' || $action == 'confirm_createpagefromclone') + || ($action == 'preview' && (GETPOST('refreshsite') || GETPOST('refreshpage') || GETPOST('preview'))))) { $object->fetch(0, $websitekey); $website = $object; @@ -2041,7 +2041,7 @@ if (($action == 'updatesource' || $action == 'updatecontent' || $action == 'conf } // Export site -if ($action == 'exportsite') { +if ($action == 'exportsite' && !empty($user->rights->website->export)) { $fileofzip = $object->exportWebSite(); if ($fileofzip) { @@ -2060,7 +2060,7 @@ if ($action == 'exportsite') { } // Regenerate site -if ($action == 'regeneratesite') { +if ($action == 'regeneratesite' && $usercanedit) { // Check symlink to medias and restore it if ko. Recreate also dir of website if not found. $pathtomedias = DOL_DATA_ROOT.'/medias'; $pathtomediasinwebsite = $pathofwebsite.'/medias'; @@ -2085,7 +2085,7 @@ if ($action == 'regeneratesite') { } // Import site -if ($action == 'importsiteconfirm') { +if ($action == 'importsiteconfirm' && $usercanedit) { if (empty($_FILES) && !GETPOSTISSET('templateuserfile')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors'); $action = 'importsite'; @@ -2162,7 +2162,7 @@ $domainname = '0.0.0.0:8080'; $tempdir = $conf->website->dir_output.'/'.$websitekey.'/'; // Generate web site sitemaps -if ($action == 'generatesitemaps') { +if ($action == 'generatesitemaps' && $usercanedit) { $domtree = new DOMDocument('1.0', 'UTF-8'); $root = $domtree->createElementNS('http://www.sitemaps.org/schemas/sitemap/0.9', 'urlset'); $domtree->formatOutput = true; @@ -2331,6 +2331,10 @@ if (!GETPOST('hide_websitemenu')) { if (empty($user->rights->website->write)) { $disabled = ' disabled="disabled"'; } + $disabledexport = ''; + if (empty($user->rights->website->export)) { + $disabledexport = ' disabled="disabled"'; + } if ($websitekey) { $virtualurl = ''; @@ -2446,7 +2450,7 @@ if (!GETPOST('hide_websitemenu')) { } //print ''; - print ''; + print ''; print ''; diff --git a/htdocs/zapier/README.md b/htdocs/zapier/README.md new file mode 100644 index 00000000000..66c4385ebc7 --- /dev/null +++ b/htdocs/zapier/README.md @@ -0,0 +1,10 @@ +Module Zapier +============== + +This is a module to add interface between Zapier and Dolibarr ERP CRM. + + +Documentation +------------- + +[Module documentation](https://wiki.dolibarr.org/index.php/Module_Zapier) diff --git a/htdocs/zapier/admin/about.php b/htdocs/zapier/admin/about.php index b24fe42ed22..27f281d549c 100644 --- a/htdocs/zapier/admin/about.php +++ b/htdocs/zapier/admin/about.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once '../lib/zapier.lib.php'; // Translations -$langs->loadLangs(array("errors", "admin", "zapier@zapier")); +$langs->loadLangs(array("errors", "admin", "zapier")); // Access control if (!$user->admin) { @@ -42,6 +42,9 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); +if (empty($conf->zapier->enabled)) accessforbidden(); +if (empty($user->admin)) accessforbidden(); + /* * Actions @@ -57,18 +60,19 @@ $backtopage = GETPOST('backtopage', 'alpha'); $form = new Form($db); $page_name = "ZapierAbout"; -llxHeader('', $langs->trans($page_name)); +$help_url = 'EN:Module_Zapier'; +llxHeader('', $langs->trans($page_name), $help_url); // Subheader $linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans($page_name), $linkback, 'object_zapier@zapier'); +print load_fiche_titre($langs->trans($page_name), $linkback, 'object_zapier'); // Configuration header $head = zapierAdminPrepareHead(); -print dol_get_fiche_head($head, 'about', '', 0, 'zapier@zapier'); +print dol_get_fiche_head($head, 'about', '', 0, 'zapier'); -dol_include_once('/zapier/core/modules/modZapier.class.php'); +dol_include_once('/core/modules/modZapier.class.php'); $tmpmodule = new modZapier($db); print $tmpmodule->getDescLong(); diff --git a/htdocs/zapier/admin/setup.php b/htdocs/zapier/admin/setup.php index 606da5509e3..6f9de26f97c 100644 --- a/htdocs/zapier/admin/setup.php +++ b/htdocs/zapier/admin/setup.php @@ -27,10 +27,10 @@ require '../../main.inc.php'; // Libraries require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"; -require_once '../lib/zapier.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/zapier/lib/zapier.lib.php'; // Translations -$langs->loadLangs(array("admin", "zapier@zapier")); +$langs->loadLangs(array("admin", "zapier")); // Access control if (!$user->admin) { @@ -42,14 +42,18 @@ $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); $arrayofparameters = array( - 'ZAPIERFORDOLIBARR_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1), - 'ZAPIERFORDOLIBARR_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1) +// 'ZAPIERFORDOLIBARR_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1), +// 'ZAPIERFORDOLIBARR_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1) ); +if (empty($conf->zapier->enabled)) accessforbidden(); +if (empty($user->admin)) accessforbidden(); + /* * Actions */ + if ((float) DOL_VERSION >= 6) { include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; } @@ -59,20 +63,21 @@ if ((float) DOL_VERSION >= 6) { * View */ -$page_name = "ZapierSetup"; -llxHeader('', $langs->trans($page_name)); +$page_name = "ZapierForDolibarrSetup"; +$help_url = 'EN:Module_Zapier'; +llxHeader('', $langs->trans($page_name), $help_url); // Subheader $linkback = ''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans($page_name), $linkback, 'object_zapier@zapier'); +print load_fiche_titre($langs->trans($page_name), $linkback, 'object_zapier'); // Configuration header $head = zapierAdminPrepareHead(); -print dol_get_fiche_head($head, 'settings', '', -1, "zapier@zapier"); +print dol_get_fiche_head($head, 'settings', '', -1, "zapier"); // Setup page goes here -echo $langs->trans("ZapierSetupPage").'

'; +echo ''.$langs->trans("ZapierSetupPage").'

'; if ($action == 'edit') { diff --git a/htdocs/zapier/hook_agenda.php b/htdocs/zapier/hook_agenda.php deleted file mode 100644 index 14f1aeda682..00000000000 --- a/htdocs/zapier/hook_agenda.php +++ /dev/null @@ -1,256 +0,0 @@ - - * Copyright (C) ---Put here your own copyright and developer email--- - * - * 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 . - */ - -/** - * \file htdocs/zapier/hook_agenda.php - * \ingroup mymodule - * \brief Page of MyObject events - */ - -// Load Dolibarr environment -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); - - -// Load translation files required by the page -$langs->loadLangs(array("mymodule@mymodule", "other")); - -// Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'aZ09'); -$backtopage = GETPOST('backtopage', 'alpha'); - -if (GETPOST('actioncode', 'array')) { - $actioncode = GETPOST('actioncode', 'array', 3); - if (!count($actioncode)) { - $actioncode = '0'; - } -} else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); -} -$search_agenda_label = GETPOST('search_agenda_label'); - -// Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'mymodule', $id); - -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST("sortfield", 'alpha'); -$sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { - $page = 0; -} // If $page is not defined, or '' or -1 -$offset = $limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (!$sortfield) { - $sortfield = 'a.datep,a.id'; -} -if (!$sortorder) { - $sortorder = 'DESC'; -} - -// Initialize technical objects -$object = new MyObject($db); -$extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('myobjectagenda', 'globalcard')); // Note that conf->hooks_modules contains array - -// Fetch optionals attributes and labels -$extrafields->fetch_name_optionals_label($object->table_element); - -// 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->mymodule->multidir_output[$object->entity]."/".$object->id; -} - - - -/* - * Actions - */ - -$parameters = array('id'=>$socid); -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -} - -if (empty($reshook)) { - // Cancel - if (GETPOST('cancel', 'alpha') && !empty($backtopage)) { - header("Location: ".$backtopage); - exit; - } - - // Purge search criteria - if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers - $actioncode = ''; - $search_agenda_label = ''; - } -} - - - -/* - * View - */ - -$contactstatic = new Contact($db); - -$form = new Form($db); - -if ($object->id > 0) { - $title = $langs->trans("Agenda"); - //if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title; - $help_url = ''; - llxHeader('', $title, $help_url); - - if (!empty($conf->notification->enabled)) { - $langs->load("mails"); - } - $head = myobjectPrepareHead($object); - - - print dol_get_fiche_head($head, 'agenda', $langs->trans("MyObject"), -1, 'myobject@mymodule'); - - // Object card - // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; - - $morehtmlref = '
'; - /* - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->mymodule->creer) - { - if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref.=' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
'; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.=''; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } - }*/ - $morehtmlref .= '
'; - - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - print '
'; - print '
'; - - $object->info($object->id); - dol_print_object_info($object, 1); - - print '
'; - - print dol_get_fiche_end(); - - - - // Actions buttons - - $objthirdparty = $object; - $objcon = new stdClass(); - - $out = ''; - $permok = $user->rights->agenda->myactions->create; - if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) { - //$out.='trans("AddAnAction"),'filenew'); - //$out.=""; - } - - - print '
'; - - if (!empty($conf->agenda->enabled)) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { - print ''.$langs->trans("AddAction").''; - } else { - print ''.$langs->trans("AddAction").''; - } - } - - print '
'; - - if (!empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) { - $param = '&socid='.$socid; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.$contextpage; - } - if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.$limit; - } - - - print load_fiche_titre($langs->trans("ActionsOnMyObject"), '', ''); - - // List of all actions - $filters = array(); - $filters['search_agenda_label'] = $search_agenda_label; - - // TODO Replace this with same code than into list.php - //show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder); - } -} - -// End of page -llxFooter(); -$db->close(); diff --git a/htdocs/zapier/hook_card.php b/htdocs/zapier/hook_card.php deleted file mode 100644 index f57f8873aba..00000000000 --- a/htdocs/zapier/hook_card.php +++ /dev/null @@ -1,406 +0,0 @@ - - * Copyright (C) ---Put here your own copyright and developer email--- - * - * 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 . - */ - -/** - * \file htdocs/zapier/myobject_card.php - * \ingroup mymodule - * \brief Page to create/edit/view myobject - */ - -// Load Dolibarr environment -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); - -// Load translation files required by the page -$langs->loadLangs(array("mymodule@mymodule", "other")); - -// Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); -$confirm = GETPOST('confirm', 'alpha'); -$cancel = GETPOST('cancel', 'aZ09'); -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'zapiercard'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); - -// Initialize technical objects -$object = new MyObject($db); -$extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('myobjectcard', 'globalcard')); // Note that conf->hooks_modules contains array - -// Fetch optionals attributes and labels -$extrafields->fetch_name_optionals_label($object->table_element); - -$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); - -// Initialize array of search criterias -$search_all = GETPOST("search_all", 'alpha'); -$search = array(); -foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) { - $search[$key] = GETPOST('search_'.$key, 'alpha'); - } -} - -if (empty($action) && empty($id) && empty($ref)) { - $action = 'view'; -} - -// 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 - -// Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0); -//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); - - -/* - * Actions - * - * Put here all code to do according to value of "action" parameter - */ - -$parameters = array(); -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -} - -if (empty($reshook)) { - $error = 0; - - $permissiontoadd = $user->rights->mymodule->write; - $permissiontodelete = $user->rights->mymodule->delete || ($permissiontoadd && $object->status == 0); - $backurlforlist = dol_buildpath('/mymodule/myobject_list.php', 1); - if (empty($backtopage)) { - if (empty($id)) { - $backtopage = $backurlforlist; - } else { - $backtopage = dol_buildpath('/mymodule/myobject_card.php', 1).($id > 0 ? $id : '__ID__'); - } - } - $triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record - - // Actions cancel, add, update, delete or clone - include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; - - // Actions when linking object each other - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; - - // Actions when printing a doc from card - include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; -} - - - - -/* - * View - * - * Put here all code to build page - */ - -$form = new Form($db); -$formfile = new FormFile($db); - -llxHeader('', 'MyObject', ''); - -// Example : Adding jquery code -print ''; - - -// Part to create -if ($action == 'create') { - print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("MyObject"))); - - print '
'; - print ''; - print ''; - print ''; - - print dol_get_fiche_head(array(), ''); - - print '
'."\n"; - - // Common attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; - - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - - print '
'."\n"; - - print dol_get_fiche_end(); - - print '
'; - print ''; - print '  '; - print ''; // Cancel for create does not post form if we don't know the backtopage - print '
'; - - print ''; -} - -// Part to edit record -if (($id || $ref) && $action == 'edit') { - print load_fiche_titre($langs->trans("MyObject")); - - print '
'; - print ''; - print ''; - print ''; - print ''; - - print dol_get_fiche_head(); - - print ''."\n"; - - // Common attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; - - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; - - print '
'; - - print dol_get_fiche_end(); - - print '
'; - print '   '; - print '
'; - - print '
'; -} - -// Part to show record -if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { - $res = $object->fetch_optionals(); - - $head = myobjectPrepareHead($object); - print dol_get_fiche_head($head, 'card', $langs->trans("MyObject"), -1, 'myobject@mymodule'); - - $formconfirm = ''; - - // Confirmation to delete - if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteMyObject'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1); - } - - // Clone confirmation - if ($action == 'clone') { - // Create an array for form - $formquestion = array(); - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneMyObject', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); - } - - // Confirmation of action xxxx - if ($action == 'xxx') { - $formquestion = array(); - /* - $forcecombo=0; - if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy - $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) - ); - */ - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); - } - - // Call Hook formConfirm - $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid); - $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if (empty($reshook)) { - $formconfirm .= $hookmanager->resPrint; - } elseif ($reshook > 0) { - $formconfirm = $hookmanager->resPrint; - } - - // Print form confirm - print $formconfirm; - - - // Object card - // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; - - $morehtmlref = '
'; - /* - // Ref bis - $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->mymodule->creer, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->mymodule->write) - { - if ($action != 'classify') - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
'; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.='
'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=$proj->getNomUrl(); - } else { - $morehtmlref.=''; - } - } - } - */ - $morehtmlref .= '
'; - - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - - print '
'; - print '
'; - print '
'; - print ''."\n"; - - // Common attributes - //$keyforbreak='fieldkeytoswithonsecondcolumn'; - include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php'; - - // Other attributes - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; - - print '
'; - print '
'; - print '
'; - - print '

'; - - print dol_get_fiche_end(); - - - // Buttons for actions - if ($action != 'presend' && $action != 'editline') { - print '
'."\n"; - $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook - if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); - } - - if (empty($reshook)) { - // Modify - if ($user->rights->mymodule->write) { - print ''.$langs->trans("Modify").''."\n"; - } else { - print ''.$langs->trans('Modify').''."\n"; - } - - // Clone - if ($user->rights->mymodule->write) { - print ''; - } - - /* - if ($user->rights->mymodule->write) - { - if ($object->status == 1) - { - print ''.$langs->trans("Disable").''."\n"; - } - else - { - print ''.$langs->trans("Enable").''."\n"; - } - } - */ - - if ($user->rights->mymodule->delete) { - print ''.$langs->trans('Delete').''."\n"; - } else { - print ''.$langs->trans('Delete').''."\n"; - } - } - print '
'."\n"; - } - - - // Select mail models is same action as presend - if (GETPOST('modelselected')) { - $action = 'presend'; - } - - if ($action != 'presend') { - print '
'; - print ''; // ancre - - // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('myobject')); - $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); - - - print '
'; - - $MAXEVENT = 10; - - $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, 'myobject', $socid, 1, '', $MAXEVENT, '', $morehtmlright); - - print '
'; - } -} - -// End of page -llxFooter(); -$db->close(); diff --git a/htdocs/zapier/hook_document.php b/htdocs/zapier/hook_document.php deleted file mode 100644 index 8751f184821..00000000000 --- a/htdocs/zapier/hook_document.php +++ /dev/null @@ -1,147 +0,0 @@ - - * Copyright (C) ---Put here your own copyright and developer email--- - * - * 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 . - */ - -/** - * \file htdocs/zapier/myobject_document.php - * \ingroup mymodule - * \brief Tab for documents linked to MyObject - */ - -// Load Dolibarr environment -require '../main.inc.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'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); - -// Load translation files required by the page -$langs->loadLangs(array("mymodule@mymodule", "companies", "other", "mails")); - - -$action = GETPOST('action', 'aZ09'); -$confirm = GETPOST('confirm'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); -$ref = GETPOST('ref', 'alpha'); - -// Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'mymodule', $id); - -// Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST("sortfield", 'alpha'); -$sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); -if (empty($page) || $page == -1) { - $page = 0; -} // If $page is not defined, or '' or -1 -$offset = $limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -if (!$sortorder) { - $sortorder = "ASC"; -} -if (!$sortfield) { - $sortfield = "name"; -} -//if (! $sortfield) $sortfield="position_name"; - -// Initialize technical objects -$object = new MyObject($db); -$extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('myobjectdocument', 'globalcard')); // Note that conf->hooks_modules contains array - -// Fetch optionals attributes and labels -$extrafields->fetch_name_optionals_label($object->table_element); - -// 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->sellyoursaas->multidir_output[$object->entity] . "/myobject/" . dol_sanitizeFileName($object->id); -if ($id > 0 || !empty($ref)) { - $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity]."/myobject/".dol_sanitizeFileName($object->ref); -} - - -/* - * Actions - */ - -include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; - - -/* - * View - */ - -$form = new Form($db); - -$title = $langs->trans("MyObject").' - '.$langs->trans("Files"); -$help_url = 'EN:Module_Zapier|ES:Módulo Zapier|FR:Module_Zapier_FR|DE:Modul_Zapier'; - -llxHeader('', $title, $help_url); - -if ($object->id) { - /* - * Show tabs - */ - $head = myobjectPrepareHead($object); - - print dol_get_fiche_head($head, 'document', $langs->trans("MyObject"), -1, 'myobject@mymodule'); - - - // Build file list - $filearray = dol_dir_list($upload_dir, "files", 0, '', '(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) == 'desc' ?SORT_DESC:SORT_ASC), 1); - $totalsize = 0; - foreach ($filearray as $key => $file) { - $totalsize += $file['size']; - } - - // Object card - // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - print '
'; - - print '
'; - print ''; - - // Number of files - print ''; - - // Total size - print ''; - - print '
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
'.$langs->trans("TotalSizeOfAttachedFiles").''.$totalsize.' '.$langs->trans("bytes").'
'; - - print '
'; - - print dol_get_fiche_end(); -} else { - accessforbidden('', 0, 0); -} - -// End of page -llxFooter(); -$db->close(); diff --git a/htdocs/zapier/hook_list.php b/htdocs/zapier/hook_list.php deleted file mode 100644 index 3894ca3f0a3..00000000000 --- a/htdocs/zapier/hook_list.php +++ /dev/null @@ -1,646 +0,0 @@ - - * Copyright (C) 2019 Frédéric France - * - * 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 . - */ - -/** - * \file htdocs/zapier/hook_list.php - * \ingroup zapier - * \brief List page for hook - */ - - -// Load Dolibarr environment -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.'/zapier/class/hook.class.php'; - -// Load translation files required by the page -$langs->loadLangs(array("zapier", "other")); - -// The action 'add', 'create', 'edit', 'update', 'view', ... -$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; -// The bulk action (combo box choice into lists) -$massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button -$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'zapierlist'; // To manage different context of search -$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') - -$id = GETPOST('id', 'int'); - -// Load variable for pagination -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; -$sortfield = GETPOST('sortfield', 'aZ09comma'); -$sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : (int) GETPOST("page", 'int'); -if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { - // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action - $page = 0; -} -$offset = $limit * $page; -$pageprev = $page - 1; -$pagenext = $page + 1; -//if (! $sortfield) $sortfield="p.date_fin"; -//if (! $sortorder) $sortorder="DESC"; - -// Initialize technical objects -$object = new Hook($db); -$extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->zapier->dir_output.'/temp/massgeneration/'.$user->id; -// Note that conf->hooks_modules contains array -$hookmanager->initHooks(array('zapierhooklist')); - -// Fetch optionals attributes and labels -$extrafields->fetch_name_optionals_label($object->table_element); - -$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); - -// Default sort order (if not yet defined by previous GETPOST) -if (!$sortfield) { - // Set here default search field. By default 1st field in definition. - $sortfield = "t.".key($object->fields); -} -if (!$sortorder) { - $sortorder = "ASC"; -} - -// Security check -$socid = 0; -if ($user->socid > 0) { - // Protection if external user - //$socid = $user->socid; - accessforbidden(); -} -//$result = restrictedArea($user, 'zapier', $id, ''); - -// Initialize array of search criterias -$search_all = GETPOST("search_all", 'alpha'); -$search = array(); -foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key, 'alpha')) { - $search[$key] = GETPOST('search_'.$key, 'alpha'); - } -} - -// List of fields to search into when doing a "search in all" -$fieldstosearchall = array(); -foreach ($object->fields as $key => $val) { - if ($val['searchall']) { - $fieldstosearchall['t.'.$key] = $val['label']; - } -} - -// Definition of fields for list -$arrayfields = array(); -foreach ($object->fields as $key => $val) { - // If $val['visible']==0, then we never show the field - if (!empty($val['visible'])) { - $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']); - } -} -// Extra fields -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; - -$object->fields = dol_sort_array($object->fields, 'position'); -$arrayfields = dol_sort_array($arrayfields, 'position'); - - - -/* - * Actions - */ - -if (GETPOST('cancel', 'alpha')) { - $action = 'list'; - $massaction = ''; -} -if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { - $massaction = ''; -} - -$parameters = array(); -$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks -if ($reshook < 0) { - setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -} - -if (empty($reshook)) { - // Selection of new fields - include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; - - // Purge search criteria - if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { - // All tests are required to be compatible with all browsers - foreach ($object->fields as $key => $val) { - $search[$key] = ''; - } - $toselect = ''; - $search_array_options = array(); - } - if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') - || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { - $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation - } - - // Mass actions - $objectclass = 'Hook'; - $objectlabel = 'Hook'; - $permissiontoread = $user->rights->zapier->read; - $permissiontodelete = $user->rights->zapier->delete; - $uploaddir = $conf->zapier->dir_output; - include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; -} - - - -/* - * View - */ - -$form = new Form($db); - -$now = dol_now(); - -//$help_url="EN:Module_Hook|FR:Module_Hook_FR|ES:Módulo_Hook"; -$help_url = ''; -$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("Hooks")); - - -// Build and execute select -// -------------------------------------------------------------------- -$sql = 'SELECT '; -foreach ($object->fields as $key => $val) { - $sql .= 't.'.$key.', '; -} -// Add fields from extrafields -if (!empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : ''); - } -} -// Add fields from hooks -$parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook -$sql .= $hookmanager->resPrint; -$sql = preg_replace('/, $/', '', $sql); -$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; -if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; -} -if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; -} else { - $sql .= " WHERE 1 = 1"; -} -foreach ($search as $key => $val) { - if ($key == 'status' && $search[$key] == -1) { - continue; - } - $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0); - if ($search[$key] != '') { - $sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search)); - } -} -if ($search_all) { - $sql .= natural_search(array_keys($fieldstosearchall), $search_all); -} -// Add where from extra fields -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; -// Add where from hooks -$parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook -$sql .= $hookmanager->resPrint; - -/* If a group by is required -$sql.= " GROUP BY " -foreach($object->fields as $key => $val) -{ - $sql.='t.'.$key.', '; -} -// Add fields from extrafields -if (! empty($extrafields->attributes[$object->table_element]['label'])) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); -// Add where from hooks -$parameters=array(); -$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook -$sql.=$hookmanager->resPrint; -$sql=preg_replace('/, $/','', $sql); -*/ - -$sql .= $db->order($sortfield, $sortorder); - -// Count total nb of records -$nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $resql = $db->query($sql); - $nbtotalofrecords = $db->num_rows($resql); - if (($page * $limit) > $nbtotalofrecords) { - // if total of record found is smaller than page * limit, goto and load page 0 - $page = 0; - $offset = 0; - } -} -// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set. -if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { - $num = $nbtotalofrecords; -} else { - $sql .= $db->plimit($limit + 1, $offset); - - $resql = $db->query($sql); - if (!$resql) { - dol_print_error($db); - exit; - } - - $num = $db->num_rows($resql); -} - -// Direct jump if only one record found -if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { - $obj = $db->fetch_object($resql); - $id = $obj->rowid; - header("Location: ".dol_buildpath('/zapierfordolibarr/hook_card.php', 1).'?id='.$id); - exit; -} - - -// Output page -// -------------------------------------------------------------------- - -llxHeader('', $title, $help_url); - -// Example : Adding jquery code -// print ''; - -$arrayofselected = is_array($toselect) ? $toselect : array(); - -$param = ''; -if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { - $param .= '&contextpage='.urlencode($contextpage); -} -if ($limit > 0 && $limit != $conf->liste_limit) { - $param .= '&limit='.urlencode($limit); -} -foreach ($search as $key => $val) { - if (is_array($search[$key]) && count($search[$key])) { - foreach ($search[$key] as $skey) { - $param .= '&search_'.$key.'[]='.urlencode($skey); - } - } else { - $param .= '&search_'.$key.'='.urlencode($search[$key]); - } -} -if ($optioncss != '') { - $param .= '&optioncss='.urlencode($optioncss); -} -// Add $param from extra fields -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; - -// List of mass actions available -$arrayofmassactions = array( - //'presend'=>$langs->trans("SendByMail"), - //'builddoc'=>$langs->trans("PDFMerge"), -); -if ($user->rights->zapier->delete) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); -} -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { - $arrayofmassactions = array(); -} -$massactionbutton = $form->selectMassAction('', $arrayofmassactions); - -print '
'; -if ($optioncss != '') { - print ''; -} -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; - -$newcardbutton = ''; -//if ($user->rights->zapier->creer) -//{ - $newcardbutton = ''.$langs->trans('New').''; - $newcardbutton .= ''; - $newcardbutton .= ''; -//} -//else -//{ -// $newcardbutton=''.$langs->trans('New').'; -// $newcardbutton.= ''; -// $newcardbutton.= ''; -//} - -print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies', 0, $newcardbutton, '', $limit); - -// Add code for pre mass action (confirmation or email presend form) -$topicmail = "SendHookRef"; -$modelmail = "hook"; -$objecttmp = new Hook($db); -$trackid = 'zapier'.$object->id; -include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; - -if ($sall) { - foreach ($fieldstosearchall as $key => $val) { - $fieldstosearchall[$key] = $langs->trans($val); - } - print '
'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'
'; -} - -$moreforfilter = ''; -/*$moreforfilter.='
'; -$moreforfilter.= $langs->trans('MyFilter') . ': '; -$moreforfilter.= '
';*/ - -$parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook -if (empty($reshook)) { - $moreforfilter .= $hookmanager->resPrint; -} else { - $moreforfilter = $hookmanager->resPrint; -} - -if (!empty($moreforfilter)) { - print '
'; - print $moreforfilter; - print '
'; -} - -$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields -$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); - -print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table -print ''."\n"; - - -// Fields title search -// -------------------------------------------------------------------- -print ''; -foreach ($object->fields as $key => $val) { - $cssforfield = ''; - if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } - if (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'right'; - } - if ($key == 'status') { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } - if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; - } -} -// Extra fields -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php'; - -// Fields from hook -$parameters = array('arrayfields'=>$arrayfields); -$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook -print $hookmanager->resPrint; -// Action column -print ''; -print ''."\n"; - - -// Fields title label -// -------------------------------------------------------------------- -print ''; -foreach ($object->fields as $key => $val) { - $cssforfield = ''; - if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } - if (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'right'; - } - if ($key == 'status') { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } - if (!empty($arrayfields['t.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n"; - } -} -// Extra fields -include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; -// Hook fields -$parameters = array( - 'arrayfields' => $arrayfields, - 'param' => $param, - 'sortfield' => $sortfield, - 'sortorder' => $sortorder, -); -$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook -print $hookmanager->resPrint; -// Action column -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n"; -print ''."\n"; - - -// Detect if we need a fetch on each output line -$needToFetchEachLine = 0; -if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) { - foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { - if (preg_match('/\$object/', $val)) { - // There is at least one compute field that use $object - $needToFetchEachLine++; - } - } -} - - -// Loop on record -// -------------------------------------------------------------------- -$i = 0; -$totalarray = array(); -while ($i < min($num, $limit)) { - $obj = $db->fetch_object($resql); - if (empty($obj)) { - break; // Should not happen - } - - // Store properties in $object - $object->id = $obj->rowid; - foreach ($object->fields as $key => $val) { - if (isset($obj->$key)) { - $object->$key = $obj->$key; - } - } - - // Show here line of result - print ''; - foreach ($object->fields as $key => $val) { - $cssforfield = ''; - if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } elseif ($key == 'status') { - $cssforfield .= ($cssforfield ? ' ' : '').'center'; - } - - if (in_array($val['type'], array('timestamp'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } elseif ($key == 'ref') { - $cssforfield .= ($cssforfield ? ' ' : '').'nowrap'; - } - - if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real'))) { - $cssforfield .= ($cssforfield ? ' ' : '').'right'; - } - - if (!empty($arrayfields['t.'.$key]['checked'])) { - print ''; - if ($key == 'status') { - print $object->getLibStatut(5); - } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { - print $object->showOutputField($val, $key, $db->jdate($obj->$key), ''); - } else { - print $object->showOutputField($val, $key, $obj->$key, ''); - } - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - if (!empty($val['isameasure'])) { - if (!$i) { - $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; - } - $totalarray['val']['t.'.$key] += $obj->$key; - } - } - } - // Extra fields - include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; - // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); - $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook - print $hookmanager->resPrint; - // Action column - print ''; - if (!$i) { - $totalarray['nbfield']++; - } - - print ''; - - $i++; -} - -// Show total line -include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; - - -// If no record found -if ($num == 0) { - $colspan = 1; - foreach ($arrayfields as $key => $val) { - if (!empty($val['checked'])) { - $colspan++; - } - } - print ''; -} - - -$db->free($resql); - -$parameters = array( - 'arrayfields' => $arrayfields, - 'sql' => $sql, -); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook -print $hookmanager->resPrint; - -print '
'; -$searchpicto = $form->showFilterButtons(); -print $searchpicto; -print '
'; - if ($massactionbutton || $massaction) { - // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($obj->rowid, $arrayofselected)) { - $selected = 1; - } - print ''; - } - print '
'.$langs->trans("NoRecordFound").'
'."\n"; -print '
'."\n"; - -print '
'."\n"; - -if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { - $hidegeneratedfilelistifempty = 1; - if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) { - $hidegeneratedfilelistifempty = 0; - } - - require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; - $formfile = new FormFile($db); - - // Show list of available documents - $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource .= str_replace('&', '&', $param); - - $filedir = $diroutputmassaction; - $genallowed = $user->rights->zapier->read; - $delallowed = $user->rights->zapier->create; - - print $formfile->showdocuments('massfilesarea_zapier', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); -} - -// End of page -llxFooter(); -$db->close(); diff --git a/htdocs/zapier/hook_note.php b/htdocs/zapier/hook_note.php deleted file mode 100644 index ce613da2989..00000000000 --- a/htdocs/zapier/hook_note.php +++ /dev/null @@ -1,153 +0,0 @@ - - * Copyright (C) ---Put here your own copyright and developer email--- - * - * 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 . - */ - -/** - * \file htdocs/modulebuilder/template/myobject_note.php - * \ingroup mymodule - * \brief Car with notes on MyObject - */ - -// Load Dolibarr environment -require '../main.inc.php'; -dol_include_once('/mymodule/class/myobject.class.php'); -dol_include_once('/mymodule/lib/mymodule_myobject.lib.php'); - -// Load translation files required by the page -$langs->loadLangs(array("mymodule@mymodule", "companies")); - -// Get parameters -$id = GETPOST('id', 'int'); -$ref = GETPOST('ref', 'alpha'); -$action = GETPOST('action', 'aZ09'); -$cancel = GETPOST('cancel', 'aZ09'); -$backtopage = GETPOST('backtopage', 'alpha'); - -// Initialize technical objects -$object = new MyObject($db); -$extrafields = new ExtraFields($db); -$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('myobjectnote', 'globalcard')); // Note that conf->hooks_modules contains array - -// Fetch optionals attributes and labels -$extrafields->fetch_name_optionals_label($object->table_element); - -// Security check - Protection if external user -//if ($user->socid > 0) accessforbidden(); -//if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'mymodule', $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->mymodule->multidir_output[$object->entity]."/".$object->id; -} - -$permissionnote = 1; -//$permissionnote=$user->rights->mymodule->creer; // Used by the include of actions_setnotes.inc.php - - - -/* - * Actions - */ - -include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once - - -/* - * View - */ - -$form = new Form($db); - -//$help_url='EN:Customers_Orders|FR:Commandes_Clients|ES:Pedidos de clientes'; -$help_url = ''; -llxHeader('', $langs->trans('MyObject'), $help_url); - -if ($id > 0 || !empty($ref)) { - $object->fetch_thirdparty(); - - $head = myobjectPrepareHead($object); - - print dol_get_fiche_head($head, 'note', $langs->trans("MyObject"), -1, 'myobject@mymodule'); - - // Object card - // ------------------------------------------------------------ - $linkback = ''.$langs->trans("BackToList").''; - - $morehtmlref = '
'; - /* - // Ref customer - $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->mymodule->creer) - { - if ($action != 'classify') - //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - $morehtmlref.=' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
'; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.='
'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } - }*/ - $morehtmlref .= '
'; - - - dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - - - print '
'; - print '
'; - - - $cssclass = "titlefield"; - include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; - - print '
'; - - print dol_get_fiche_end(); -} - -// End of page -llxFooter(); -$db->close(); diff --git a/htdocs/zapier/img/object_hook.png b/htdocs/zapier/img/object_hook.png deleted file mode 100644 index b421fe3c9e0..00000000000 Binary files a/htdocs/zapier/img/object_hook.png and /dev/null differ diff --git a/htdocs/zapier/img/object_zapier.png b/htdocs/zapier/img/object_zapier.png deleted file mode 100644 index de31be865a1..00000000000 Binary files a/htdocs/zapier/img/object_zapier.png and /dev/null differ diff --git a/htdocs/zapier/lib/zapier.lib.php b/htdocs/zapier/lib/zapier.lib.php index 1e2d4f5ec64..a92f2879b4d 100644 --- a/htdocs/zapier/lib/zapier.lib.php +++ b/htdocs/zapier/lib/zapier.lib.php @@ -30,7 +30,7 @@ function zapierAdminPrepareHead() { global $langs, $conf; - $langs->load("zapier@zapier"); + $langs->load("zapier"); $h = 0; $head = array(); diff --git a/htdocs/zapier/zapierindex.php b/htdocs/zapier/zapierindex.php deleted file mode 100644 index 357777000f6..00000000000 --- a/htdocs/zapier/zapierindex.php +++ /dev/null @@ -1,79 +0,0 @@ - - * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2015 Jean-François Ferry - * - * 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 . - */ - -/** - * \file htdocs/zapier/zapierindex.php - * \ingroup zapier - * \brief Home page of zapier top menu - */ - -// Load Dolibarr environment -require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; - -// Load translation files required by the page -$langs->loadLangs(array("zapier@zapier")); - -$action = GETPOST('action', 'aZ09'); - - -// Securite acces client -if (!$user->rights->zapier->read) { - accessforbidden(); -} -$socid = GETPOST('socid', 'int'); -if (isset($user->socid) && $user->socid > 0) { - $action = ''; - $socid = $user->socid; -} - -$max = 5; -$now = dol_now(); - - -/* - * Actions - */ - -// None - - -/* - * View - */ - -$form = new Form($db); -$formfile = new FormFile($db); - -llxHeader("", $langs->trans("ZapierForDolibarrArea")); - -print load_fiche_titre($langs->trans("ZapierForDolibarrArea"), '', 'zapier.png@zapier'); - -print '
'; - - -print '
'; - - -print '
'; - -// End of page -llxFooter(); -$db->close();