mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
add new rule
This commit is contained in:
parent
ccc859ec80
commit
ba8cf2b398
|
|
@ -291,8 +291,8 @@ script:
|
|||
# Ensure we catch errors
|
||||
set -e
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
|
||||
#if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
|
||||
#phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .; fi
|
||||
set +e
|
||||
echo
|
||||
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@
|
|||
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
|
||||
|
||||
<!-- <rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis" /> -->
|
||||
<!-- <rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" /> -->
|
||||
<rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword" />
|
||||
|
||||
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
|
||||
|
|
|
|||
|
|
@ -95,8 +95,7 @@ if ($action == 'update' || $action == 'add') {
|
|||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,8 +166,7 @@ abstract class ActionsAdherentCardCommon
|
|||
$dolibarr_user = new User($this->db);
|
||||
$result = $dolibarr_user->fetch($this->object->user_id);
|
||||
$this->tpl['dolibarr_user'] = $dolibarr_user->getLoginUrl(1);
|
||||
}
|
||||
else $this->tpl['dolibarr_user'] = $langs->trans("NoDolibarrAccess");
|
||||
} else $this->tpl['dolibarr_user'] = $langs->trans("NoDolibarrAccess");
|
||||
}
|
||||
|
||||
if ($action == 'view' || $action == 'delete') {
|
||||
|
|
|
|||
|
|
@ -539,8 +539,7 @@ if (empty($reshook)) {
|
|||
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
|
|
@ -599,8 +598,7 @@ if (empty($reshook)) {
|
|||
//fallback on the old configuration.
|
||||
setEventMessages('WarningMandatorySetupNotComplete', null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
|
|
@ -669,8 +667,7 @@ if (empty($reshook)) {
|
|||
//fallback on the old configuration.
|
||||
setEventMessages('WarningMandatorySetupNotComplete', null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
|
|
@ -1215,8 +1212,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<tr><td>'.$langs->trans("LinkedToDolibarrUser").'</td><td colspan="2" class="valeur">';
|
||||
if ($object->user_id) {
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
|
||||
}
|
||||
else print $langs->trans("NoDolibarrAccess");
|
||||
} else print $langs->trans("NoDolibarrAccess");
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes. Fields from hook formObjectOptions and Extrafields.
|
||||
|
|
@ -1502,8 +1498,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
} else {
|
||||
if ($object->need_subscription == 0) {
|
||||
print $langs->trans("SubscriptionNotNeeded");
|
||||
}
|
||||
elseif (!$adht->subscription) {
|
||||
} 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
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -192,8 +192,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
|||
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE"));
|
||||
}
|
||||
if (!$mesg) $result = members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs);
|
||||
}
|
||||
elseif ($mode == 'label') {
|
||||
} elseif ($mode == 'label') {
|
||||
if (!count($arrayofmembers)) {
|
||||
$mesg = $langs->trans("ErrorRecordNotFound");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,8 +190,7 @@ class AdherentType extends CommonObject
|
|||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
elseif (isset($this->multilangs[$key])) {
|
||||
} elseif (isset($this->multilangs[$key])) {
|
||||
$sql = "SELECT rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent_type_lang";
|
||||
$sql .= " WHERE fk_type=".$this->id;
|
||||
|
|
@ -550,8 +549,7 @@ class AdherentType extends CommonObject
|
|||
$memberstatic->fetch($obj->rowid);
|
||||
}
|
||||
$ret[$obj->rowid] = $memberstatic;
|
||||
}
|
||||
else $ret[$obj->rowid] = $obj->rowid;
|
||||
} else $ret[$obj->rowid] = $obj->rowid;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -575,9 +573,7 @@ class AdherentType extends CommonObject
|
|||
public function getmorphylib($morphy = '')
|
||||
{
|
||||
global $langs;
|
||||
if ($morphy == 'phy') { return $langs->trans("Physical"); }
|
||||
elseif ($morphy == 'mor') { return $langs->trans("Moral"); }
|
||||
else return $langs->trans("MorPhy");
|
||||
if ($morphy == 'phy') { return $langs->trans("Physical"); } elseif ($morphy == 'mor') { return $langs->trans("Moral"); } else return $langs->trans("MorPhy");
|
||||
//return $morphy;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,8 +149,7 @@ class Members extends DolibarrApi
|
|||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieve member list : '.$db->lasterror());
|
||||
}
|
||||
if (!count($obj_ret)) {
|
||||
|
|
|
|||
|
|
@ -132,8 +132,7 @@ class MembersTypes extends DolibarrApi
|
|||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieve member type list : '.$db->lasterror());
|
||||
}
|
||||
if (!count($obj_ret)) {
|
||||
|
|
|
|||
|
|
@ -129,8 +129,7 @@ class Subscriptions extends DolibarrApi
|
|||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieve subscription list : '.$db->lasterror());
|
||||
}
|
||||
if (!count($obj_ret)) {
|
||||
|
|
|
|||
|
|
@ -67,8 +67,7 @@ if ($action == 'dolibarr2ldap') {
|
|||
|
||||
if ($result >= 0) {
|
||||
setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -344,8 +344,7 @@ if (GETPOSTISSET("statut")) {
|
|||
if ($statut == '1' && $filter == 'uptodate') { $titre = $langs->trans("MembersListUpToDate"); }
|
||||
if ($statut == '1' && $filter == 'outofdate') { $titre = $langs->trans("MembersListNotUpToDate"); }
|
||||
if ($statut == '0') { $titre = $langs->trans("MembersListResiliated"); }
|
||||
}
|
||||
elseif ($action == 'search') {
|
||||
} elseif ($action == 'search') {
|
||||
$titre = $langs->trans("MembersListQualified");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -207,8 +207,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
|||
|
||||
// Show graphs
|
||||
print '<table class="border centpercent"><tr class="pair nohover"><td class="center">';
|
||||
if ($mesg) { print $mesg; }
|
||||
else {
|
||||
if ($mesg) { print $mesg; } else {
|
||||
print $px1->show();
|
||||
print "<br>\n";
|
||||
print $px2->show();
|
||||
|
|
|
|||
|
|
@ -121,12 +121,10 @@ if ($action == 'confirm_create_thirdparty' && $confirm == 'yes' && $user->rights
|
|||
if ($result < 0) {
|
||||
$langs->load("errors");
|
||||
setEventMessages($company->error, $company->errors, 'errors');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$action = 'addsubscription';
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -246,15 +244,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||
setEventMessages($errmsg, null, 'errors');
|
||||
$error++;
|
||||
$action = 'addsubscription';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (!empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none') {
|
||||
if ($_POST["subscription"]) {
|
||||
if (!$_POST["label"]) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
|
||||
if ($_POST["paymentsave"] != 'invoiceonly' && !$_POST["operation"]) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
|
||||
if ($_POST["paymentsave"] != 'invoiceonly' && !($_POST["accountid"] > 0)) $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount"));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ($_POST["accountid"]) $errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount");
|
||||
}
|
||||
if ($errmsg) {
|
||||
|
|
@ -284,16 +280,14 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||
if ($result < 0) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// If an invoice was created, it is into $object->invoice
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$db->rollback();
|
||||
$action = 'addsubscription';
|
||||
}
|
||||
|
|
@ -355,12 +349,10 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||
if ($result < 0) {
|
||||
$errmsg = $object->error;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($langs->trans("EmailSentToMember", $object->email), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($langs->trans("NoEmailSentToMember"), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
|
@ -491,13 +483,11 @@ if ($rowid > 0) {
|
|||
if ($object->hasDelay()) {
|
||||
print " ".img_warning($langs->trans("Late"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (!$adht->subscription) {
|
||||
print $langs->trans("SubscriptionNotRecorded");
|
||||
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
|
|
@ -525,14 +515,12 @@ if ($rowid > 0) {
|
|||
print '</td>';
|
||||
print '<td class="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
print '</tr></table></form>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ($object->fk_soc) {
|
||||
$company = new Societe($db);
|
||||
$result = $company->fetch($object->fk_soc);
|
||||
print $company->getNomUrl(1);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print $langs->trans("NoThirdPartyAssociatedToMember");
|
||||
}
|
||||
}
|
||||
|
|
@ -555,12 +543,10 @@ if ($rowid > 0) {
|
|||
print '</td><td colspan="2" class="valeur">';
|
||||
if ($action == 'editlogin') {
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'userid', '');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ($object->user_id) {
|
||||
$form->form_users($_SERVER['PHP_SELF'].'?rowid='.$object->id, $object->user_id, 'none');
|
||||
}
|
||||
else print $langs->trans("NoDolibarrAccess");
|
||||
} else print $langs->trans("NoDolibarrAccess");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -123,8 +123,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
|
|||
if (empty($object->label)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."adherent_type WHERE libelle='".$db->escape($object->label)."'";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
|
|
@ -142,13 +141,11 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
|
|||
if ($id > 0) {
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$action = 'create';
|
||||
}
|
||||
}
|
||||
|
|
@ -176,8 +173,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) {
|
|||
|
||||
if ($ret >= 0 && !count($object->errors)) {
|
||||
setEventMessages($langs->trans("MemberTypeModified"), null, 'mesgs');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
|
|
@ -193,8 +189,7 @@ if ($action == 'confirm_delete' && $user->rights->adherent->configurer) {
|
|||
setEventMessages($langs->trans("MemberTypeDeleted"), null, 'mesgs');
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($langs->trans("MemberTypeCanNotBeDeleted"), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
|
|
@ -277,9 +272,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
|||
print '</td>';
|
||||
print '<td>'.dol_escape_htmltag($objp->label).'</td>';
|
||||
print '<td class="center">';
|
||||
if ($objp->morphy == 'phy') { print $langs->trans("Physical"); }
|
||||
elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); }
|
||||
else print $langs->trans("MorPhy");
|
||||
if ($objp->morphy == 'phy') { print $langs->trans("Physical"); } elseif ($objp->morphy == 'mor') { print $langs->trans("Moral"); } else print $langs->trans("MorPhy");
|
||||
print '</td>';
|
||||
print '<td class="center">'.yn($objp->subscription).'</td>';
|
||||
print '<td class="center">'.yn($objp->vote).'</td>';
|
||||
|
|
@ -296,8 +289,7 @@ if (!$rowid && $action != 'create' && $action != 'edit') {
|
|||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
@ -424,8 +416,7 @@ if ($rowid > 0) {
|
|||
print '<tr><td class="titlefield">'.$langs->trans("Duration").'</td><td colspan="2">'.$object->duration_value.' ';
|
||||
if ($object->duration_value > 1) {
|
||||
$dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years"));
|
||||
}
|
||||
elseif ($object->duration_value > 0) {
|
||||
} elseif ($object->duration_value > 0) {
|
||||
$dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year"));
|
||||
}
|
||||
print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')." ";
|
||||
|
|
@ -535,14 +526,8 @@ if ($rowid > 0) {
|
|||
|
||||
$titre = $langs->trans("MembersList");
|
||||
if ($status != '') {
|
||||
if ($status == '-1,1') { $titre = $langs->trans("MembersListQualified"); }
|
||||
elseif ($status == '-1') { $titre = $langs->trans("MembersListToValid"); }
|
||||
elseif ($status == '1' && !$filter) { $titre = $langs->trans("MembersListValid"); }
|
||||
elseif ($status == '1' && $filter == 'uptodate') { $titre = $langs->trans("MembersListUpToDate"); }
|
||||
elseif ($status == '1' && $filter == 'outofdate') { $titre = $langs->trans("MembersListNotUpToDate"); }
|
||||
elseif ($status == '0') { $titre = $langs->trans("MembersListResiliated"); }
|
||||
}
|
||||
elseif ($action == 'search') {
|
||||
if ($status == '-1,1') { $titre = $langs->trans("MembersListQualified"); } elseif ($status == '-1') { $titre = $langs->trans("MembersListToValid"); } elseif ($status == '1' && !$filter) { $titre = $langs->trans("MembersListValid"); } elseif ($status == '1' && $filter == 'uptodate') { $titre = $langs->trans("MembersListUpToDate"); } elseif ($status == '1' && $filter == 'outofdate') { $titre = $langs->trans("MembersListNotUpToDate"); } elseif ($status == '0') { $titre = $langs->trans("MembersListResiliated"); }
|
||||
} elseif ($action == 'search') {
|
||||
$titre = $langs->trans("MembersListQualified");
|
||||
}
|
||||
|
||||
|
|
@ -623,8 +608,7 @@ if ($rowid > 0) {
|
|||
print '<tr class="oddeven">';
|
||||
if ($objp->company != '') {
|
||||
print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->societe, 12).'</a></td>'."\n";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"), "user").' '.$adh->getFullName($langs, 0, -1, 32).'</a></td>'."\n";
|
||||
}
|
||||
|
||||
|
|
@ -655,19 +639,16 @@ if ($rowid > 0) {
|
|||
print '<td class="nowrap center">';
|
||||
if ($datefin < dol_now() && $objp->statut > 0) {
|
||||
print dol_print_date($datefin, 'day')." ".img_warning($langs->trans("SubscriptionLate"));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print dol_print_date($datefin, 'day');
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print '<td class="nowrap left">';
|
||||
if ($objp->subscription == 'yes') {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($objp->statut > 0) print " ".img_warning();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -695,8 +676,7 @@ if ($rowid > 0) {
|
|||
if ($num > $conf->liste_limit) {
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,8 +70,7 @@ if (empty($reshook)) {
|
|||
|
||||
if ($result >= 0) {
|
||||
setEventMessages($langs->trans("MemberTypeSynchronized"), null, 'mesgs');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
|
@ -159,19 +158,16 @@ if ($result > 0) {
|
|||
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
|
||||
if (!is_array($records)) {
|
||||
print '<tr class="oddeven"><td colspan="2"><font class="error">'.$langs->trans("ErrorFailedToReadLDAP").'</font></td></tr>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$result = show_ldap_content($records, 0, $records['count'], true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print '<tr class="oddeven"><td colspan="2">'.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')</td></tr>';
|
||||
}
|
||||
|
||||
$ldap->unbind();
|
||||
$ldap->close();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,8 +72,7 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->ad
|
|||
$object->label = $_POST["libelle"];
|
||||
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
|
||||
$object->other = dol_htmlcleanlastbr($_POST["other"]);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
|
||||
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
|
||||
$object->multilangs[$_POST["forcelangprod"]]["other"] = dol_htmlcleanlastbr($_POST["other"]);
|
||||
|
|
@ -82,8 +81,7 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->ad
|
|||
// backup into database
|
||||
if ($object->setMultiLangs($user) > 0) {
|
||||
$action = '';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$action = 'add';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
|
@ -100,8 +98,7 @@ if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->a
|
|||
$object->label = $_POST["libelle-".$key];
|
||||
$object->description = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
||||
$object->other = dol_htmlcleanlastbr($_POST["other-".$key]);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$object->multilangs[$key]["label"] = $_POST["libelle-".$key];
|
||||
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
||||
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr($_POST["other-".$key]);
|
||||
|
|
@ -110,8 +107,7 @@ if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->a
|
|||
|
||||
if ($object->setMultiLangs($user) > 0) {
|
||||
$action = '';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$action = 'edit';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
|
@ -126,8 +122,7 @@ if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && $user->rights-
|
|||
|
||||
if ($object->delMultiLangs($langtodelete, $user) > 0) {
|
||||
$action = '';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$action = 'edit';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
|
@ -229,8 +224,7 @@ if ($action == 'edit') {
|
|||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
elseif ($action != 'add') {
|
||||
} elseif ($action != 'add') {
|
||||
if (!empty($object->multilangs)) {
|
||||
foreach ($object->multilangs as $key => $value) {
|
||||
$s = picto_from_langcode($key);
|
||||
|
|
|
|||
|
|
@ -102,8 +102,7 @@ if ($confirm == 'yes') {
|
|||
header('Location: '.dol_buildpath('/variants/list.php', 2));
|
||||
}
|
||||
exit();
|
||||
}
|
||||
elseif ($action == 'confirm_deletevalue')
|
||||
} elseif ($action == 'confirm_deletevalue')
|
||||
{
|
||||
if ($objectval->fetch($valueid) > 0) {
|
||||
if ($objectval->delete() < 1) {
|
||||
|
|
|
|||
|
|
@ -119,8 +119,7 @@ class ProductAttribute
|
|||
|
||||
$return[] = $tmp;
|
||||
}
|
||||
}
|
||||
else dol_print_error($this->db);
|
||||
} else dol_print_error($this->db);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,8 +105,7 @@ if ($_POST) {
|
|||
|
||||
if (!$features) {
|
||||
setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$reference = trim($reference);
|
||||
if (empty($reference)) {
|
||||
$reference = false;
|
||||
|
|
@ -165,8 +164,7 @@ if ($_POST) {
|
|||
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
elseif (!empty($massaction))
|
||||
} elseif (!empty($massaction))
|
||||
{
|
||||
$bulkaction = $massaction;
|
||||
$error = 0;
|
||||
|
|
@ -219,8 +217,7 @@ if ($_POST) {
|
|||
$db->commit();
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
elseif ($valueid > 0) {
|
||||
} elseif ($valueid > 0) {
|
||||
if ($prodcomb->fetch($valueid) < 0) {
|
||||
dol_print_error($db, $langs->trans('ErrorRecordNotFound'));
|
||||
exit();
|
||||
|
|
@ -359,8 +356,7 @@ if (!empty($id) || !empty($ref))
|
|||
if ($object->weight != '')
|
||||
{
|
||||
print $object->weight." ".measuringUnitString(0, "weight", $object->weight_units);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
print "</td></tr>\n";
|
||||
|
|
@ -625,8 +621,7 @@ if (!empty($id) || !empty($ref))
|
|||
<?php
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if ($action === 'delete') {
|
||||
if ($prodcomb->fetch($valueid) > 0) {
|
||||
$prodstatic->fetch($prodcomb->fk_product_child);
|
||||
|
|
@ -797,8 +792,7 @@ if (!empty($id) || !empty($ref))
|
|||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
|
||||
}
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -42,8 +42,7 @@ if ($_POST) {
|
|||
if ($backtopage)
|
||||
{
|
||||
header('Location: '.$backtopage);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
header('Location: '.DOL_URL_ROOT.'/variants/card.php?id='.$resid.'&backtopage='.urlencode($backtopage));
|
||||
}
|
||||
exit;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user