28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/member.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/adherents/class/adherent_type.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/partnership/class/partnership.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/partnership/lib/partnership.lib.php';
46$langs->loadLangs(array(
"companies",
"members",
"partnership",
"other"));
51$action =
GETPOST(
'action',
'aZ09');
52$confirm =
GETPOST(
'confirm',
'alpha');
53$cancel =
GETPOST(
'cancel',
'aZ09');
54$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'partnershipcard';
55$backtopage =
GETPOST(
'backtopage',
'alpha');
56$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
68$diroutputmassaction =
$conf->partnership->dir_output.
'/temp/massgeneration/'.$user->id;
69$hookmanager->initHooks(array(
'partnershipthirdparty',
'globalcard'));
72$extrafields->fetch_name_optionals_label(
$object->table_element);
74$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
77$search_all =
GETPOST(
"search_all",
'alpha');
80foreach (
$object->fields as $key => $val) {
81 if (
GETPOST(
'search_'.$key,
'alpha')) {
82 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
87include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
89$permissiontoread = $user->hasRight(
'partnership',
'read');
90$permissiontoadd = $user->hasRight(
'partnership',
'write');
91$permissiontodelete = $user->hasRight(
'partnership',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
92$permissionnote = $user->hasRight(
'partnership',
'write');
93$permissiondellink = $user->hasRight(
'partnership',
'write');
94$usercanclose = $user->hasRight(
'partnership',
'write');
95$upload_dir =
$conf->partnership->multidir_output[isset(
$object->entity) ?
$object->entity : 1];
101if (!isModEnabled(
'partnership')) {
104if (empty($permissiontoread)) {
107if ($action ==
'edit' && empty($permissiontoadd)) {
110if (($action ==
'update' || $action ==
'edit') &&
$object->status != $object::STATUS_DRAFT) {
116$result =
restrictedArea($user,
'adherent', $id,
'',
'',
'socid',
'rowid', 0);
123$parameters = array();
124$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
132if (empty($reshook)) {
135 $backtopage =
dol_buildpath(
'/partnership/partnership.php', 1).
'?rowid='.(
$id > 0 ?
$id :
'__ID__');
138 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
141$object->fields[
'fk_member'][
'visible'] = 0;
142if (
$object->id > 0 &&
$object->status == $object::STATUS_REFUSED && empty($action)) {
143 $object->fields[
'reason_decline_or_cancel'][
'visible'] = 1;
145$object->fields[
'note_public'][
'visible'] = 1;
152$form =
new Form($db);
155$title = $langs->trans(
"Partnership");
156$help_url =
"EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros|DE:Modul_Mitglieder";
158llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'mod-member page-card_partnership');
160$form =
new Form($db);
163 $langs->load(
"members");
168 if (isModEnabled(
'notification')) {
169 $langs->load(
"mails");
176 print
dol_get_fiche_head($head,
'partnership', $langs->trans(
"ThirdParty"), -1,
'user');
178 $linkback =
'<a href="'.DOL_URL_ROOT.
'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
180 dol_banner_tab($object,
'rowid', $linkback);
182 print
'<div class="fichecenter">';
184 print
'<div class="underbanner clearboth"></div>';
185 print
'<table class="border centpercent tableforfield">';
189 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
' / '.$langs->trans(
"Id").
'</td><td class="valeur">'.
$object->login.
' </td></tr>';
193 print
'<tr><td class="titlefield">'.$langs->trans(
"Type").
'</td><td class="valeur">'.$adht->getNomUrl(1).
"</td></tr>\n";
196 print
'<tr><td>'.$langs->trans(
"MemberNature").
'</td><td class="valeur" >'.
$object->getmorphylib().
'</td>';
200 print
'<tr><td>'.$langs->trans(
"Company").
'</td><td class="valeur">'.
$object->company.
'</td></tr>';
203 print
'<tr><td>'.$langs->trans(
"UserTitle").
'</td><td class="valeur">'.
$object->getCivilityLabel().
' </td>';
217if (
$object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
220 if ($action !=
'presend') {
221 print
'<div class="tabsAction">'.
"\n";
222 $parameters = array();
223 $reshook = $hookmanager->executeHooks(
'addMoreActionsButtons', $parameters, $object, $action);
228 if (empty($reshook)) {
230 if ($permissiontoadd) {
231 print
dolGetButtonAction($langs->trans(
'AddPartnership'),
'',
'default', DOL_URL_ROOT.
'/partnership/partnership_card.php?action=create&fk_member='.
$object->id.
'&backtopage='.urlencode(DOL_URL_ROOT.
'/adherents/partnership.php?id='.
$object->id),
'', $permissiontoadd);
241 print
load_fiche_titre($langs->trans(
"PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv(
"Partnership")), $morehtmlright,
'');
249 $partnershipid =
$object->fetch(0,
"", $memberid);
251 if ($partnershipid > 0) {
252 print
'<div class="fichecenter">';
253 print
'<div class="fichehalfleft">';
254 print
'<div class="underbanner clearboth"></div>';
255 print
'<table class="border centpercent tableforfield">'.
"\n";
261 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
265 $fadherent->fetch(
$object->fk_member);
266 print
'<tr><td>'.$langs->trans(
"SubscriptionEndDate").
'</td><td class="valeur">';
267 if ($fadherent->datefin) {
269 if ($fadherent->hasDelay()) {
270 print
" ".img_warning($langs->trans(
"Late"));
273 if (!$adht->subscription) {
274 print $langs->trans(
"SubscriptionNotRecorded");
275 if ($fadherent->statut > 0) {
276 print
" ".img_warning($langs->trans(
"Late"));
279 print $langs->trans(
"SubscriptionNotReceived");
280 if ($fadherent->statut > 0) {
281 print
" ".img_warning($langs->trans(
"Late"));
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage members of a foundation.
Class to manage members type.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
member_prepare_head(Adherent $object)
Return array head with list of tabs to view object information.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.