diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index aef5789549e..01dad4f08fa 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1543,7 +1543,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Create form popup $formquestion = array(); if ($object->email) { - $formquestion[] = array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL ?true:false)); + $formquestion[] = array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (getDolGlobalString('ADHERENT_DEFAULT_SENDINFOBYMAIL') ? true : false)); } if (!empty($conf->mailman->enabled) && !empty($conf->global->ADHERENT_USE_MAILMAN)) { $formquestion[] = array('type'=>'other', 'label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"), 'value'=>''); @@ -1574,7 +1574,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $outputlangs->loadLangs(array("main", "members")); // Get email content from template $arraydefaultmessage = null; - $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION; + $labeltouse = getDolGlobalString('ADHERENT_EMAIL_TEMPLATE_CANCELATION'); if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c860a19d588..9a7e6d4466b 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -961,10 +961,10 @@ class Adherent extends CommonObject } /** - * Fonction qui supprime l'adherent et les donnees associees + * Fonction to delete a member and its data * * @param int $rowid Id of member to delete - * @param User $user User object + * @param User $user User object * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, 0=nothing to do, >0 if OK */ diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 3f857ce827b..10c57ea7afe 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -434,6 +434,7 @@ class AdherentType extends CommonObject /** * Function to delete the member's status + * TODO Add param "User $user" * * @return int > 0 if OK, 0 if not found, < 0 if KO */ diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index f336530ff4e..c987878e488 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -41,6 +41,7 @@ $langs->load("members"); $rowid = GETPOST('rowid', 'int'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $sall = GETPOST("sall", "alpha"); @@ -200,7 +201,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) { exit; } -if ($action == 'confirm_delete' && $user->rights->adherent->configurer) { +if ($action == 'confirm_delete' && !empty($user->rights->adherent->configurer)) { $object->fetch($rowid); $res = $object->delete(); @@ -439,7 +440,7 @@ if ($rowid > 0) { print '
'; print '
'; - print ''; + print '
'; // Morphy print ''; @@ -669,20 +670,23 @@ if ($rowid > 0) { print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder); print "\n"; - while ($i < $num && $i < $conf->liste_limit) { + $adh = new Adherent($db); + + $imaxinloop = ($limit ? min($num, $limit) : $num); + while ($i < $imaxinloop) { $objp = $db->fetch_object($resql); $datefin = $db->jdate($objp->datefin); - $adh = new Adherent($db); $adh->lastname = $objp->lastname; $adh->firstname = $objp->firstname; $adh->datefin = $datefin; $adh->need_subscription = $objp->subscription; $adh->statut = $objp->status; - // Lastname print ''; + + // Lastname if ($objp->company != '') { print ''."\n"; } else { @@ -690,7 +694,7 @@ if ($rowid > 0) { } // Login - print "\n"; + print "\n"; // Type /*print ''; + } + print "
'.$langs->trans("MembersNature").''.$object->getmorphylib($object->morphy).'
'.img_object($langs->trans("ShowMember"), "user", 'class="paddingright"').$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->company, 12).'".$objp->login."".dol_escape_htmltag($objp->login)."'; @@ -747,11 +751,15 @@ if ($rowid > 0) { $i++; } + if ($i == 0) { + print '
'.$langs->trans("None").'
\n"; print '
'; print ''; - if ($num > $conf->liste_limit) { + if ($num > $limit) { print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, ''); } } else { diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 72976d4e65f..d7d062a1e5f 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; // Load translation files required by the page $langs->loadLangs(array('members', 'languages')); -$id = GETPOST('rowid', 'int'); +$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $ref = GETPOST('ref', 'alphanohtml'); @@ -61,7 +61,12 @@ if ($cancel == $langs->trans("Cancel")) { if ($action == 'delete' && GETPOST('langtodelete', 'alpha')) { $object = new AdherentType($db); $object->fetch($id); - $object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user); + $result = $object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user); + if ($result > 0) { + setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); + header("Location: ".$_SERVER["PHP_SELF"].'?id='.$id); + exit; + } } // Add translation diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index db62dfe6a9f..75cbefec3ec 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -216,7 +216,9 @@ class CActionComm if ($obj->module == 'shipping' && !empty($conf->expedition->enabled) && !empty($user->rights->expedition->lire)) { $qualified = 1; } - if (preg_split("/@/", $obj->module, -1)[1] == 'eventorganization' && !empty($conf->eventorganization->enabled)) { + // For case module = 'myobject@eventorganization' + $tmparray = preg_split("/@/", $obj->module, -1); + if (count($tmparray) > 1 && $tmparray[1] == 'eventorganization' && !empty($conf->eventorganization->enabled)) { $qualified = 1; } // For the generic case with type = 'module...' and module = 'myobject@mymodule' diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 0ba88228666..f19c3e03684 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search $id = GETPOST('id', 'int'); @@ -46,7 +47,7 @@ if (empty($object->thirdparty)) { $socid = $object->thirdparty->id; // Sort & Order fields -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); @@ -230,7 +231,7 @@ if ($type_element == 'fichinter') { // Customer : show products from invoices $tables_from .= ' INNER JOIN '.MAIN_DB_PREFIX.'element_contact ec ON ec.element_id=c.rowid AND ec.fk_socpeople = '.((int) $object->id); $tables_from .= ' INNER JOIN '.MAIN_DB_PREFIX."c_type_contact tc ON (ec.fk_c_type_contact=tc.rowid and tc.element='propal' and tc.source='external' and tc.active=1)"; $where = ' WHERE c.entity IN ('.getEntity('propal').')'; - $datePrint = 'c.datep'; + $dateprint = 'c.datep'; $doc_number = 'c.ref'; $thirdTypeSelect = 'customer'; } elseif ($type_element == 'order') { @@ -443,6 +444,8 @@ if ($sql_select) { $i = 0; + $total_qty = 0; + $total_ht = 0; while (($objp = $db->fetch_object($resql)) && $i < min($num, $limit)) { $documentstatic->id = $objp->doc_id; $documentstatic->ref = $objp->doc_number; diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php index b05709f019a..e88c056af37 100644 --- a/htdocs/contact/project.php +++ b/htdocs/contact/project.php @@ -76,7 +76,11 @@ if ($id) { $linkback = ''.$langs->trans("BackToList").''; - $morehtmlref = '
'; + $morehtmlref = ''; + $morehtmlref .= img_picto($langs->trans("Download").' '.$langs->trans("VCard"), 'vcard.png', 'class="valignmiddle marginleftonly paddingrightonly"'); + $morehtmlref .= ''; + + $morehtmlref .= '
'; if (empty($conf->global->SOCIETE_DISABLE_CONTACTS) && !empty($socid)) { $object->thirdparty->fetch($socid); // Thirdparty diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 1fba506e910..256039fa96f 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -44,7 +44,6 @@ if ($result <= 0) { exit; } -$physicalperson = 1; $company = new Societe($db); if ($contact->socid) { @@ -107,7 +106,7 @@ if ($company->id) { } // Si contact lie a un tiers non de type "particulier" - if ($contact->typent_code != 'TE_PRIVATE') { + if ($company->typent_code != 'TE_PRIVATE') { $v->setOrg($company->name); } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 50858391da3..7c34411306b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5026,7 +5026,7 @@ class Form $more .= '
 
'; } $more .= '